Using resistors and optocouplers as AC voltage detector for Arduino - Page 1
Forum section: electronics / beginners

author: gilligan
author_rank: Contributor
timestamp: April 29, 2019, 07:14:01 pm
content: Ok, so my screen printing dryer (basically a large pizza oven, not really)... has a PID that controls voltage to the solid state relays and has an "alarm out" which sends 105v (120v) to a light tree at the top to say that it's up to temp.The bulb is dimmly lit and no one pays attention to it. Further more we sometimes bump the off button which puts it in cool down mode with a box. We don't notice this until it's too late.I was thinking I could monitor this "Alarm 1" output and light up a bigger LED as well as give out an audible alert. Then when the Alarm 1 goes off I could have it trigger another condition of a momentary more obnoxious alarm sound to make sure we intended to shut it down.As I looked into doing this, vs a full on bridge rectifire and such. I came across the idea of using a H11AA1 with some resistors to knock the voltage down to ~1.7v where the optocoupler likes it. Ordered some, but as I sit here impatient and thinking about how simple of a design the H11AA1 is with just two led's firing on each swing of the AC line... why couldn't I just do the same thing with a couple of 817's in parallel.Now, the LED's are a bit wimpy when it comes to reverse voltage since they aren't meant to see reverse voltage, so I decided to add some 1N5399's in series to help out with that. This does come with a voltage drop that I wasn't wanting, but in practice, I was getting 15v to the 817 without it and 1.6v with it. So it worked out.My problem is on my output side, I'm still only getting about 50% duty cycle due to the nature of the AC swing.I don't see this as a problem for the arduino but when I put an LED on there as a test output it drops to 1.5v and the LED is very dim.Am I just over thinking this or am I doing something wrong?Here is a crude representation (simulator doesn't have a proper optocoupler so I made this up)... I think you get the idea.http://tinyurl.com/y3e57z5t

author: gilligan
author_rank: Contributor
timestamp: May 01, 2019, 01:50:40 pm
content: Bump?

author: Manx
author_rank: Contributor
timestamp: May 01, 2019, 02:14:47 pm
content: I'm a noob so pardon me if I say something stupid and/or obvious, but if I understand the problem correctly and you try to connect LED to the output of an optocoupler, isn't the current draw too big? I'd use optocoupler's output only with high impedance input.

author: pwlps
author_rank: Frequent Contributor
timestamp: May 01, 2019, 07:23:20 pm
content: Quote from: gilligan on April 29, 2019, 07:14:01 pmThe output drops to 1.5V because this is a typical voltage drop for a LED. The LED is dim because you don't have enough current.The 817 optocoupler datasheet specifies a minimum CTR (current transfer ratio) as 50%. So if your optocoupler driving current is e.g. 10mA then you should suppose 5mA on the output side for your calculations. If arduino needs a 5V input then the optocoupler load resistance (between the optocoupler transistor emitter and ground) should be 5V/5mA=1kohm. You can pick up some current from there to drive your LED only if you amplify the current enough: a simple emitter follower will do (i.e. with the diode between the emitter and ground), with e.g. a 2N1117 or similar.