optocoupler issues

Thread Starter

Lateral

Joined May 31, 2009
9
hi, i'm trying to use an optcoupler to pass a rc signal to the MCU. i'm using the HCPL-4661 dual, datasheet is here: http://www.datasheetcatalog.org/datasheet/hp/HCNW2611.pdf

i've connected diode 1 properly, i have an external LED that flashes correctly. i've also connected the vcc and ground pins to the power supply of the MCU. the diode is ofcourse working with the signal and ground of the reciever i want to interface. the datasheet also mentions connecting a 0.1μF capacitor between vcc and ground, and i managed to place a couple of them there with a final capacitance of about 0.162μF. so now i'm expecting to get an output on pin 7 following the input of diode1 but nothing happens. i tried removing the coupling capacitors but nothing changed (not that i expected anything anyway). the LED i connected on the output wont flash at all (i tested it and know it works - i swapped the LEDs as well) and i checked if its getting its supply and all is as it should be - i measured on the pins to be sure - 5V crystal clear.

i dont have any idea what i'm doing wrong - any help is appreciated. thanks ^_^
 
Have you configured the pin of the MCU to be an input?

If I understand the issue correctly you are saying the LED is responding correctly before you connect it to the MCU but does nothing at all after you make the connection.
 

hgmjr

Joined Jan 28, 2005
9,027
If you can provide a sketch of the circuit hook up you are using maybe we can spot where things are getting clogged up.

hgmjr
 

Thread Starter

Lateral

Joined May 31, 2009
9
its really late, i'll get a sketch later.

i havent connected the MCU yet, just trying out the optocoupler. the problem is that the opto's output doesnt follow its input and stays completely inactive, like nothing's happening. the input signal is occuring properly but there is no response on the other side.

i'm guessing i'm doing something wrong - all i've connected is the input diode's anode on the reciever's signal output, its cathode at the reciever's ground and the vcc and ground pins at the MCU's vcc and ground (since i want my output to be at the MCU's voltage range).
 
First, the output will be inverted based on the diagram of the part. That can be easily corrected in the MCU.

Second, the output has an open collector, i.e. you need a resistor between pin 7 and Vcc for it to operate. Look at the schematic on page 3 (1-148). Without one the output can only go from floating to gnd. A pullup allows the output to achieve the high state.
 

Thread Starter

Lateral

Joined May 31, 2009
9
i've attached a diagram of the circuit. the only change from my original arrangement is Stayathome's resistor which made the output led stay constantly (and brightly) on. gonna try different values and check it out with an oscilloscope
 

Attachments

Thread Starter

Lateral

Joined May 31, 2009
9
if you mean reverse the polarity of the output LED, i tried it (oh and i dont understand what you mean that the GND connection will be made through the opto) - it just stays off. and i tried looking into it with an oscilloscope and still nada, with or without the LED (wanted to see if there was a signal but too strong or something for the LED to show any difference).

shouldn't it just work? i mean, i've never used an opto before, but what's the standard way to connect it? the internal led connection is pretty straighforward and the transistor should work with this connection - i even tried the 1kΩ resistor between emitter and ground.

would any other information help?
 
Try taking out both LEDs. The LED at the front may not allow enough voltage over the LED in the optocoupler. Put a resistor in the path of the input, Rx signal, to limit the current to about 10mA through the optocoupler LED.
 

Thread Starter

Lateral

Joined May 31, 2009
9
just saw your post and tried it. still straight line at the output, kept your resistor between vcc and pin 7 and tried without it too. 560Ω resistor limiting current to the internal led to about 11mA - removed both external leds ofcourse.
 

bertus

Joined Apr 5, 2008
22,270
Hello,

Here is my idea to connect the optocoupler:



As you see there are no leds parallel at the input and there is a current limiting resistor.
At the output the led has moved and the resistor is adjusted ( the output will go higher).

Greetings,
Bertus
 

Attachments

Top