Connect with us

Need help with a Power Failure Alarm Circuit

Discussion in 'General Electronics Discussion' started by jdpr, Nov 14, 2012.

Thread Status:
Not open for further replies.
Scroll to continue with content
  1. jdpr

    jdpr

    5
    0
    Nov 14, 2012
    I need help with my project. I am trying to make an alarm (buzzer) go off when the circuit loses its AC power signal, and have a reset button to shut off the alarm so you don't have to keep listening to it.

    I am using a falling edge detector (using nor gate delay), a nor latch, and a PNP transistor. A 9 volt battery powers the nor gates and the buzzer. Here is my current circuit:

    [​IMG]

    I have modeled this circuit using multisim, and it performs perfectly in simulation. When I breadboard it, however, it doesn't work. Here is my parts list:

    CD4001BE - quad 2 input cmos nor gate IC
    NTE12 - PNP BJT
    1N4007 - diode
    1N4744A_Q - zener diode (the name in the image is incorrect, this is the one I am using)
    254-EMB105-RO - buzzer (rated for 5volts, runs on 3-7 volts, 25mA average, 75mA peak)
    The rest of the components are just resistors and a capacitor. The switch is just a push button switch, initially open circuit.

    What happens is that it will not trigger off the falling edge and the circuit thinks it still has power after the AC power cable has been unplugged. I am also having problems with the buzzer, either it is always on, on at a different sound level, or something else. It is just unreliable.

    Please help with any comments and suggestions you can give me.
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    That circuit with all the NOR gates looks like it's supposed to give you a pulse of length equal to three times the propagation delay of a NOR gate.

    The problem is that with a slowly falling waveform the results will be unpredictable.

    I would suggest that you use a Schmitt trigger to condition the input.

    You could also use a CMOS Schmitt trigger (40106) to produce a short pulse on the falling edge. The whole logic part could be done with a single hex Schmitt trigger if you understand how to use them properly.
     
  3. jdpr

    jdpr

    5
    0
    Nov 14, 2012
    Thanks for the suggestion. I am going to use this strategy to replace the NOR gate delay falling edge detector, which is subject to noise.

    I can see how to create a falling edge detector using one of the 40106 Schmitt triggers, but I am not sure how to make a latch out of the remaining Schmitt triggers to finish the logic part.

    I would need the buzzer to go on only on the falling edge of the power signal, and at no other time. Then a reset button will turn off the buzzer after a falling edge was detected.

    Could you help me out a little further?
     
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    Connect two schmitt trigger inverters in series. Wire the output of the last one to the input of the first via a high value resistor (say 100k).

    Now you have a latch.

    If you use a series resistor (say 10k) and a diode from the output of another logic gate you can cause it to force the latch to change state (but only in 1 direction).

    A switch pulling the input to a supply rail will do the same thing (in the opposite direction as a reset).

    Schmitt trigger inverters allow you to mix the analogue and the digital world in interesting ways.

    a small capacitor and a very large resistor in parallel can be used to force the system to start up in a particular state.
     
  5. jdpr

    jdpr

    5
    0
    Nov 14, 2012
    Ok thanks so much. This totally makes sense.

    Now I am running into a problem with the falling edge detector. I used the falling edge detector with positive output pulse shown on this website:
    http://www.doctronics.co.uk/DDE/DDE_04.html#edge_detectors
    For a square wave input it behaves as the website shows, but for a slowly falling waveform, like the one I have in my circuit, the schmitt trigger never changes states. Would there be another design for a schmitt trigger falling edge detector that would solve this?

    Edit: Nevermind, I just stuck two schmitt inverters in front of the slow waveform to change it to a squarewave.
     
    Last edited: Nov 16, 2012
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    Congratulations on solving this one for yourself.

    These devices are very versatile and you can make them sing and dance if you put your mind to it.
     
  7. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    Do I understand that this entire circuit is used to trip the buzzer when the mains are lost?

    Chris
     
  8. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    I think it's a bit more than that, but essentially yes.

    There are many ways to skin this cat, you could even do it with a 555.

    The desire to have a reset removes some of the trivially simple ones.

    I though that if this used digital logic, it should be done in a way that would work.
     
  9. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    I can't say I'm thrilled over his power supply design. Wall warts are dirt cheap! Besides that all of us accumulate a large trove of them over time.

    Chris
     
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    True, I hadn't even noticed that he powers it from 120VAC. That's really bad.
     
  11. jdpr

    jdpr

    5
    0
    Nov 14, 2012
    Any solution to this? I cannot use a wall adapter because space is an issue. I want to be able to put this circuit into a larger device, so I want to step down and rectify mains voltage to keep the whole design in one package, so that eventually it would work on a single pcb.
     
  12. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    My cell phone wallwart measures ~ 1.25" * 1.25" * .65". It looks like an over sized plug. Are you saying that you're going to hard wire this to the mains, IE no plug?

    Chris
     
  13. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    Get a very small mains transformer. I have some that are about 14mm tall, and have a footprint maybe 20x20mm. You don't need power, so they'd be fine (and they would provide enough power to trickle charge the batteries if you wanted too).

    Sure, there's mains wiring, but that's better than a circuit that is essentially live.

    This is the sort of thing.
     
  14. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    Datsa nica!

    Chris
     
  15. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    But also a little like rocking horse manure. It may be hard to source the exact part, and equivalents are somewhat larger.
     
  16. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    I just had a thought on an alternative concept for mains isolation. You could use a current limited NE2 across the mains and a PhotoTransistor. The NE2 will pull only uA from the mains. Goop them together with opaque compound. I believe an NE2+R across the mains UL approved too!

    Chris
     
  17. jdpr

    jdpr

    5
    0
    Nov 14, 2012
    So it has been a while, but I am having more problems. My circuit looks like this now:

    http://imgur.com/ts9F3rs

    It works fine until I screw it into the chassis of a device I want it to run in. Once the push button switch is screwed into the metal plate, it just buzzes constantly without being able to turn off.

    I assume this is because the chassis is picking up noise somehow, but could there be a way to make my circuit less susceptible to noise? Any other help would be appreciate as well.
     
  18. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    648
    May 8, 2012
    How did ya know that we've been sitting in front of our PC's for the last 8 months waiting for your reply? :rolleyes:

    You seem hell bent on connecting this directly to the mains so I'm outa here. By the way, I realize that spice simulators like to see ground but if you tie that to the mains as is you're going to violate too many codes to mention here. :eek:

    Chris
     
  19. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,419
    2,790
    Jan 21, 2010
    Yeah, at the very least R1 needs to be split in 2 and a resistor placed in series with both outputs of the bridge rectifier.

    That will prevent you blowing fuses (but possibly not ELCB's) when you connect it to some earthed metal thing.

    The buzzing is probably mains hum. Your circuit is also incredibly dangerous. It could do a nice job of killing people.
     
  20. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,270
    Nov 28, 2011
    As well as being dangerous, your circuit won't work properly.

    1. R6 will form a voltage divider with R5 which will prevent U1E's output from reliably holding U1D's input high. I suggest you remove R6 completely.

    2. The polarities of the SET and RESET signals for the latch are both the same! When power fails, D5 will couple a positive pulse to the input of U1D, and when the pushbutton is pressed, it will also couple a positive state onto that input. There is nothing that will set the latch and enable the beeper. I suggest you delete U1A and R4, and reverse D5's polarity. With that change, when power fails and U1C's output goes low, C1 will generate a low-going pulse which will be coupled into the latch by D5.

    Regarding isolation, a simple solution would be an AC-input optocoupler such as the FOD814 (http://www.digikey.com/product-detail/en/FOD814/FOD814-ND/1087821) or an H11AA device (http://www.digikey.com/product-detail/en/H11AA4M/H11AA4M-ND/1053776) with a series capacitor of around 0.1 uF for 230V/50Hz (http://www.digikey.com/product-detail/en/B81141C1104M/495-1661-ND/679524) or 0.18 uF for 115V/60Hz (http://www.digikey.com/product-detail/en/ECQ-U2A184ML/P11007-ND/295853), and a fusible resistor for safety (http://www.digikey.com/product-detail/en/NFR25H0002200JR500/PPC220BCT-ND/614251). Even with a low CTR (current transfer ratio) of 20% you will get 1 mA flowing in the optocoupler's transistor for more than half the time when AC power is present. A small R-C circuit will convert this output to a voltage/no-voltage signal that can be passed to a 40106 gate as before.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Thread Status:
Not open for further replies.
Electronics Point Logo
Continue to site
Quote of the day

-