This instructable is for some garden lights that are being run by an Arduino. The lights are adafruit neopixel LED's that are programmable to change to different colors and sequences. they run on a 5v power line and a data line. 3 cables join them all up in a daisy chain layout which makes them ideal for garden lighting as there is not much cabling around the garden and it is all on a safe low voltage.
My setup turns itself on at night and runs through a sequence of displays. It then turns itself off and waits for it to get dark again. I designed this part of the program so that I don't have lights flashing all night long.
I will be adding more of these to my garden and will have some cool videos soon which will all be published on my web site. This can be found at www.solarstevehome.com
You will require the following to make these lights.
neopixel LED's (qty up to you I have 8 running at present
2" drain pipe (approx 2 1/2" long per light to be made)
Pipe clips + screws
cable (enough to run 3 core to each light)
10K ohm resistor
5v power supply (depending on number of LED's will determine power rating, I am using a 2A computer power unit)
Step 2: Light Construction
First cut the pipe approximately 2 1/2" long per light that you want to make.
Then cut the polystyrene to fit inside the pipe. I did this by twisting the pipe into the polystyrene
The Neopixels have 3 cable going in and 3 coming out. The ones I had where labeled for in and out and where the positive and negative go. solder a 10 cm length of cable to each of the in and outputs as shown in the pictures above. (Take care as these are sensitive electronics, so static electricity precaution and heat precaution are required)
Step 3: Connecting up
Each neopixel will have a positive and negative and data line going in and the same coming out. each one is connecting together in a daisy chain fashion. so the data goes into the first one then out and into the second one.
Each LED wiring was pushed through the polystyrene then this was placed in the tube and secured in place with tape
above is a string of them connected to test that all was working ok.
The wiring diagram shows the data line is connected to pin 6 of the Arduino
the 10K resistor is connected between the Arduino A0 (analog input) and ground pin.
The LDR is connected between the same A0 pin and the Arduino 5v output pin.
this provides a voltage divider where the voltage into pin A0 will vary dependent on the light on the LDR
This variable input will provide the program with a variable number so the program can tell if it is day or night.
A 1000 uF capacitor is put across the supply voltage to reduce any spikes on the power lines when switching on and off
Picture number 6 shows the LEDs working as a test set up. At night the tubes light up making then brighter.
I have connected 8 of them to my veranda in the garden as shown above last picture. each one has been wrapped in self fussing tape which makes them water proof. The control Arduino is in my conservatory about 5 meters away.
Step 4: Arduin Code
The Arduino code is attached.
I am running this on the supplied strand test from Adafruit with some alterations for the light sensor. I will be changing this sequence when I get some time.
you will first need to go to https://github.com/adafruit/Adafruit_NeoPixel to get the Adafruit library and install this.
The first part of the code sets up the data pin 6, the analog input A0 and a number of variables for the light reading part of the program
int LDR = A0;
int light = 0;
#define PIN 6
The next part sets up the LEDs, the first number in the bracket is the number of Neopixels you have connected. The word PIN is the variable set up at the beginning telling it the data pin being used.
Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800);
Next the setup initializes the LEDs and sets them all to off.
The loop part of the program starts with ensuring all the LEDs and off
The count is set to 0
The reading from the LDR is taken from pin A0 and placed in the variable light
It then checks if the light reading is greater than 10, if so then i = 0 nothing will happen as i needs to be at 1 to start the sequence. Then a delay is called to slow things down.
If the light is less than 10 then it is dark so make i = 1
The next if function will see that i is = 1 and so will call each light sequence one at a time. going over this for the count number set at the beginning.
At the end of the light sequence count the void loop will start again and if still dark (which it should be) then i will have 1 added on to make it 2. Therefore the light sequence will not start over again.
i will keep adding up all the time it is dark preventing the light sequence from starting again.
When daylight hits the LDR sensor i will be reset to 0 and the whole program will start all over again waiting for darkness to come again.
That's it, I will be adding this to my web page along with other projects, and like I said i will show some videos of it all working. I hope to add a lot more around the flowers soon and have different setting depending on if we are having a BBQ-party or just sitting out having a glass of wine.
Any questions please ask I will try and answer them if I can
check out my web page which has a lot about a solar water project I am also constructing