![]() ![]() When the current flowing through the LED is interrupted, the infra-red emitted light is cut-off, causing the photo-transistor to cease conducting. For most normal situations you need no more than a few TTL buffers (level converters), so that when things go wrong they blow up, not the raspi.The base connection of the photo-transistor can be left open (unconnected) for maximum sensitivity to the LEDs infra-red light energy or connected to ground via a suitable external high value resistor to control the switching sensitivity making it more stable and resistant to false triggering by external electrical noise or voltage transients. Opto isolation is also only needed when you expect that there can be a (very) high voltage difference between the PI and the peripherals. Obviously needing such a "protocol" is also true with general purpose I/O pins without opto isolation. For example isolated buffers for I2C do exist, but they generally need another control line to determine communication direction. Needing "arbitration" is also true for most other isolated buffer systems. Safely yes,you only need a transistor as (inverting) buffer for the sending led, with a high value base resistor (say 100K), and a 10K pull up on the input pin (might be optional) The receiver optocoupler can be connected to the input pin through a "safety resistor" of say 100E, so that the optocoupler can pull the input (GPIO) pin down.īut you need some kind of protocol to determine whether you are receiving or transmitting, as in this setup everything you send to the GPIO is also echoed to the output optocoupler. So even with optocouplers without series resistors and other precautions you could still damage the SoC if you are not careful or do not know what you are doing.Īll said, the exact same things also apply when interfacing to other microcontrollers, so the R-PI is hardly unique in this regard. If you accidentally program the pin as output, and output a "1", and the optocoupler shorts the pin to ground without the resistor you will blow up the GPIO. When using an opto coupler as input to the PI remember to still put a series resistor in between the optocoupler and the pin. ![]() Also take care not to connect long wires directly to the I/O pins, or the pins may be damaged by static electricity, at the very least put 1K resistors in series, or indeed use opto couplers. Do not use a simple transistor to switch them, but use a special relay driver IC, or at least put a diode across the relay windings (cathode on the supply side). Other things to be careful with are relays, these may generate high voltages across the windings when switched. Its often smart to put a small resistor (1K) in series with a pin to protect it. In case you have a 5V signal that must be input, just use a resistor divider, often 2K2 between the 5V source and the pin, plus a 3K3 resistor between the pin and GND will do the trick. The things you must be careful with are putting input signals onto the R-PI, as all inputs do not tolerate voltages above 3,3 Volt, so do not put TTL level signals directly to inputs (also true for SPI, I2C and UART signals). For a lot of things you do not need to interface them through opto couplers, as simple drivers would be enough. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |