Optocoupler Circuit Using arduino

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 3:38 pm

Optocoupler Circuit Using arduino

Post by Meissnerb44 »

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

Post by Meissnerb44 »

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,

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Optocoupler Circuit Using arduino

Post by adafruit_support_bill »

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
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

Post by zener »

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.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

Post by zener »

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.

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

Re: Optocoupler Circuit Using arduino

Post by Meissnerb44 »

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 2990 times

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

Post by zener »

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

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

Re: Optocoupler Circuit Using arduino

Post by Meissnerb44 »

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.

goldensolo
 
Posts: 1
Joined: Mon Feb 11, 2013 12:40 pm

Re: Optocoupler Circuit Using arduino

Post by goldensolo »

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.

User avatar
zener
 
Posts: 4567
Joined: Sat Feb 21, 2009 2:38 am

Re: Optocoupler Circuit Using arduino

Post by zener »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”