RPi Tutorial EGHS:12V relay driver
- GPIO Protection Circuits
- Basic Circuits: LED output - DC motor - Switch Input - Analogue Sensor
- Intermediate Circuits: Shift Registers - Analogue to Digital - Driving Circuit - Alpha-Numeric Display
- Advanced Circuits: Control Hardware Over The Internet
This page is part of a work in progress.
While most of these circuits may interface directly to the RPi, the use of a buffered interface (such as the one supplied by the Gertboard) is recommended which will help protect against damage. Alternatively, experiment with one of the Alternative Test Platforms.
Extreme caution should be exercised when interfacing hardware at a low level, you may damage your RPi, your equipment and potentially yourself and others. Doing so is at your own risk!
Note: The 12V relay driver circuit has been tested with real RPi device and was working properly.
The 12V relay driver circuit combines protection circuits described in GPIO Protection Circuits. Design was done with respect to maximize GPIO protection and minimize GPIO current withdraw. The zener diode D1 protects the GPIO pins from over-voltage. R2 and LED D2 is used just to display port status, it may be removed. Transistor T1 is used to minimize current withdraw from GPIO 3.3V output pin. T1 drives the D2 as well as opto-coupler LTV 815. This opto-coupler is capable of driving load up to 80mA, so 12V relay is controlled directly if requires less than 80mA. D3 does relay high voltage protection.
Test board for RPi with two independent 12V relay drivers connected to GPIO pins #11 and #12
Test board attached to RPi