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:
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