Optocoupler Circuit Using arduino

by Meissnerb44 on Thu Jan 24, 2013 11:43 am

I have designed up an optocoupler circuit to work with a 24v photoeye. Basically I am using the optocoupler to reduce the 24 volts that is supplied from the photoeye (24V when nothing in front of photoeye and 0 v when something is in front of it). The 5V side is basically shorted when when there is 24 volts from the photoeye. I would like to post a schematic so that is easier to understand what I am saying. Is there a good preferably free progam to draw up quick schemaitcs in that I can post on ehre for people to see?

Thanks,
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 2:38 pm

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Thu Jan 24, 2013 11:45 am

I guess I never really asked a question there. What I am trying to get at is that my 5V signal is not switching to 0 when the voltage from the photoeye is 24V. Therefore I am thinking that my schematic is wrong or my optocoupler is not working properly. Once I post the schematic it will be easier to see if I have a mistake in the wiring.

Thanks,
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 2:38 pm

Re: Optocoupler Circuit Using arduino

by adafruit_support_bill on Thu Jan 24, 2013 2:13 pm

Hi. I moved this topic to General Project Help since it is not really Arduino specific. If you can post a wiring diagram someone might be able to help.
User avatar
adafruit_support_bill
 
Posts: 28203
Joined: Sat Feb 07, 2009 9:11 am

Re: Optocoupler Circuit Using arduino

by Zener on Thu Jan 24, 2013 2:43 pm

There are probably several ways to post a schematic. The simplest is probably to draw it and take a picture of it. You can use LT Spice which is free. There are other free PCB programs you can use also, such as Eagle PCB.
Zener
 
Posts: 2458
Joined: Sat Feb 21, 2009 1:38 am

Re: Optocoupler Circuit Using arduino

by Zener on Thu Jan 24, 2013 2:51 pm

I can explain how to hook up the opto coupler. The input Led is just a LED. It has a Vf of about 1.5v. You will need a current limiting resistor of around 3 to 5k.

On the output connect the emitter to ground and the collector to your CPU input. Also put a 10k pullup on the collector to 5v.

That should do it.
Zener
 
Posts: 2458
Joined: Sat Feb 21, 2009 1:38 am

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Fri Jan 25, 2013 11:52 am

Where would the current limiting resistor be placed? I currently have the same setup as you are explaining I am just using 3.3K for the current resistor and for the pull up resistor. I have the 3.3K resistor connecting the + side to the anode. Is this the correct setup?


Thanks,
Attachments
photo.JPG
photo.JPG (83.84 KiB) Viewed 1645 times
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 2:38 pm

Re: Optocoupler Circuit Using arduino

by Zener on Fri Jan 25, 2013 1:34 pm

That should work fine. Looks perfect to me. Not working?
Zener
 
Posts: 2458
Joined: Sat Feb 21, 2009 1:38 am

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Mon Jan 28, 2013 1:34 pm

I got it to work. I had the photoeye wired to the schematic incorrectly and it was messing up my system.

Thanks for the help.
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 2:38 pm

Re: Optocoupler Circuit Using arduino

by goldensolo on Mon Feb 11, 2013 11:43 am

Meissnerb44,

Could you specify what optocoupler you are using and what you did on the sensor side to get it to work? I am doing the same thing, trying to take 24v inputs into the arduino.
goldensolo
 
Posts: 1
Joined: Mon Feb 11, 2013 11:40 am

Re: Optocoupler Circuit Using arduino

by Zener on Mon Feb 11, 2013 12:59 pm

Not trying to be a buttinski but any optocoupler should work.
Zener
 
Posts: 2458
Joined: Sat Feb 21, 2009 1:38 am