Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

small solution for detecting 120V AC as a digital input

$
0
0

I posted this on a different forum and got some help but wanted to run it past you guys to see if anyother ideas shook out of the tree.

 

[this is a repost from a different forum combining a few of my posts]

hey guys the project I am working on requires me to sense the presence of 120v on 15 different lines back to my microcontroller, trying to do it with optocouplers means i have to drop 120v across resistors to provide 20mA to the opto LED means i am dissipating 2.5W on 15 different resistor sets... 30W in a relatively small plastic box is gonna get very hot.

there has to be a simple way to detect, hey there is voltage here. no power is required eventually just driving the input to the micro through an opto for isolation. I can't find any microtransformer on digikey, although I may not be looking in the right place.

the end goal is just verifying the SSR relays are actually "closing" to verify that voltage is being sent out to the control relays. they are 100-c09d10 allen bradley relays on the equipment I am building this for so I have to work with them. they only draw about 80mA when once they are closed so i don't think there is enough for a current sense solution... but I am open to whatever ideas people have.

thanks for helping me with this, ac stuff is still new to me, my projects are usually just 3.6-5V dc stuff.

[----------------------------------------------------------------------------------------]

 well this is how this ended up

the simulator predicted 30mA through the opto-coupler, and the physical circuit hit around 36mA if you discount an oscillation (which happens each time and I'm not sure why but i don't think its a problem) the part is rated for a max of 150mA input current so i don't think 30-40 is gonna hurt it. i think i can write off the difference to the simulator using "generic" LEDs and also the resistor being 5% and the cap being 10% tolerance. ah well close enough

I am using the input pullup resistor in the micro controller to pull up the open collector on the output transistor, so it goes low when voltage is present, and high when not... and as a nice side effect there is a short timing pulse when the current is 0 (changing directions) at the top and bottom of the sine wave that gives me a short timing pulse i can time the operation to for a zero crossing switching of the SSRs

all in all this worked out very well, thank you guys for the help. there is a small oscillation (at around 1MHz but it is very small around 2mA) but I'm not worried.

[----------------------------------------------------------------------------------------]

 

how I ended up hooking it up.

opto_schem.jpg

 

The optocoupler does in face pull the line low, and even gives me a timing pulse incidentally

opto2.jpg

 

here is the oscillation at the peak current draw

opto1.jpg

 

here is the current draw plot in general (across a 100 ohm resistor) more of a triangular wave rather than a sine that the simulator predicted, but i guess thats real world components

opto3.jpg

 

any thoughts on better or simpler ways to do it?


Viewing all articles
Browse latest Browse all 2077

Trending Articles