![]() ![]() For all normal-voltage purposes, an optocoupler keeps the hot side hot and the cold side cold. If you put 500 V across it, you would see an effective resistance of more than 10 12 Ω. A 4N25 optocoupler boasts an isolation test voltage of 5,000 V between the LED and transistor. The main selling point of an optocoupler is the isolation between the two sides. But if you want to isolate I2C, because signals need to go in both directions, you need to buy an I2C switch to disentangle the signals. ![]() So if you want to couple something like an SPI or UART signal, you can. Signals can only pass from the LED side to the transistor side. In all of these examples, notice that the optocoupler works one way only. You’re free to use the ADCs on your little robot, safe from motor noise! Not only can you interface the low-voltage microcontroller with the higher voltages needed to turn off the high-side transistors in this example, but there’s absolutely no way for all of the voltage noise in the bridge circuit to disrupt the microcontroller. Using optocouplers in a motor driver design kills two birds with one stone. And with large currents ebbing and flowing, not even the ground wires are safe. But especially with stepper motors or DC motors driven with PWM signals, the motors’ power rails can be a very noisy place. First, the motors may require a voltage that would fry your microcontroller, so you’ll usually need at least a transistor between the micro and the motor-driving transistors. This clever H-bridge uses the optos as logic elements as well as isolation.Ī final example of a good use for optocouplers is connecting logic circuits up to beefy motors with an H-bridge circuit. Any input to the microcontroller or output from the microcontroller will need to pass through the LED side of an opto to keep you from getting shocked. For instance, a project that uses a transformerless power supply should be isolated because what the microcontroller sees as “ground” may be up to a few hundred volts off from earth ground. Just as important, an optocoupler can protect the rest of the world from your microcontroller if it’s running at an odd voltage. There’s no common ground to hum at 50 Hz (here), but the serial data gets through: current signal → LED → (created light) → phototransistor → current signal → isolated device. ![]() It signals the synth by sending up to 5 mA down the cable, lighting up the LED inside the opto, and pulling down the “To UART” line on the left side. Imagine that my microcontroller is on the right side of this circuit, plugged into the synthesizer’s MIDI-in port. How can they do this without a common ground? All devices with a MIDI-in port send the voltage over the wires straight into an optocoupler. But my little microcontroller needs to speak 31,250 baud serial to the other microcontrollers in the synthesizers. I was just building a MIDI-compatible device, and because MIDI connects musical instruments together over a distance, there’s the possibility for a ground loop that could make an audible hum in everything that’s plugged together. The only connection between the LED side and the transistor side is non-electrical - light across a small gap - and that provides the rock-solid, one-way isolation. So while implementation details vary, the crux is that your microcontroller turns on an LED, and it’s the light from that LED that activates the other side of the circuit. But there are many choices for the receiver side: photodiodes, BJT phototransistors, MOSFETs, photo-triacs, photo-Darlingtons, and more. What is an optocoupler anyway? The prototype is an LED and a light-sensitive transistor stuck together in a lightproof case. And while simple on-off control of a device through an optocoupler can be as simple as hooking up an LED, they are not perfect digital devices.īut first a step back. When it comes to isolating your microcontroller’s sensitive little pins from high voltages, ground loops, or general noise, nothing beats an optocoupler. ![]() Much like the brain inside your own bone-plated noggin, your microcontroller needs protection from the outside world from time to time. Deep in the heart of your latest project lies a little silicon brain. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |