One of the issues with the v0.1 code was that the LEDs never shut off. Even thought the 18650s are pretty high capacity, they would die in a few days. The power supply will turn off if the power draw is below a threshold for a time delay, so I'm going to take advantage of this and the fact that I don't have a means of directly controlling the power supply from the arduino by putting the arduino into a low power state after a period of inactivity.
I added 3 different features:
- Auto dimming - Dim all the LEDs to a low brightness after a time delay of inactivity
- Auto off - turn off all LEDs and place the MEGA in a low power mode
- Interrupts - if a switch is flipped between the time the MEGA enters low power mode and the power supply shuts itself off, the MEGA will wake up.
The auto dimming doesn't work very well, probably because I don't have a good dim level set, but maybe I'm also not handling it right in the code. I don't really care for the moment because it shuts off and I'll save time between charging. I'll leave the dimming issue for "future me".
Code V0.2 can be found on the simulator at WOKWI.com:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.