RPi Tutorial EGHS:12V relay driver

From eLinux.org
Revision as of 14:35, 31 July 2012 by Juraj (talk | contribs) (The Hardware)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Back to the Hub, or the Tutorials page.

GPIO Hardware & Software Tutorials:

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!


The 12V relay driver circuit has been tested with real RPi device and was working properly.

The Hardware

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