Setup battery handler for 18650 battery

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
roqvist
Posts: 2
Joined: 31 Jan 2021 17:42

Setup battery handler for 18650 battery

Post by roqvist »

I'm powering my Z-Uno with a (solar charged) 18650 battery on the 5V pin. Fully charged it's around 4.2V and can drop to about 3V, I'd like to configure my battery level to match this.

Is it enough to call:

Code: Select all

ZUNO_SETUP_BATTERY_LEVELS(3000, 4200);
or do I also have to specify what pin I'm using (5V power pin and not the default 3V3 pin)? Or do I need custom code/ZUNO_SETUP_BATTERY_HANDLER to accomplish this?

Thanks,
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Setup battery handler for 18650 battery

Post by PoltoS »

If you use 5 V pin to power Z-Uno (in your case this is correct not to kill it by 4.2 V) the DC-DC will always give you 3V.

So you need to write a custom handler andeasure with ADC periodically the voltage on the battery (use voltage dividers with big R to adopt to 0-3 range and keep the current thru the divider small
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Setup battery handler for 18650 battery

Post by PoltoS »

If you use 5 V pin to power Z-Uno (in your case this is correct not to kill it by 4.2 V) the DC-DC will always give you 3V.

So you need to write a custom handler andeasure with ADC periodically the voltage on the battery (use voltage dividers with big R to adopt to 0-3 range and keep the current thru the divider small
roqvist
Posts: 2
Joined: 31 Jan 2021 17:42

Re: Setup battery handler for 18650 battery

Post by roqvist »

Thanks, I guess I can just divide the 4.2V in half using two resistors in series and then map battery percent between ~1.5V-2.1V?
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: Setup battery handler for 18650 battery

Post by PoltoS »

Correct. Just make sure to have them big enough not to drain your battery thru those two resistors.
Post Reply