SDSL Alpha Complete

A project log for Smart Solar Lamp

A solar powered led light that turns on at human presence with switch mode configurable charge control and constant current led drive

gorkyGorky 06/29/2015 at 14:050 Comments

After squeezing every bit of my free time and every word on the pics flash memory I have completed all the major functions I have been planning in software.

We have two pieces of software in this project with below functionality

- Firmware with C running on PIC covering below functions

- Boost converter for charging and battery charging algorithm

- Driving led with constant current

- Sleeping and saving power as much as possible while checking motion sensor, analog sensor, solar power and usb connection whether to wake up or continue sleeping

- Supply status and configuration based on received USB hid data. Saving configuration to PIC's flash memory.

- Keeps log of battery condition, charge and send them over USB.

- Control panel software with Java running on any platform with JVM and usb host.

- Displays battery, panel and charge voltages and charge current

- Displays battery and charge log

- Configures device displaying configuration ui and sending saved values over USB.

Aside from more complex problems of firmware and software I spent most of my time around one completely idiotic comparison mistake and another weird issue about not being able to retain configuration values in flash. I found the solution to the error in flash as well using all my google-fu in a single forum in a super little post. So long story short a certain silicon revision of PIC16f1455 cant write to its flash while working at 48 Mhz which is needed for usb to work. At first was a real disaster for me as the whole point of usb was to send and store device configurations. But then I found a solution which was to get the config values, detach usb module, slow down to 4 mhz store config values and then attach usb module. So after save device gets detached for a while but firmware and software handles that. Besides that newer silicon revisions do not have this problem.

Here are some screenshot of desktop software. I will publish both firmware and software soon once I have time to start the project on github.

After all these oranges and reds if still someone manages to explode a battery with this charger or smoke a led it's completely their color blindness.