Author Topic: Using resistors and optocouplers as AC voltage detector for Arduino  (Read 938 times)

0 Members and 1 Guest are viewing this topic.

Offline gilliganTopic starter

  • Contributor
  • Posts: 38
  • Country: us
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


 

Offline gilliganTopic starter

  • Contributor
  • Posts: 38
  • Country: us
Bump?
 

Offline Manx

  • Contributor
  • Posts: 39
  • Country: pl
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.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
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.
http://tinyurl.com/y3e57z5t

The 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.
« Last Edit: May 01, 2019, 07:46:35 pm by pwlps »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf