Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

low voltage detector & interrupt

Status
Not open for further replies.

banh

Advanced Member level 1
Joined
Dec 16, 2004
Messages
458
Helped
17
Reputation
34
Reaction score
5
Trophy points
1,298
Activity points
3,935
Currently when suddenly power-off by switch, my MCU has no means to perform some processing before goes off.

Now i need some low voltage detector chip that can, say when Vcc goes low below 4V, send an output high/low to the MCU to interrupt the MCU -> the MCU will try to perform some processing.

Any recommendation for this low-voltage detector chip?
 

Try MAX703/704 from Maxim, or their equivalent, manufactured by TI, Sipex, etc.
**broken link removed**

These have a Power Fail Input that takes only a divider to monitor the voltage, so you can monitor the voltage right across the filter cap, before the 5V regulator and see when it drops below a certain value. Use the PFO output to interrupt the micro.
If you set the threshold correctly, you will have enough time to save important data before the actual reset ocurs.

They also monitor the atual 5V supply and reset the micro when it drops below about 4.75V. Plus, they have a manual reset input, which guarantees a long enough reset pulse.

In additon, they also have a battery switchover circuit, which allow you to use them for battery-backed-up SRAM.
 

    banh

    Points: 2
    Helpful Answer Positive Rating
thanks all,

i'm using MAX704 now.,which will shoot to NMI whenever power-off.

now the problem is inside the NMI handler i want to drive a small motor back to its original position, which consumes quite an amount of current.

should I put a high-value cap at the output of my voltage regulator so that when poweroff this cap can pump out some more voltage?
 

A substantial capacitor may work, and this will be the matter of some tests, but you should consider implementing a rechargable (NIMH, for example) battery to support motor driver for the required period of time ..
Capacitors are not very good in supporting mechanical devices such as motors, solenoids etc, and therefore I think the "battery" option will be more reliable ..
Regards,
IanP
 

It depends on what "small motor" really means and it also depends on the load of the motor.
A capacitor can help, but make sure you calculate the energy required to complete the motion and then size the capacitor accordingly.
 

Why not use something as simple as the diagram included.

just use any generic rail to rail opamp, D1 will always have 0.65 V across it no matter the dc supply. Then calculate R1 to have 0.65 across it at 4V, when the DC supply drops below 4V the negative input voltage will be lower than the positive input. When that happens the opamp output will go high and trigger the interrupt on the mcu.

it might be a good idea to have a large capacitor across vcc, so the dc dont drop to quickly
 

IanP said:
A substantial capacitor may work, and this will be the matter of some tests, but you should consider implementing a rechargable (NIMH, for example) battery to support motor driver for the required period of time ..
Capacitors are not very good in supporting mechanical devices such as motors, solenoids etc, and therefore I think the "battery" option will be more reliable ..
Regards,
IanP

IanP,
If i am to use battery,
what kinda IC should I use in this case?
 

You can still use the MAX704 to detect low voltage, and program microcontroller to activate P-channel MOSFET or PNP BJT to connect a battery, perform required task, and shut the system down ..

Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
thanks IanP,
so the NMI handler will enable BJT which in turn connects battery to the voltage regulator . after necessary processing, the NMI handler will shutdown the BJT.

i will try this out.
 

IanP said:
You can still use the MAX704 to detect low voltage, and program microcontroller to activate P-channel MOSFET or PNP BJT to connect a battery, perform required task, and shut the system down ..

Regards,
IanP

hi IanP,

if I am to use Ni-Mh rechargeable battery (possible the 9V pack), is there any way for me to charge up the battery during normal operation? only when NMI then i use the battery..
 

During normal operation battery can be charged from power supply through a diode to block reverse current, and a resistor to limit the charging current to, say, "trickle" level ..

Regards,
IanP
 

- for 9V battery, 12V power supply is too high to charge?
- how can I know the trickle current? specified on the battery and is it different over different types of Ni-Mh battery?
 

Take a look at the circuit below ..
It uses constant current source to charge battery while connected to mains/external power, and diodes to direct currents in right directions ..

Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
thanks IanP,

in your circuit, it seems the battery is equivalent to regulated voltage.

if my battery is to provide input voltage to the regulator (9V too high for normal 5V circuit operation), so i just move the battery to the left side (12V DC), and my intended circuit will look like (as attached)

not sure how to determine the resistor value for trickle current..

usually how much current is needed for NiMh battery?
 

To make this circuit working you will need to add one or two more diodes ..

Firstly, place resistor in the "battery" branch, and connect 1st additional diode between Battery<-->Resistor and Circuit ..

The original diode from your circuit should be connected between 12V power supply and Circuit ..

If you are sure that the 12V power supply will not discharge battery, that is all, if you are not shure you will need to add another diode at the output of the 12V power supply ..

With all this done, the current to the Circuit will not flow through resistor, and, assuming pretty standard value of the "trickle" current for 9V batteries as 10mA, the resistor value can be calculated as follows:
{12V (from power supply) - 1V (2nd added diode) - 9V (battery)} / 10mA ≈ 200Ω

Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
Thanks IanP,

i dun get this statement (not sure where the diode should be placed..)
and connect 1st additional diode between Battery<-->Resistor and Circuit ..


i've added an NPN so that i can disconnect the battery during the NMI handler.
please advise again.
 

Please find below "slightly" modified circuit that ensures that the battery is charged when the +12V supply is present, regardless of the state of the "MCU output" pin (picture1), and "simplified" circuit with NPN (picture2) ..

Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
thanks a lot IanP,
i'm gonna test on this circuit.

diode : i think i use schottky diode for low forward voltage drop?

transistor: 2N6290 (NPN) and 2N6109 (PNP)
 

What I don't like about these transistors is Vce(sat); it seems to be to high for low-voltage applications ( https://www.chipcatalog.com/Datasheet/16603136FD786489463719AB81F1AA00.htm)
Maybe you can find transistors with Vce(sat) < 0.3V ..
For example, NPN 2N2222, ZTX450 ..

As far as diodes are concerned, you can use virtually any silicon (1N400X, ..) or Schottky (>25V) diode ..
Forward voltage drop in this application doesn't matter much ..

Regards,
IanP
 

    banh

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top