Circuit to automatically connect to vcc

Hello, I am designing a system to power a atmega328. I will use a litio battery(3,7V) and a mcp73811 to charge the battery.
I would like to make a circuit capable of cutting the feed below 3V and that is activated above 4V.
I thought about doing it with a comparator operational, but the reference voltage comes from the battery, so, the reference voltage would look affected by decreasing the voltage of the battery.
Any solution?

Thanks,
Regards.

You can have a cutoff circuit using a zener diode as the reference voltage(s)

composition4:
You can have a cutoff circuit using a zener diode as the reference voltage(s)

Although to save power when cut off you will want to run the zener at a very small current, which will mean the
voltage across it will be rather less than its nominal value - some experimentation might be needed.

Another option is to find a precision voltage reference that works at very low current (10uA or similar) - combine
this with a micropower comparator and high-value resistor divider...

chstr:
Hello, I am designing a system to power a atmega328. I will use a litio battery(3,7V) and a mcp73811 to charge the battery.
I would like to make a circuit capable of cutting the feed below 3V and that is activated above 4V.
I thought about doing it with a comparator operational, but the reference voltage comes from the battery, so, the reference voltage would look affected by decreasing the voltage of the battery.
Any solution?

Thanks,
Regards.

Some Li-po cells have a built in protection circuit to switch off the battery if it's cell voltage drops to 3vdc or lower. Check the sparkFun site, I think some of their cells offer this built in protection.

Lefty

The processor has a 1.1V reference voltage, can't you use that?

This sketch outputs that reference voltage on the AREF pin:

// Find internal 1.1 reference voltage on AREF pin
void setup ()
{
  analogReference (INTERNAL);
  analogRead (A0);  // force voltage reference to be turned on
}
void loop () { }

Hello, thanks for reply. I'm looking for information from your comments. Then, I will put my doubts. thank you very much.
Regards.

The information is there, like the Force.

Hello, thank you very much everyone for the information. I go by parts:

  1. To charge the battery I will use the MCP73831 (Programmable Charge Current: 15 mA to 500 mA)
  2. To detect the low battery, I can use the MAX8211 or STM809 (with VRST = 2.85V to 3.00V). Then, I can connect the output of low battery to a mosfet to cut the feed,What do you think about this solution? Although, I do not know how reactivate the circuit.
  3. I did not find how to design a PCM circuit. I will keep looking.

Thanks,
Regards.