I am trying to make a one LED low level battery indicator for 2x AA, so 3V. I searched and came up with a AA battery being dead when it hits 1.3V, or 2.6V total. I did make a circuit but I'm not sure it is correct:
Maybe I'm looking at it wrong, but I don't see how your circuit can work. First, it looks like you have the comparator inputs reversed. The output will go low if the non-inverting input is lower than the inverting input. So it looks like the LED would be on with new batteries installed, which I assume is the opposite of what you want.
Second, as battery voltage drops, the two inputs become equal, but never reverse. The zener simply becomes irrelevant. Neither input can be higher than Vcc, so you never have a crossover. I think you would need to compare some fraction of Vcc to a reference voltage.
I haven't looked at the rest of your circuit, but could you possibly use the processor to do this? If it has an internal reference voltage of somethiing like 1.1V, you could divide down Vcc and do an analog read, then have another pin drive the LED if the voltage is low. Or, I think the 841 even has two built-in comparators that might work.
Yeah, I totally fudged the LM393 circuit, so I assumed it was wrong. I was going to use one of the pins on the Attiny841 to read the voltage, but I am out of pins. So I searched on LCSC.com "Monitors and Reset Circuits" and came up with the XC61.....
It switches its output to 0V when the input voltage drops below Vref, which is 2.7V. That way it can switch an LED when the batteries are dead.
That is the only option at the moment, although they usually have at least 4 different shippers. That price is for 1.9kg / 148 parts. Shipping is usually on time, although I have had it several days late once.
Can I suggest rather than use netnames to join ALL your components, you actually draw a circuit with wires.
That way you make a logical schematic that can be logically read with signal flow and power flow.
Wawa is right. You don't need a pin or any external circuit to measure battery voltage. You are powering the ATtiny directly from the battery, so you can do an ADC reading of the internal 1.1V reference voltage, but using Vcc as the actual reference voltage. So 1.1V is the source you are measuring, and Vcc is the reference. It's kinda backwards, but it tells you the difference between Vcc and the internal 1.1V reference. As the battery discharges, the 1.1V input will measure higher. Section 16 of the datasheet goes into all this, particularly the register descriptions at the end.