Saturday 10 May 2014

serial - high speed optocoupler circuit


I have 4n35 optocouplers, I am using these to isolate a motor driver circuit and the Arduino controlling it. I put one on the slave select pin and one on the tx line to the motor controller (there is no rx), however it is not working. I am using a 220ohm resistor between pin 1 of the 4n35 and the tx line from the Arduino and using no other resistors or capacitors. I am following this circuit I have been doing a lot of research on optocouplers and the 4n35. I have seen blogs and forums where people have achieved 9600 baud with it, but I don't understand how they did it.


What can I add to this circuit to make it work? Do I need to use a higher speed optocoupler such as the 6N137A?



Answer




You need a pull-up resistor on the output side of the opto, like this:


schematic


simulate this circuit – Schematic created using CircuitLab


If the output transistor's emitter is grounded, it can only pull the collector towards ground, or let it float. To ensure the motor driver receives a "High" when the transistor is off, you need to add the pull-up resistor.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...