Step 1: Parts
You will need:
RPI 3
4 Amp Power Adapter
120 pcs jumper cable
12 Volt Power Supply
5.5x2.1mm Male+Female DC Power Socket
Step 2: 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
1. Copy Script to Raspberry Pi
2. Type "python relay.py" to run
https://content.instructables.com/ORIG/FRU/KW61/J9YJGOWQ/FRUKW61J9YJGOWQ.py
Step 4: Additional Info
Online Guide: https://www.piddlerintheroot.com/5v-relay/
If you need 5V relay:
If you need other relays:
More Electronic Component,welcome to HALJIA!