In this tutorial you will learn, how to interface relay with your raspberry pi.
I have used 5v relay and AC bulb.
You will easily interface any AC load such as Fan, bulb etc with raspberry pi after watched my complete tutorial.
I have explained complete python program in this video.
If you have any doubt regarding this tutorial please contact me on my mail/What's app number::
Name :: Rahul Jadhav
Contact Number ::9922512017
Mail: Rahulj23101993@gmail.com
Python Program:
import RPi.GPIO as GPIO # Import Library to access GPIO PIN
import time # To access delay function
GPIO.setmode(GPIO.BOARD) # Consider complete raspberry-pi board
GPIO.setwarnings(False) # To avoid same PIN use warning
Relay_PIN = 7 # Define PIN for Relay
GPIO.setup(Relay_PIN,GPIO.OUT) # Set pin function as output
while (1):
print "Bulb on"
GPIO.output(Relay_PIN,GPIO.LOW) #Relay ON
time.sleep(1) # Give 1 second delay
print "Bulb off"
GPIO.output(Relay_PIN,GPIO.HIGH) # Relay OFF
time.sleep(1) # Give 1 second delay
Ещё видео!