I have a freezer in my garage which is connected to a GFCI outlet and on occasion it has been known to trip, as far as I can tell during recovery from a power glitch or brownout. Florida building codes require all outlets in the garage, with the exception of overhead door opener, to be GFCI outlets (at least at the time my house was built). Unfortunately there's nothing that I could do about this, but needed a solution because I can't afford to shed another tear over lost steaks or cheeseburgers. After searching online for commercial Power-Fail Alarms, they cost a little bit, are bulky and are current limited as they install inline with the power source. I don't like those things, so I decided to try and build my own. Video is available here: https://youtu.be/N4i3ko-Fr3U
Sometimes I get a little nostalgic for the "old times" and when I'm at the local electronics store, I'll just pick up what I know, because it worked for Forrest Mims right? In the guitar pedal world, some of the best sounding guitar pedals were made with the scarce LM308 and the closest thing I could find on my last jaunt to the store was a batch of LM307s (good name for a band). I bought a fistful because I was making a bunch of guitar gadgets. If you're interested they sound great because of the awful slew rate which creates even-order harmonics which are apparently pleasing to the ear.
The main problem was that I wanted to run this project off of a single supply voltage and I knew this op amp wouldn't get too close to ground. You see, the 555 timer needs a minimum of 0.4v in order to hold in reset and these old op amps can only get within a couple of volts of the supply rails. I could have used an actual comparator like the LM339, but I'd have to wait for another shipment and I'm far too impatient for that. I could use some transistors and just bias them to get what I want or I could reevaluate the circuit itself. After another cup of coffee, instead going through a peak detector, x10 amp, then a comparator... I found that I could just amplify the heck out of the transformer voltage (x80), then use the peak detector, and use a proper op amp like the LM358 that gets closer to the rails. The '358 does a fantastic job of keeping it in reset (at least I think so. I never checked on the scope :) )
So at this point it seems that everything is in working order. When the detected voltage gets through the peak detector, it runs through the comparator and saturates as expected. The values involved are heavily load-dependent at this point and there is definitely room for improvement, but for now it'll work for me.
I think its about time to turn on the video camera and document where I'm at so I can release the next YouTube video.
Well, I finally got the two op-amp stages loaded up on the bread board, started shooting video and tested out the annoying 555 on its own. As I expected with a bipolar based op-amp, I can't hit the ground rail. I'm pretty sure the 555 won't be able to hold reset with the 1 point whatever volts I'm getting at the output. So either I split the 5V supply with a split-rail ground or I try to find better op-amps. Since I'm trying to push this video out to YouTube this week, I'm going to go for the cheap and easy approach - using a voltage divider as a ground reference.
But guess what?! The 555 buzzer is SUPER annoying. Awesome!
At this point I'm digging through the junkbox looking for components that will work for this application and I'll eventually put this up as a YouTube video here. For now we're in the design phase. And before you say Arduino, RaspberryPi or BeagleBone, I just want it to plug in and work. No SD card power down issues, no fancy pants case, list of accessories, wireless, blah blah. Plug it in and get back to grilling.
Components I have on hand are:
1. Passives
2. Some op-amps, namely some old LM307's and LM324's
3. Handful of 1N4148's
4. Some NPN/PNP transistors (2N3904 & 2N3906)
5. Red LED for a comparator reference voltage
6. A fistful of magnet wire and a scorching antipathy for spoiled meat
What I've come up with so far is an active peak detector, amplified to some gain to be determined, then through to a comparator which will enable/disable a 555 timer set to trigger an old "SONALERT" piezo buzzer at some annoying interval. Basic, nothing fancy and made from junk stuck deep in the carpet of my office. Perfect.
Active Peak Detector - In sensing the AC voltage (this is basically a barely effective transformer), just passing it through a small signal diode drops the ubiquitous 0.7 volts, eating up a lot of my coil winding efforts. So an active rectifier recovers a lot of what would be lost with just a small signal diode. That gets passed on to a capacitor (2.2uF) and a light, predictable load which turns this into an "Active Rectifier and Peak Detector" circuit - like peanut butter and jelly.
Preamp & Comparator - I'll need to bump up that output signal from the peak detector by some value to get above the LED voltage reference of the following comparator. I think that will be like 1.7v, though I haven't checked the particular batch of LEDs I have on hand. The comparator just does what it does. No hysteresis needed here because the peak detector is so slow, AC line transients are not an issue - or shouldn't be :)
I'm still thinking about the inverting comparator and wonder being a single supply rail if it'll slam down close enough to the negative rail for the 555 reset. It may be that I use an inverting gain stage and a regular non-inverting comparator instead. That makes sense right? Hmmm.
555 Astable Multivibrator - Who doesn't love an astable multivibrator? Reset line is controlled by the previous comparator. The timing components R1, R2 & that electrolytic I forgot to label control the timing of the buzzer. I'll probably make the period something like 1.5sec or in that neighborhood. What's the diode? A little trick for getting 50% duty cycle. Without it, a 555 can never be less than 50%. Since a 555 charge path is through [R1, R2 and the electrolytic] and the discharge path is only through [R2 and electrolytic], guess what? We can't have a 50% duty cycle - the charge and discharge paths are different. But, if we make R1 and R2 equal and stick a diode across R2, the charging path becomes [R1 & electrolytic] while the discharge path becomes [R2 & electrolytic]. Bam! 50%
This project reminds me of the kind of stuff i do all the time with my junkbox parts, use what I have to do something without having to make an order... Invariably they are usually the projects that I get the most enjoyment out of... After reading your logs, a thought occurs...
You could maybe use the output of your comparator to drive an NPN transistor to hold the 555 in reset, and use a pull-up. That saves you having to purchase a more expensive op-amp to do the job and get the lower voltage swing... It may also save you having to split the 5V supply rail, which doesn't leave you with much headroom... You might have to change the polarity of your comparator to do it though...
This project reminds me of the kind of stuff i do all the time with my junkbox parts, use what I have to do something without having to make an order... Invariably they are usually the projects that I get the most enjoyment out of... After reading your logs, a thought occurs...
You could maybe use the output of your comparator to drive an NPN transistor to hold the 555 in reset, and use a pull-up. That saves you having to purchase a more
expensive op-amp to do the job and get the lower voltage swing... It may also save you having to split the 5V supply rail, which doesn't leave you with much headroom... You might have to change the polarity of your comparator to do it though...