A Christmas tree geek with ShiftPWM
The year-end holidays approaching I wanted to find an idea Deco 100% Geek. With My wife who makes many DIY, We therefore started in the realization of a mini tree.
The idea was fairly simple : use of RGB LEDs to decorate a mini tree. Unfortunately the mounting could not do with a Raspberry Pi without going through a DAC (Digital to Analog Converter). The wiringPi library can emulate outputs analog but with a frequency that will be insufficient and will block the CPU to 100%.
Here is the list of the equipment :
- An Arduino Uno with an AtMega328
- 4 shift register 74HC595, each piece for controlling 8 outputs so not quite 3 LED …
- 9 RGB LED with common cathode
- 27 resistance between 220Ω and 270Ω (one by the LED pin)
- A good dose of son !
I simply then applied the connections offered by the ShiftPWM library that will make it possible to control very simply the shift registers and the connected LEDs behind.
I have not used transistor or regulator, everything is connected next to the Arduino.
Side programme, I have there also used the example of the ShiftPWM library by specifying the number of shift registers and removing each LED test loops. I kept only the party generating a rainbow.
Here is a video with the core program :
My wife then intervened to “Mount” FIR. The poor thing was not helped by my 40 cables connecting the LED all !
Here's the side mounting Arduino
And the end result after a women's aid :
J’ai pas réussi à faire plus joli pour les câbles 🙁
Thanks to Elco for this library “Magic” 🙂