Low voltage and current LED on 6 hours / off 18 hours, repeat

Thread Starter

davidfet

Joined May 13, 2020
6
Saw this thread on the same topic, but it was suggested I start my own, so here goes.
Former thread:
https://forum.allaboutcircuits.com/threads/cd4060b-timer-circuit-design-12-hour-on-off-repeat.156495/page-2#post-1511407

Looking to power my Japanese garden lantern with a 3.85v phone battery, cycling 6 hours on (night cycle) and 18 hours off. The lantern holds a simple 'dancing candle' (LED reflected on a wick moved via a magnet). The original batteries were 3 button cell batteries 1.5v each, 50maH. I've run it on the 3.85v phone battery without a problem, Current draw is about 15ma.

I saw on the previous thread suggestions on using a PIC with a quartz, and was wondering if there was a circuit designed around this (original post was for a CD4060B). Also open to using other methods, looked at using an ATtiny and arduino.

I know how to program (javascript, python, php) but am new to hardware, having done a few basic kits. I'd prefer to build something over just buy an existing led string with a timer and hack it. I'm finding myself being drawn into using an PIC or other programmable device.

I would think I could use the same voltage to power the timer, no relay needed, using minimal current, and also drive the lantern, so that the battery lasts a long as possible. I was also thinking to use a buck/boost to keep the voltage steady at 3.3v to keep the LED brightness constant until the batteries over-discharge protection kicks in.

The simplest solution I've come up with is to use a solar garden light circuit, to have it go on at dusk, off at dawn, but this wastes battery when not needed- and I don't get enough sunlight to charge it back up effectively.
 

ronsimpson

Joined Oct 7, 2019
684
If you don't want to get too involved in hardware …. there are some very small Arduino boards. Some will live from 3.3V. You don't need speed or much memory. Because you know software the Arduino should not be hard. There are some utube videos on learning Arduino. Look for "blink LED". Uses a delay/timer command and set pin high/low. Very simple loop.

Using a ATtiny gets you more in to how the computer works.
 

Thread Starter

davidfet

Joined May 13, 2020
6
If you don't want to get too involved in hardware …. there are some very small Arduino boards. Some will live from 3.3V. You don't need speed or much memory. Because you know software the Arduino should not be hard. There are some utube videos on learning Arduino. Look for "blink LED". Uses a delay/timer command and set pin high/low. Very simple loop.

Using a ATtiny gets you more in to how the computer works.
Thanks Ron. Took a look at this video:
seems very simple to use a Nano but the power usage is too high, will look at other versions, micro, and ATtiny to get the power consumption where I need it.
 

MrSoftware

Joined Oct 29, 2013
1,782
PWM the LED. You can cut the duty cycle down a lot (saving a ton of power) and visibly it will still look the same or very close to the same. I would not power the LED's through a buck circuit, the higher load on the buck circuit will be wasted power.

Just rambling as I think... If you can do it without a processor then you'll probably be ahead of the power game. Maybe try using a photocell to control on/off times, combined with a very efficient timer for the PWM. Maybe you can use a programmable RTC to produce the PWM, then use the photocell to control whether the LED gets power or not. A good RTC can be super efficient.

If you must use a processor, get one that can run at the same voltage as the battery, or use a buck regulator, do a little math to see which is more efficient. If you choose a pre-made board then pay close attention to the power regulator(s) on the board. Most are not intended to be super efficient and it would not be surprising for an inefficient regulator to waste more power than your processor uses. Also your code is going to be critical. You need to put the processor to sleep when it's not doing anything, reducing it's duty cycle and saving you a ton of power. You might also look at a programmable RTC chip for waking the processor at night, or maybe even for PWM as an external RTC is likely more efficient than using internal processor timers. Similarly lots of processors are more efficient if you use an external crystal for the clock instead of the internal resonator. Ease of implementation wise, of course it's easier to just stack a larger battery and larger solar cell. Tons of options, it depends on how involved you want to be.
 

ronsimpson

Joined Oct 7, 2019
684
Nano but the power usage is too high
I don't know the Nano but most small computers have low power modes and sleep mode. It will take some digging into the hardware but you can probably put the USB to sleep. Probably can back the computer speed down greatly. (it will run slow but that's not a problem here)
I have used little 8 pin PICs and others where you have a sleep mode. Some products the computer pulled so little power in sleep mode the battery would die of old age before it ran down so we did not put in a on/off switch.
Most computers I have used do not keep track of time will in sleep mode. You can add a photo cell and turn on at dark so time is not so important.
 

Thread Starter

davidfet

Joined May 13, 2020
6
Thanks All!

I'll give the ATtiny25 a try on this and test the various settings. Learning this sounds like fun, and I can see using these in a few different projects.

If I can't get the timing to be stable, I can use the solar power (with resistor&transistor) to trigger it to power on/reset the 6 hour cycle. The only issue I see with this is dark rainy days (maybe 1x every 6 months), but that's ok, nice to have the light on during these, and can be reset with a flashlight to the panel.

This may wind up being a good battery saving solution too. Restart 6 hour cycle on dusk, then go into sleep mode for the rest. At dawn, the power shuts down completely. At dusk, repeat.
 

ronsimpson

Joined Oct 7, 2019
684
good battery saving solution too
Keep it simple; Raspberry Pi connects to the internet to find the time. USB keyboard so you can reprogram the computer. HDMI part for a monitor to log when the sun want down. Yes, you need a printer port to keep a paper copy. Backup hard drive just in case. Back up power supply when the power goes out. Burns 30 watts just for some mW Blinky lights. ;)
 

MisterBill2

Joined Jan 23, 2018
6,087
That little computer will waste FAR more power than the solr power circuit in the garden light. And by wasting power do you mean staying on too long? Or something else? You should consider the size of the package for that little processor board as well. The package will not be small.
 

sparky 1

Joined Nov 3, 2018
185
A wake up on (ambient light is low) turns the garden light on at dusk. The light detector CLD or photo resistor circuit works already.
A watchdog timer or supervisory control requires a minimum 1.8 Volts to power an "ultra low power long duration timer".
A timer blox or similar is set with a resistor (100k) it draws low uA while it counts for 6 hours then signals the led to shut down.

The voltage requirement means that the output of the Photovoltaic cell's voltage must be raised as it is converting sunlight.
This means modification for higher voltage. like a buck boost function. Having three battery cells in series
solves many issues interfacing to a low voltage harvester. Simply by charging three batteries in series in order to meet the voltage requirement.
Later, The sodium ion battery sometimes called a solid state battery will be a vast improvement over lithium ion batteries.
 
Last edited:

Thread Starter

davidfet

Joined May 13, 2020
6
An update on my solar lantern project.
Initial design used transistors to power on/off an attiny85 (got that one in before other ones so just using this).
It ran fine, but used a little bit too much current during the daytime for my liking.

I got to thinking that I can use the attiny85 by itself, since it could measure the solar power and has good deep sleep mode.

I also added a few extra features.
* check vcc for battery level and light up a red LED when battery is getting too low (using pwm)
* go into sleep if the battery is too low, battery protection (although already using a tp4056 module for battery charging, etc.)
https://github.com/david-sg/solar_lantern-attiny85-arduino/blob/master/solar-lantern-attiny85.ino

Power usage: (1mhz, 3.7 18650 battery)
Daytime, SLEEP_MODE_PWR_DOWN with ADC disabled, watchdog timer waking up every 8 seconds & turns back on the ADC, checks for solar voltage - too low for my meter to detect (below 0.00mA, could be around 5 µA). It should be spiking up on the wake up, but may be happening too fast for my meter to catch. With no accidental dark periods, this should run for 19.5 hours before getting triggered to run the light.

Night, it seems to be pretty close to the LED draw. Testing was showing 13mA with a single blue LED running with a 200ohm resistor. On the lantern, I don't have resistors as the light runs fine without any current restriction on a full 18650, and the original dancing candle I'm using ran on 3 button batteries at a total 4.5v, and under 20mA from what I remember.

A couple of things I'm not sure about:
1) I put a resistor (470ohm)/zener diode (4.7v) as a voltage limiter before the analog in pin (solar power check)- on the very off chance that the solar brings in more than 5v. Does this sound right?
2) I don't have a resistor on the power low red led. This is using PWM at 50 of 255 which ran fine when I tested it but... wondering if this will cause a problem- burning out the LED or possibly causing too much current to go through the attiny itself.
 

MisterBill2

Joined Jan 23, 2018
6,087
I had not considered using a sleep mode for the computer. That can indeed work.
While a resistor limiting LED current works, all of the power spent in the resistor is wasted as heat, unless you need the heat.
As for the PWM on the LED, duty cycle is the way to limit power, since what does the damage is the heat, not the current, up to some higher limit. That is how quite a few automotive lights are driven. Very bright very short pulses of power. BUT they usually also have heat sinks, at least some of them do.
 

Audioguru again

Joined Oct 21, 2019
1,504
Almost all solar garden lights use a 1.25V battery cell and an inductive voltage stepup circuit.
The solar panel is only 2V and its small size limits the charging current. The solar panel is also used to detect daylight to turn off the voltage stepup circuit.
PWM is an LED dimmer the same as when it is used as a motor speed controller.
 

Thread Starter

davidfet

Joined May 13, 2020
6
Almost all solar garden lights use a 1.25V battery cell and an inductive voltage stepup circuit.
The solar panel is only 2V and its small size limits the charging current. The solar panel is also used to detect daylight to turn off the voltage stepup circuit.
PWM is an LED dimmer the same as when it is used as a motor speed controller.
yep, I hacked a couple of other garden solar lamps that use the YX8018 chip to use other leds, but the dancing candle (uses an electro-magnet to flicker a fake flame that reflects the LED) needed more voltage. The boost on the YX8018 only puts out about 2.8v which wasn't enough.

My version has 3x2v panels in series (6v potential total), that supposedly does 100mA, but is probably less under a load.
I put this through a small boost converter that puts it at 5.1v, and charges the 18650 via a tp4056 module. Tested in sunlight, it did charge the battery. I'm expecting that I'll need to manually charge it about every 3 weeks with no solar charging, and maybe 4 with solar since I get little direct sunlight where the lantern is.
 
Top