Author Topic: Power supply outage detection  (Read 2259 times)

0 Members and 1 Guest are viewing this topic.

Offline wicketTopic starter

  • Contributor
  • Posts: 35
Power supply outage detection
« on: June 15, 2014, 08:04:57 am »
I'm running my circuit with 18V AC power adaptor. In case it fails, I've installed a 12V backup battery and it works fine. Now I'd like to detect this power adaptor failure and trigger an interrupt with my PIC when it happens.

What would be the simplest way to do that? I thought about putting another Schottky right after Graetz and use an NPN transistor. But I read that Schottkys have high leakage current if there is another power source on it's cathode.

Help please.
 

Offline Fank1

  • Regular Contributor
  • *
  • Posts: 159
Re: Power supply outage detection
« Reply #1 on: June 15, 2014, 11:25:08 am »
Add a 100K resistor in series with the transistor base or you will let the smoke out of it.
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5029
  • Country: ro
  • .
Re: Power supply outage detection
« Reply #2 on: June 15, 2014, 06:13:42 pm »
Even with a base resistor (or especially with one), you still have a problem with that circuit, because right after the bridge rectifier you're still going to have 100-120 pulses of DC :



So the transistor may turn off for very brief periods and your pic will incorrectly think you don't have AC adapter plugged in.  So move the capacitor right after the bridge rectifier because the 7812 doesn't need it anyway if it's powered from battery (but it doesn't hurt).

You could just use a 5.6v zener (or less) and set interrupt on pin change.. when adapter fails, pin goes to 0v from 5.6v and you can configure the PIC to detect that.

ps. And what's the deal with C16 and C17?  100nF = 0.1uF ... makes no sense to use 2 of those of same size.

ps2.  I'm also bothered by how you connect the battery.  The label says 12v Pb .. I assume that's a car battery?  That will be 10.8-13.5v or something like that.
The 7812 being a linear regulator it will need 1.5-2V *above* the output voltage to output a proper 12v. It's 2v for around 1A, less at lower currents. I'm ignoring the schottky diode voltage drop as that's only about 0.1-0.3v.
So as you connected it, the battery would have to be about 13.5-14v all the time to see on the output of that regulator 12v - as the battery discharges, you will see 10-11v on the output of that regulator.

Use a regulator with less voltage drop, for example 1117 which needs only 1v above output voltage... but be careful as some 1117 (depends on manufacturer) only tolerate up to 15-16v on the input.
« Last Edit: June 15, 2014, 06:23:55 pm by mariush »
 

Offline thejamesclan

  • Newbie
  • Posts: 5
Re: Power supply outage detection
« Reply #3 on: June 15, 2014, 09:52:37 pm »
I would use a opto coupler driven from the + on bridge rectifier through a 470R resistor to ground and pulled up on the pic input.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Power supply outage detection
« Reply #4 on: June 15, 2014, 10:09:56 pm »
I too would go with an optoisolator. Your Q2 in your circuit is lacking a base resistor resulting is a deceased  transistor, not just resting.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf