electronics

Above is the code I used in the Arduino IDE. Click the Download link to get the text file.

Python 5 volt remote relay.

import RPi.GPIO as GPIO
import time
channel = 21
# GPIO Setup
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.OUT)
def light_ON(pin):
GPIO.output(pin, GPIO.HIGH)
def light_OFF(pin):
GPIO.output(pin, GPIO.LOW)
if __name__ == '__main__':
try:
light_ON(channel)
time.sleep(10)
light_OFF(channel)
time.sleep(10)
GPIO.cleanup()
except KeyboardInterrupt:
GPIO.cleanup()