Control USB-powered devices with a Raspberry Pi

Power Point

© Lead Image © Burmakin Andrey, 123RF.com

© Lead Image © Burmakin Andrey, 123RF.com

Article from Issue 250/2021
Author(s):

Command-line tools and Node-RED on a Raspberry Pi let you control projects that use the USB ports.

For home automation projects, a Raspberry Pi offers a simple, low-cost approach to managing and controlling a wide variety of devices. Typically these devices are either digitally wired 0-5V devices such as motion detectors, or wireless Ethernet devices such as smart plugs. It's important to note that a Raspberry Pi can also control USB-powered devices, such as USB fans, lights, and low-end controllers.

In this article, I look at how to monitor, control, and measure USB power in two Raspberry Pi projects. The first project uses Node-RED to create a web dashboard to monitor and control USB lights. The second project turns on USB cooling fans according to the Pi's CPU temperature.

Controlling USB Ports

A number of techniques allow you to control USB ports, and I found that one of easiest approaches is to use the uhubctl [1] utility, which lets you view and control local USB ports and ports on smart USB hubs. To load this utility, enter:

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News