Solar light timer

Discussion in 'The Completed Projects Collection' started by spinnaker, Nov 17, 2012.

  1. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,884
    1,004
    I live in a townhouse community that has an entry sign into the community. There is no electrical service where the sign is located. So there is no cost effective way to light the sign except perhaps through a light powered by a battery charged by a solar panel.

    Years ago we decided to buy a solar garden light to light the sign. The light went through batteries like crazy. This was due to the fact that the controller would turn the light on when it became dark and turn it off when it became light outside or if the battery was so drained it would turn off the light.

    Repeated discharge of the battery was the cause of the short battery life. In addition, the controller was extremely fragile and prone to damage during battery replacement. It was not long till the whole lighting system was shelved.

    A year or so back I renewed my interest in electronics. The world of mcus made this hobby much more interesting. I was able to combine my interest in programming with my interest in electronics.

    I decided that a good first project was to try and redesign our solar lighting system using a mcu. I chose the Pic18F14K22.

    The controller monitors the solar panel. When the voltage from the panel drops to zero, a user configurable timer starts, when the timer expires the light is turned on. The reason for the timer is that the panel is not sensitive enough in dim light. Without the timer the light would come on immediately “after dark”, even though there is plenty of light to see the sign.

    The battery voltage is monitored while the light is on. When the voltage of the battery drops below a user settable voltage the light is turned off.

    The system has a new 40W solar panel charging a 22AH SLA. Both upgrades from the original system. The old panel barely put out a charge and the battery was a wimpy 6AH SLA. The old panel was used for one year as proof of concept.

    The battery is charged through an off the shelf battery charger. The Sunguard from Morningstar. The LED lamp is driven by a Buck Puck Plus from Luxdrive.

    I plan to add PWM dimming to the light to conserve battery power when the battery voltage starts to drop. I also plan to rewrite the code, pretty much from the ground up.


    [​IMG]
    The innards

    [​IMG]
    The controller

    [​IMG]

    [​IMG]
    The Light

    [​IMG]
    The panel

    [​IMG]
    The light in action
     
    Last edited: Nov 17, 2012
  2. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,982
    744
    Why dont you use an op amp photo cell circuit to set the minimum light level to put the light on and off, and let the solar panel just charge the battery ??
     
  3. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,884
    1,004
    Because I like pics.
    A pic makes for a much more flexible user experience.
    New options are easily added and many would not need a redesign of the circuit.
    No need for a photo cell as I already have a solar panel out in the sun.
    The project is already done.

    Lots of reasons.


    My question is why use an op amp when you can use a pic.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    Nice job. Where did you get that workbox? Did you use glands to keep the wire egress watertight?

    I'm working on a solar system upgrade right too, wish I could drop a PIC in there too but mine has to be NEC code compliant. People who think PICs are a complication have never used one. <grin>
     
  5. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,884
    1,004
    I found the box on Amazon. About $25. It is for a pool timer and is "supposed" to be waterproof.

    No gasket. I plan to add an old bicycle inner tube around the outside to seal it for sure but currently the whole works is covered by a plastic bag. It keeps the rain out plus more importantly looks like a plastic bag, perhaps discouraging vandalism.

    Speaking of vandalism. The panel faces the road and it worries me. Really no other good place for it. The only other place is further up on the property but the panel would need to be 30 feet or more away from the light to get it out of the shade of some pretty tall trees.
     
  6. SPQR

    Member

    Nov 4, 2011
    379
    48
    VERY VERY Nice! Congratulations!

    That box is very interesting.
    I need to build something like yours for a greenhouse - so a hot humid environment - I'll take a look on Amazon.

    What kind of programmer did you use?
    I'm thinking about trying a PIC or two (I do Arduino now), and I think I've read you have to have a separate piece of hardware to attach to your pc.

    Your light is very interesting. At first glance I thought it was one of the high pressure Na lights, but after a second or two I saw the LEDs.

    Again, very nice work!

    @ErnieM - what is a glands?
     
  7. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,884
    1,004
    I used the pick kit 3.

    For some reason I am not seeing anything in my Amazon order history or I would post the link for the enclosure.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    @spinnaker: That would be a NEMA 3 or 4 or 6 box for weather resistance (3) or watertight (4) or submersible (6). The Orange home store has some 6"x6"x4" NEMA 4 & 6 rated Carlton junction boxes for $12, but you have to unscrew the cover. Larger sizes too.

    @SPQR: A cable gland is a way to exit a cable from a box providing strain relief while keeping water out:

    [​IMG]

    I'm on the lookout for a good source for these.
     
  9. SPQR

    Member

    Nov 4, 2011
    379
    48
    @Spinnaker - excellent, thanks. I found an example of the Pic programmer HERE.
    I've bought stuff from Canakit before, and they make pretty good stuff.


    @ErnieM - now I get it! Their formal name is "cable gland".
    Here are some sources I googled:
    ElecDirect

    Alliance Express

    A1 Electricals

    Morris
     
  10. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,884
    1,004
    No, no, no no no! Do not buy that junk. You are wasting your money and buying a headache. But a Pick Kit2 or Pic Kit 3. They are pretty much the same price. I have no idea how this company can justify charging that price for that programmer when the real thing is pretty much the same price.
     
Loading...