Difference between revisions of "Relay (12V) + Raspberry Pi"

From ESE205 Wiki
Jump to: navigation, search
Line 2: Line 2:
 
[[File:Relay_1.jpg]]
 
[[File:Relay_1.jpg]]
 
The first step is to connect the raspberry pi to the relay.  The first step is to connect a ground pin on the raspberry pi to the GND pin on the relay.  Next, connect one of the 5v pins on the raspberry pi to the VCC pin on the relay. Finally, connect any of the GPIO pins on the raspberry pi and connect it to any of the IN1 - IN4 pins on the relay depending on which relay is used.  For this tutorial, the images shown are from a 4 channel relay but relays can have anywhere from 1 to 8 channels.  It all depends on how many things you need to power.
 
The first step is to connect the raspberry pi to the relay.  The first step is to connect a ground pin on the raspberry pi to the GND pin on the relay.  Next, connect one of the 5v pins on the raspberry pi to the VCC pin on the relay. Finally, connect any of the GPIO pins on the raspberry pi and connect it to any of the IN1 - IN4 pins on the relay depending on which relay is used.  For this tutorial, the images shown are from a 4 channel relay but relays can have anywhere from 1 to 8 channels.  It all depends on how many things you need to power.
[[Files:Relay_2.jpg]]
+
[[Files:Relay 3.jpg]]
 
[[Category:HowTos]]
 
[[Category:HowTos]]

Revision as of 14:29, 11 December 2017

Using a relay is very helpful when trying to power something with a raspberry pi that requires more than 5v. To be able to do this you are going to need a raspberry pi, a relay, and an external power supply. Relay 1.jpg The first step is to connect the raspberry pi to the relay. The first step is to connect a ground pin on the raspberry pi to the GND pin on the relay. Next, connect one of the 5v pins on the raspberry pi to the VCC pin on the relay. Finally, connect any of the GPIO pins on the raspberry pi and connect it to any of the IN1 - IN4 pins on the relay depending on which relay is used. For this tutorial, the images shown are from a 4 channel relay but relays can have anywhere from 1 to 8 channels. It all depends on how many things you need to power. Files:Relay 3.jpg