Introduction: 5V Relay (Raspberry Pi)

Picture of 5V Relay (Raspberry Pi)

Basic tutorial of how to setup a 5V Relay with the Raspberry Pi.

Step 1: Parts

Picture of Parts

RPI 3 – https://goo.gl/CdVNoH

4 Amp Power Adapter – https://goo.gl/js4Uc7

16GB Micro SD – https://goo.gl/FDqZal

120 pcs jumper cable: https://goo.gl/FDqZal

5 Volt Relays: https://goo.gl/FDqZal

12 Volt Power Supply: https://goo.gl/FDqZal

5.5×2.1mm Male+Female DC Power Socket: https://goo.gl/FDqZal

Step 2: Setup

Picture of Setup

VCC -> 5 volt pin

GND -> Ground pin

IN -> GPIO 21

*Ensure postive leads are hooked up to NO and C terminals

Step 3: Code

Picture of Code

1. Copy Script to Raspberry Pi

2. Type "python relay.py" to run

Step 4: Additional Info

Picture of Additional Info

Comments

About This Instructable

522views

16favorites

License:

Bio: the Raspberry Pi is Awesome!
More by piddlerintheroot:Soil Moisture Sensor (Raspberry Pi)5V Relay (Raspberry Pi)Stepper Motor Controller (Raspberry Pi)
Add instructable to: