Hardware Reference
In-Depth Information
A transistor switching circuit
In the preceding circuit, since the GPIO pins operate at 3.3V levels, we will connect the GPIO
pin to the base of the NPN transistor. The collector pin of the transistor is connected to one
end of the relay.
The transistor acts as a switch and when the GPIO pin is set to high, the collector is connected
to the emiter (which in turn is connected to the ground) and hence, energizes the relay.
Relays usually have three terminals, namely, the common terminal, Normally Open Terminal,
and Normally Closed Terminal. When the relay is not energized, the common terminal is
connected to the Normally Closed Terminal. Upon energizaion, the Normally Open Terminal
is connected to the common terminal, thus turning on the appliance.
The freewheeling diode across the relay is used to protect the circuit from any reverse current
from the switching of the relays.
The transistor switching circuit aids in operaing an appliance that operates at 12V DC
using the Raspberry Pi's GPIO pins (the GPIO pins of the Raspberry Pi operate at 3.3V levels).
The relay and the transistor switching circuit enables controlling high current devices using
the Raspberry Pi.
It is possible to use an array of relays (as shown in the following image) and control an array of
decoraive lighing arrangements. It would be cool to control lighing arrangements according
to the music that is being played on the Raspberry Pi (a project idea for the holidays!).
 
Search WWH ::




Custom Search