Go Down

### Topic: need help completing this circuit (Read 1 time)previous topic - next topic

#### AJ Weber

##### Apr 25, 2012, 03:11 pm
OK, so in order to detect power loss, I'm going to try hooking this:
http://www.isocom.com/datasheets/db92449.pdf
ISP814 to my 120VAC, 60Hz line (with roughly 150k of resistors) to limit current.

On the other side, the idea is to connect to one of the Arduino's digital I/O ports, using the pull-up.  But I have at least one (possible) issue on that side: the ISP814 is using two inverse, parallel diodes to keep it lit as the AC cycles, but as it crosses zero, I assume neither will be lit.  Thus, I think I need a cap and possibly a resistor on the side connected to the Arduino (across the ISP814's pins 3 & 4) to "smooth" the output, right?

Any ideas/help would be much appreciated!
-AJ

#### kf2qd

#1
##### Apr 25, 2012, 04:40 pm
Any reason why you are trying to do this at line voltage? You could use the output from a wall wart power supply and work with much safer voltages.

Voltage dividers from the AC line still have the potential to feed you 120VAC if the voltage divider fails. For a safer setup always step it down with a transformer.

#### michael_x

#2
##### Apr 25, 2012, 05:27 pm
Quote
For a safer setup always step it down with a transformer.

That's true, of course, and other hints like
-" use resistors on both power wires " or
-" don't setup those resistors on a breadboard, but aways keep the power line and resistors isolated  "
-" two 47k resistors in series is safer than a single 100k "
are very bad, because either you don't need them or you should not be encouraged playing with mains

That said, you can either smooth the signal on pin 4 electrically or have a "software solution" :
Power is OFF when digitalRead gives HIGH for more than ~10 millis
You could even use the pulse frequency to compare the accuracy of Aduino's clock with the 60 Hz supply ...

#3
##### Apr 25, 2012, 05:31 pm
Or use an optoisolator. Have your voltage divided down/rectified AC driving an optoisolator, monitor the other side with the input.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### AJ Weber

#4
##### Apr 25, 2012, 05:56 pm
Well, if you consider durability and costs, two (roughly) 75k resistors connected on either side of the 120VAC should far outlast a transformer, which also costs additional money and requires resistors anyway to reduce whatever the output is to < 5VDC.  Also, this project won't have an AC receptacle to plug-into, so "wall-wart" is out, though if you exclude the durability and cost previously mentioned, some generic transformer could be included.

Or use an optoisolator. Have your voltage divided down/rectified AC driving an optoisolator, monitor the other side with the input.

Forgive me, obviously a novice, but isn't this an optoisolator I'm trying to use?

#### michael_x

#5
##### Apr 25, 2012, 08:32 pmLast Edit: Apr 25, 2012, 09:44 pm by michael_x Reason: 1

isn't this an optoisolator I'm trying to use?
Sure. If you've got it already, you can use it. Alternatively, you may look for a cheap single diode optocoupler and add a separate diode or led outside. Especially if you will use the unsmoothened pulses. Half the pulses should still be enough to detect power off.

#6
##### Apr 25, 2012, 09:07 pm
Sorry, I missed the link in the initial post.

By the way, what will you do when power goes away? Is the arduino seperately powered, battery backed, super-cap, etc?
Or you are looking for loss of power to something else?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### el_supremo

#7
##### Apr 25, 2012, 09:39 pm
Quote
to detect power loss

What's the Arduino going to do for you if it detects a power loss?

Quote
this project won't have an AC receptacle to plug-into, so "wall-wart" is out

Why?? If you can connect this circuit of yours anyway, what's so difficult about putting a standard jack on the 120Vac side and plug in the wallwart?

Pete
Don't send me technical questions via Private Message.

#### AJ Weber

#8
##### Apr 25, 2012, 10:31 pm

If the AC power is lost, I'm going to send a notification (going to experiment with one of the available GPRS Shields).

I understand the idea of stepping-down the voltage from 120VAC.  I have an old wall wart here that is currently outputting 5.6VDC.  Is there a simple way to connect that to one of my digital I/O ports (via a resistor, I'm sure) and just wait for the pin to go LOW?  (Is the 5.6v outside the Arduino's tolerances?  Should I use resistors to reduce that voltage further to be safer - in the sense of protecting the board?)

Thanks again for all the ideas/help!

#9
##### Apr 26, 2012, 01:07 am
5.6 is a little high, reduce it a little, like to 4.5V, and read it as high/low.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### krazatchu

#10
##### Apr 29, 2012, 06:42 am
Use a resistive divider to reduce it. http://en.wikipedia.org/wiki/Voltage_divider#Resistive_divider

Connect your gnds so that you have a common reference and use large value resistors so that you don't dissipate a lot of power and burn up the resistors.
10k and 47k would be a good choice but you should make sure the input is really 5.6 volts as it could be higher when it's unloaded ...

Michael
----------------------
http://www.krazatchu.ca

Go Up

Please enter a valid email to subscribe