For my next trick I thought it would be nice to have a web interface “colour wheel” to control an RGB LED strip light. These are dirt cheap and usually come with a crappy infrared remote control. The real nice part about this is once you have it working you can do almost anything you want with it – make a gradual sunrise light for the dark mornings, a security light, an auto-off night light or simply pick the colour you want your room to be from a smart phone.
The basic idea of this design is to have the Arduino handle the control of the LED strip itself but allow the RGB values to be set via a serial connection. The Pi will be sending the RGB values via USB to the Arduino which in turn will use Pulse Width Modulation (PWM) to set the intensity of each LED.
After the successful first project of getting a PIR sensor to work with Arduino I thought I’d try something a bit more practical and bespoke. The idea with this is you can use the Arduino to change the colour of an LED if there are any critical or warning errors in Nagios Monitoring software.
This time we’re going to get the Arduino to read input over its USB serial interface from a Raspverry Pi and depending on what it receives either make the LED light green or red.
This Arduino nonsense is actually pretty neat. It’s a small electronics project board with a programmable chip and a pile of General Purpose I/O pins. You can use it to control or be controlled by pretty much anything. There’s tonnes of examples out there from the simple blinking an LED to the much more complex task of automating the watering and lighting of indoor grows. The best of it is this thing costs £5 – five pounds sterling, no shit!