Introduction: Colorful Solar Garden Jar Light
The simplest way to make a solar jar light is to disassemble one of those cheap solar garden lamps and fix it into a glass jar. As an engineer I wanted something more sophisticated. Those white lights are boring so I decided to spin my own design based on an Arduino, RGB leds and a sensor so the color can be changed by simply tilting the light.
The solar cell charges the lithium battery and also serves as a light sensor to turn on the light automatically when it gets dark. I took great care in the design to reduce the power consumption when the light is off and all the harvested energy can be used light up your garden. More details on the design process can be found on my blog: BashtelorOfScience.
Step 1: Parts
You will need these components:
- 1x glass jar (I get them at IKEA)
- 1x SolarGardenJarLight PCB
- 1x TP4054 charge controller (IC1)
- 2x resistor, 1M, 0805 (R4, R6)
- 2x resistor, 10M, 0805 (R3, R5)
- 3x resistor, 10k, 0805 (R1, R2, R7)
- 4x capacitor, 1uF, 0805 (C1, C2, C3, C4)
- 1x LED, 0805, Green (LED1)
- 1x AO3401 MOSFET, P-channel, SOT23 (Q1)
- 1x WS2812 LED strip cut to 3 LEDs (100 LEDs per meter)
- 1x ADXL345 accelerometer module
- 1x Lithium Battery, 500mAh, no bigger than 40x40mm
- 1x Solar panel, 5V or 5.5V, 45x45mm or 60x60mm
1x Arduino Pro Mini (ATmega328P or ATmega168P, 5V/16MHz version)
All the components are available on aliexpress by various suppliers. I made the PCB available on dirtyPCBs: it can be ordered in black or in white (you will get 10 PCBs). The price per lantern when ordering parts for 10 pieces is around 12$.
Step 2: Prepare the Arduino for Low Power
The Arduino Pro Mini draws a lot of quiescent current because it has a power LED on it that is always on and the voltage regulator is also a power hungry beast if we are talking low current in the order of micro amps. You have to remove these two components. There are several versions of Arduino clones out there. In the photo above I marked the LED and the voltage regulator in the most commonly found versions.
To remove the components use a soldering iron and put lots of solder on the components and heat them up well. If necessary, clean the pads afterwards with solder wick. It is also possible to remove the components brute force with a side cutter or a knife. Just be careful not to damage the PCB.
Now is also a good time to upload the sketch. I use version 1.8.4 of the Arduino IDE but it should work in later or older versions as well. The Arduino Pro Mini has no USB on board so you have to use an external USB to UART converter. Get one from your favourite Arduino supplier or you can find them for less than 2$ on aliexpress. There are various tutorials online on how to program the Pro Mini. Be aware that the Arduno clones not always use the same pin order so double check your wiring before plugging it in. Also make sure you have the correct board (Arduino Pro Mini) and the right processor selected in the Arduino IDE Tools menu (ATmega328P or ATmega168P, 5V, 16MHz).
Step 3: Soldering the SMD Components
Use the layout image above to put all the components to the right spot. The component designators are in the part list in step 1.
If you need the schematic or the layout you can download the eagle design files here.
Some of the components are quite small and can be hard to solder for a rookie. I use a syringe with a small nozzle to put solder paste on the pads and then reflow-solder the components using my home brew solder plate but of course you can also do it using a soldering iron and 0.8mm (or thinner) solder wire.
After soldering all components use a magnifiying glass to inspect your work and check for short circuits especially on the charge controller.
Step 4: Solder the Arduino
To communicate with the accelerometer with the I2C communications protocol we have to connect pins A4 and A5 of the arduino to the PCB. These pins are usually next to the processor (see photo in step 2) but on some clones they are at the edge and not always at the same spot either. The PCB design works with all different versions: for the standard version with the pins next to the processor add the pinheader as shown above.
For the other versions you can use a piece of wire to connect the A4 and A5 pins to the pads on the PCB. Cut the wires to length after soldering.
Some arduinos come with the pin headers solderd, some without. I found it is easiest to solder the headers to the garden jar light pcb first and then adding the Arduino. Just make sure the headers are soldered in straight or you will have a hard time fitting the pins into the pads.
Step 5: Finishing the PCB
When soldering the ADXL345 accelerometer module it is important that it is parallel to the PCB. The best way to ensure this is to place the module directly on the PCB and insert the pin header from below as shown in the photos. Add solder from the top and after cutting the header on the bottom side also add solder there.
Cut all the pins on the bottom side with a side cutter then put some scotch tape on top of all pins to prevent the sharp pins curring into the battery and shorting out.
The last step is to add the LED strip. Make sure the polarity of the pads is correct and pay attention to the data pin direction: match the arrows on the LED strip to the arrows on the PCB.
Step 6: Solar Panel and Battery
Use about 5cm long cables to connect the solar panel to the two pads marked 'solar' and pay attention to the plus and minus symbols.
The last thing to solder is the battery. Be extra careful here: lithium batteries have a lot of power and can make your PCB go up in smoke if you accidentally short out some traces. If not already there put some tape on the positive wire of the battery to prevent accidental short-outs. Solder the black minus cable first because it is harder to solder. Remove the protective tape from the red wire and solder it. You will see the LED on the Arduino board flashing briefly when you connect the battery.
If you already uploaded the sketch to the Arduino you can now switch on the light by tapping repeatedly on the PCB with a fingernail. If it does not work you have to start debugging using a multimeter. Check the voltage of the battery first. If there is no power it may be in protection mode. Shine some bright light on the solar panel to snap the battery out of this mode. If this does not help and there is still no power, disconnect the battery and check your PCB for short circuits or open circuits with the help of the schematic until you found the error.
Step 7: Finish the Light
After successfully testing the circuit fix the battery to the bottom side of the PCB using glue or double sided tape. Do not use any water based glue like white glue because it is conductive until dry. The best thing to use is silicone.
Fix the solar panel on top of the battery also usign glue or double sided tape forming a nice little electronics sandwich. Tuck away the cables and fix them with some more glue and let everything dry. Test if it still works before mounting it into the jar.
Step 8: Assemble the Jar
Get your glass jar and make sure the solar panel will fit in the lid. You can basically use any jar you like as long as it is transparent at the top and water proof.
The preferred adhesive is silicone because it can easily withstand the high and low temperatures outside. The more transparent the better but the slightly milky one works fine, just don't get whit or gray silicone. You can also use epoxy but it may crack under thermal stress.
Put some silicone on the glass and then press the light on the glue with the solar panel facing the glass of course. Make sure it looks nice from the outside, remove, clean repeat if you messed it up then let it dry.
Place the jar in a sunny spot. It takes 2-3 days of sunlight to fully charge the battery and even longer if it is placed in the shade. If the light starts blinking in red it means that the battery is depleted and it needs more light to recharge. If you put the light in a dark place for a long time (i.e. several weeks) the battery may die and it has to be replaced so make sure it does get enough light and it will work for years.
Step 9: User Manual
The light switches on automatically at dawn if it detects low light conditions for several minutes and the battery has enough energy stored. To manually switch on the light just tap on the top a few times or shake the jar vigurously.
The light switches off automatically after about three hours when manually switched on. When it switched on automatically it runs until the battery is about half empty (so you can still switch it back on manually). To turn it off immediately, flip it upside down.
- Change color
To change the color simply tilt the light. It has three modes of color change:
- Change brightness
- Change the color
- Change color saturation
Tap the lid once to switch between these modes. The more you tilt, the faster it changes.
- Candle mode
To change between steady light and flickering candle mode simply double tap the lid. The saturation and brightness are reset to default (maximum) levels when switching from candle to steady mode.
synchrite made it!