Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Saving a few coins is not worth your life or the life of the next innocent that picks up your project. An Arduino tied directly to the AC line is a death trap.thank u bro for your help!!!
what if i put Zener diode before connecting to Arduino just i want to save money by not buying transformer
I'm still telling you that you are foolish to do this without proper isolation, regardless of what Mr Al says....
Was that comment to me Colin? I'm in the UK 220vac. This is a DIY optocoupler but the AC side is IMO much simpler.
I simply want to sense 220vac and produce a digital output @ 5V for on or off.
This is the circuit for the neon activated optotransistor. I used an LED to test it (now replaced with 10K resistor) so the output will be Neg (0) when the neon is on. If you want Pos (1) just use a PNP and switch the position of the 10K resistor and transistor. Signal taken from the junction of collector to 10K.
As said before the voltage drop across the Neon is about 60vac. The 220 ohm resistor is just a precautionary current limiter for the optotransistor. The 82k resistor came with the neon, I've seen them with a resistor as high as 150K but I wasn't sure how bright they would be so went for the higher current rating. It would be very easy to hide most of the 220vac part in an insulated cover/tube and since it's only about 300mW, heat dissipation isn't a major issue.
View attachment 106377
Hi,
Neons are somewhat unreliable, you can use an LED instead, or better, use an opto coupler.
To compensate for the pulsing due to the line frequency, use a capacitor just before the base resistor.