small solution to detect 120v ac - Page 1
Forum section: electronics / beginners

author: JWoodrell
author_rank: Contributor
timestamp: April 03, 2014, 04:13:40 pm
content: 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.

author: mariush
author_rank: Super Contributor
timestamp: April 03, 2014, 04:50:37 pm
content: Have a look at ACS712 hall effect sensors or similar devices:http://www.digikey.com/product-detail/en/ACS712ELCTR-05B-T/620-1189-1-ND/1284606They output about 185mV per A, with 0 amps being a 2.5v output (it's bidirectional). Just dissipate some power into a high value resistor, enough to detect change from 0 mA to something like 5-10mA, well enough to make variations in the sensor from temperature and other things not matter. (maybe use some resistors as potential dividers to bring that output down to half and set your microcontroller 10 bit adc with a 2048mV voltage reference and then you have about 2-4mV per bit in the ADC)ps. or if you know how much power is used on the other side of the relay and you just need to be sure the relay clicks , put the sensor after the relay. If engaged, you'll see a value different than 2.5v on the sensor output.

author: linux-works
author_rank: Super Contributor
timestamp: April 03, 2014, 05:01:06 pm
content: you could use 90v neon bulbs with resistors as a '110v active' indicator. then heatshrink the neons with a photo resistor or transistor and you have a heatless switch/sensor.you could do this with leds, too. the led will switch on/off faster than the neon bulb and will only be on half the cycles; so the neon bulb may make more sense since it will be a more constant source of light.

author: richard.cs
author_rank: Super Contributor
timestamp: April 04, 2014, 08:31:19 am
content: You could ballast the opto LEDs with small capacitors instead of resistors removing your heat problem (keep a bit of series resistance to stop any high frequency noise on the line burning out the LEDs), or use neons as another poster has suggested. I'd probably lean towards the latter but the first option is mechanically simpler - you don't have to pair up 15 neons with photodiodes.If I were to do it with neons I would probably make up a black plastic block with 15 holes in. The photodiodes can be standard 5mm ones mounted on a PCB, the block goes over the top anchoring to the PCB with a few screws and then the neons can either be invividual lamps on another PCB the other side or they can be pre-made neon indicator assemblies.

author: JWoodrell
author_rank: Contributor
timestamp: April 04, 2014, 03:16:51 pm
content: I think Im currently leaning towards using the capacitors since it will be nice and clean. just another component on the board, although the 200v caps are bigger, it is what it is. I'll let you guys know once it is working.after playing in the simulator (120v 60hz, aiming for 20mA on through the opto, ended up at 0.47uF with 250 ohm series resistance)

author: Skimask
author_rank: Super Contributor
timestamp: April 04, 2014, 08:19:03 pm
content: This is by far the best solution to detect it...https://www.eevblog.com/forum/chat/sure!-why-not/

author: 128er
author_rank: Regular Contributor
timestamp: April 04, 2014, 09:35:23 pm
content: When i saw this thread, i remembered this chip:https://www.fairchildsemi.com/ds/HC/HCPL3700.pdfI desoldered dozens of them from an old industrial PLC. All the Digital Inputs were 230V AC. And they used this chip.Maybe its a solution for you

author: Fank1
author_rank: Regular Contributor
timestamp: April 04, 2014, 09:55:24 pm
content: Take a 74LS14 schmidt trigger IC and just wrap a piece of insulated wire around the wire you want to sense and connect it to the input.It will pick up enough strays to trigger and tell you if voltage is present.

author: JWoodrell
author_rank: Contributor
timestamp: April 09, 2014, 12:56:07 am
content: well this is how this ended upthe 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 enoughI 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 SSRsall 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.