Soon to come our Purim party and as such we will need a light organ.
Using an Arduino i made a 5 pre programmed, speed controlled, 4 12V leds (4-pack).
Step 1: These are the things you will need :
Arduino pro mini (5v) or another arduino.
4 leds (regular)
4 4-pack 12V leds
Breadboard(s) - I like those mini breadboard you can connect together.
Screw - Through hole connectors
220 ohm Resistor.
Step 2: Connection
Follow the sketch connecting the parts.
Keep in mind that there is a Voltage difference in the circuit, the arduino and program control parts work in 5V DC
and the 12V leds pack works, well, in 12V.
Make sure you connect the arduino itself at the RAW pin to the positive current so it would regulate it to 5V and make sure you dont mix the two so you wont be ending burning some parts.
In the sketch, except of the leds lines the Red wires are for 5V and the purple are for 12V, Blue is for ground.
Both "grounds" are the same and should be connected.
The leds are connected from pins 2 to 5, continues to the optoisolators and to ground.
The Push Buttons which is used to select the program is connected to pin 8 and also is pulled down using a 220ohm resistor to ground, and at its other leg to 5V.
The Potentiometer is connected to 5V, Ground and A0 of the arduino.
The 12V led are connected to the optoisolators which are connected at their 5V side to the leds (5V) and ground and at their 12V side to 12V, to the 12V leds and then to ground.
Step 3: Code
The "programs" array contain the pre programed programs.
The "index" integer points for the current location at the programs array.
"ledin" point for the current led turn to light.
"progSelect" keeps the selected program number (start at 0)
To add more programs you will need to increase the programs array accordingly,
to change the line "if (progSelect > 4)" to the number of programs minus one.
#define selector 6
#define speedSel A0
#define led1 2
#define led2 3
#define led3 4
#define led4 5