I am building a PIC circuit that is driving a Mosfet. PIC is powered with 4 battery cells that swing from 5.4V to 4.6V (it goes lower but for me thats the lowest).

The PIC is regulated with LM2940CT-5.0V

I would like among other things that my PIC monitors his supply. If the voltage drops bellow 4.6V it should sound the buzzer (portb.2 = high).

On a Vref pin a put a LM336-2.5V reference diode:

5V-----R1(2.5k)-----o------- Vref input
I
I
LM336 diode
I
I
ground

So the Vref is 2.5V when the supply is over or exactly 5V (on PIC is always 5V).

Will I be able to read the correct voltage when it drops to 4.6V ?????? I don't think so. I can't change to 3.3V LDO since i need more than 4.5V to drive Logic Level Mosfet.

What can I do????