Memorial day is 05/25/2015 – Orders will ship out on May 26th. There will not be any deliveries or shipping on Monday. Any order placed after 11am ET on Friday May 22nd will not start to ship out until Tuesday May 26th.

Optocoupler Circuit Using arduino
Moderators: adafruit_support_bill, adafruit

Optocoupler Circuit Using arduino

by Meissnerb44 on Thu Jan 24, 2013 12:43 pm

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 3:38 pm

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Thu Jan 24, 2013 12:45 pm

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 3:38 pm

Re: Optocoupler Circuit Using arduino

by adafruit_support_bill on Thu Jan 24, 2013 3: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.

adafruit_support_bill
 
Posts: 37526
Joined: Sat Feb 07, 2009 10:11 am

Re: Optocoupler Circuit Using arduino

by zener on Thu Jan 24, 2013 3: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: 2880
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

by zener on Thu Jan 24, 2013 3: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: 2880
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Fri Jan 25, 2013 12:52 pm

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 1958 times
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 3:38 pm

Re: Optocoupler Circuit Using arduino

by zener on Fri Jan 25, 2013 2:34 pm

That should work fine. Looks perfect to me. Not working?

zener
 
Posts: 2880
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

by Meissnerb44 on Mon Jan 28, 2013 2: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 3:38 pm

Re: Optocoupler Circuit Using arduino

by goldensolo on Mon Feb 11, 2013 12:43 pm

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 12:40 pm

Re: Optocoupler Circuit Using arduino

by zener on Mon Feb 11, 2013 1:59 pm

Not trying to be a buttinski but any optocoupler should work.

zener
 
Posts: 2880
Joined: Sat Feb 21, 2009 2:38 am