Building a Solar Powered Light

As this is my first post for the TeraCharge website, I think a bit of history is in order (I promise I’ll keep it short).

When I’m not at work, or out snowboarding/mountain biking, I typically find myself in a little corner of my house fondly referred to as the “Laboratory”.  What started as a small assortment of chips, resistors, and capacitors later became an uncontrollable mess of ICs of all kinds, boost caps, power resistors, etc . (this chaos was facilitated by an accidental (and welcomed) acquisition of a very large array of 7400 series parts).  Other members of the household have discovered by their own means to steer clear of this corner, and as such this became my corner: Jonathan’s Corner.

A few months back I was informed by a key house member that the Lab was getting a little out of hand and that parts had to stop coming in and had to start leaving.  Thus began “Operation Get Rid of Stuff”, which commenced with a simple project: building a light.

The Laboratory Outside of Work

Jonathan’s Corner, a.k.a “The Laboratory”

The back of our house had no exterior lights, which made unlocking the back door at night a challenging endeavor to say the least.  We intended on purchasing some kind of exterior light when it occurred to me that I had more than enough parts laying around to build a solar powered light.  With proper hacks to an old PCB, I could make it work.

This PCB was an circuit that I had made for some friends a while back to learn how to solder and do some basic C programming.  It wired four buttons and four seven segment displays (SSD) to a PIC18F14K22 processor, with a solar lithium polymer charging circuit.  I luckily had two PIC18s, a few buttons, SSDs, and a spare 0.5W solar panel.  All I needed was to create a small daughter board for white LEDs (which I also had collecting dust) and somehow solder it on the main PCB to make it a fully functional solar light.

Hack-able PCB for a Solar Powered Light

PCB to hack.

Although this project was done using an old PCB, it could easily be wired on a breadboard.  The parts required to do this are:

  1. A PIC18F14K22 (great little PICs by the way).
  2. A BCD to Seven Segment Display (SSD) Decoder: something like a 74HC4511.  I luckily found in surplus (and thus for cheap) MC14543B, which are BCD to SSD ICs with fancy LED driving circuitry and latching inputs.  On Semiconductors actually still make these; they make for great for any simple SSD based projects.
  3. 5V solar cells.  Sparkfun sells a really nice 0.5W that is terminated with a barrel plug.
  4. A Lithium Polymer (LiPo) battery.  You can find some once again at Sparkfun.
  5. The MAX1555 Lithium Polymer Charger (a very nice, cheap charger in SOT23-5).  Sparkfun sells an adapter such that the part can be placed on a breadboard.
  6. A momentary push button.
  7. At least two Seven Segment Displays.
  8. A whole bunch of 330Ohm resistors.
  9. About six white LEDs.
  10. One 4.7K-10KOhm resistor.
  11. Five 10k-1MOhm resistors.
  12. Two 1uF capacitors.
  13. Two 0.1uF capacitors.
  14. A PMOS (or, preferably, a NMOS).
  15. Four NMOSs.
  16. (Optional) A red LED and a switch.

The schematic for the solar battery charger is pretty simple, and uses the extremely handy MAX1115 Lithium Polymer charger IC.  For real simple charging, the MAX1555 can’t be beat.

5V Solar Lithum Polymer charging circuit.

5V Solar Lithum Polymer charging circuit.

Wire the 5V solar panel straight into the MAX1555 DC input, the battery to the BAT output, and voilà, you are charging a battery (doesn’t get easier than that)!  The red LED is optional: whenever the MAX1555 is actively charging the battery, it will pull down the CHG’ signal, thus turning on the LED.  Note that if you are building this circuit for yourself, you will want the ability to switch off the LED (hence the switch in the schematic): otherwise, a great deal of energy used to charge the battery will instead go to the LED.

The SSD display portion of the PCB uses the MC14543B to convert a BCD value to its corresponding SSD representation.  The MC14543B is designed to run a variety of SSD displays (including LCDs) and has latching inputs, although they are all disabled on the schematic.  Really, a 74HC4511 could have been used.

SSD Display

SSD Display

The outputs of the MC14543B are wired to all four SSDs, and in turn each SSD’s COM pins are wired to an NMOS.  The NMOSs are controller by the PIC18, which turns one of them on one at a time, in sequence, and very quickly.  Whenever the NMOS is OFF, the LEDs for said SSD are off.  If the NMOS is on, the corresponding segments of the SSD are turned on in function of the BCD value on the LA, LB, LC, and LD signals.  As such, each SSD can display a separate and unique value, using only one BCD to SSD IC.  The values for the resistor tied to the NMOSs’ gate (R2-R8) are pretty arbitrary, and given the generally slow strobe speed of the SSD display, don’t really matter.

The SSD display, along with a single button,  are connected to the PIC18.  No magic here.  Notice that the 4.7KOhm resistor used for the ICSP can be any value between 1K to 10K, according to Microchip.

PIC18 connections

PIC18 connections to the remainder of the schematic.

The light functions as follows:

  1. The circuit is initially off and in a low power mode (all lights are off, and the processor is in sleep mode).  This allows the maximum amount of energy from the sun to charge the battery during the day.
  2. When night falls, and we need light, I press the lone button populated on the PCB.
  3. The button press activates the white LEDs for 15 seconds.  Subsequent button presses add another 15 seconds to the total time, and the time counts down to zero.  The time is shown on the SSD display.
  4. Once the elapsed time expired (i.e. the countdown reaches zero), the circuit returns to a low power state, and the LEDs turn off.

First, I built the white LED daughter board.  I had a logic level TO-220 30V PMOS lying around which I used to power on the LEDs (I would have preferred using an NMOS, but I had none at the time.  I have since addressed the issue, to some household members’ dismay).  The schematic is very similar to the NMOS schematic used on the SSD display.

White LED daughter board

White LED daughter board schematic.

Front side of white LED daughter board.

Front side of white LED daughter board.

Back side of white LED daughter board.

Back side of white LED daughter board.

Much like the NMOSs, the 1MOhm and the 330Ohm resistors values can be changed because we have no speed requirement for turning the PMOS on/off (the astute observer will notice that the values on the back side of the daughter board are actually different).  The ballast resistor for the white LEDs (R21) is selected such that at 5V, every LED gets around 10mA.  In an ideal world, each LED would share current equally.  In reality, however, LEDs tend to have poor I-V characteristics (even in LEDs from the same production batch), which leads them to not share current equally (more on this later).  For this project, I don’t really care, but in some applications this can be a big deal.

I then wired the daughter board on the PCB and soldered the PIC, the BCD-SSD IC, the button, and the four SSDs to the PCB.

After a little bit of C code for the PIC18, I had a completed project.

Project Complete!

Project Complete!

That little red PCB on the upper left of the green PCB is a 5V boost converter built by Sparkfun.  Fantastic little thing, and well worth the price.  It’s not needed for this project, but I only had a -5V Vgs(th) PMOSs available at the time, too large a value for the LiPo’s voltage to fully turn the PMOS on.  Boosting the voltage to 5V solves this issue.  To save on cost, I would instead recommend getting a smaller Vgs(th) PMOS and running this project unregulated (as shown in the schematic).  Yes, the white LEDs will progressively dim as the battery voltage slowly drops, but the underlying battery life will be greatly increased.

Since this thing had to go outside and survive that harsh suburban wilderness, I couldn’t leave the circuit exposed in such a fashion: any kind of precipitation would effectively destroy the project (and my morale) in seconds.  So I looked through the scrap pile and found a heavily damaged (but useable) clear acrylic project box.  It had a hole in it, but I could enlarge it to let the button to poke through.  It took a bit of finagling and lots of electrical tape to get it in there, but it fit.

Ugly boxing job, but hey... it works!

Ugly boxing job, but hey… it works!

I used some leftover weight bearing rope to hang the light from a nail on the wall.  It’s now been happily hanging by our door and gets daily usage.  It will be interesting to see how the light will function in winter, given the shorter days and the harsher LiPo operating temperatures.

Outside and working.  Only 14 seconds to go!

Outside and working. Only 14 seconds to go!

 

Tagged with: , , , , , , , , , , , , , , , , , , , , , , ,
Posted in Jonathan's Corner

Leave a Reply

Your email address will not be published. Required fields are marked *

*


eight × 7 =

Tera Charge