Question about reading battery voltage

Post content lost due to vandalism by author

With an attiny i can just use the ADC

No, you can't. You need a voltage divider with the micro, too, typically 3:1 for a 12 V battery. Best to learn this very simple technique: Voltage Divider

Clearly this is not a task for a microcontroller. :roll_eyes:

I think the issue is calculating the resistor values for a given amount of hysteresis?

For this you need to calculate the change of current when the output swings from low to high
(remember the 393 needs pull-up resistor on the output and this is part of the feddback
resistance). This change of current is then multiplied by the effective impedance of the
midpoint of the voltage divider to get the change in voltage at the comparator's non-inverting
input.

Don't power the 393 from a regulator, power it straight from the battery.

Another approach is to use two comparators for the two different voltages and a wired-OR on
the outputs.

That isn't a good way to treat a lead acid battery. It's much better, and simpler, to just use a regulator set to 13.5 V (could be your 7805 with a couple of resistors to adjust the voltage if it's a low current solar panel or a switching regulator for better efficiency/higher power).

Try Googling "float charging lead acid batteries".

Russell.

Hi,

What is your electronics and hardware experience?

Have you gargled,,, lm393 circuits

Do you have a datasheet on the LM393, do you have a DMM to help you set it up?

Sorry for all the questions but we need to know your experience level and test equipment resources.

Tom... :slight_smile:

TomGeorge:
Have you gargled,,, lm393 circuits

Oh, I like that. Haven't struck it before but will remember it. :grinning: