Optocoupler Circuit Using arduino

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Optocoupler Circuit Using arduino

Postby Meissnerb44 » 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

Postby Meissnerb44 » 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

Postby adafruit_support_bill » 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: 15917
Joined: Sat Feb 07, 2009 9:11 am

Re: Optocoupler Circuit Using arduino

Postby Zener » 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: 1982
Joined: Sat Feb 21, 2009 1:38 am

Re: Optocoupler Circuit Using arduino

Postby Zener » 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: 1982
Joined: Sat Feb 21, 2009 1:38 am

Re: Optocoupler Circuit Using arduino

Postby Meissnerb44 » 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 677 times
Meissnerb44
 
Posts: 9
Joined: Fri Dec 07, 2012 2:38 pm

Re: Optocoupler Circuit Using arduino

Postby Zener » Fri Jan 25, 2013 1:34 pm

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

Re: Optocoupler Circuit Using arduino

Postby Meissnerb44 » 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

Postby goldensolo » 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

Postby Zener » Mon Feb 11, 2013 12:59 pm

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


Return to General Project help

Who is online

Users browsing this forum: No registered users and 11 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [105]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]