-1

hello I have a Raspberry pi 4 and wanted to connect to a relay but I can not find information on how to connect a Raspberry pi 4 and the relay equal to the photo someone can me I will then program in python, someone can help me. Thank you very much!

enter image description here

GOMES 0802
  • 343
  • 1
  • 3
  • 14
  • I’m voting to close this question because it belongs on [Raspberry Pi.SE](https://raspberrypi.stackexchange.com/). – Andrew Morton Jun 29 '20 at 12:49
  • You can normally find sample applications on the website of the providers of these boards, ie adafruit or joy-it. – PMF Jun 29 '20 at 20:30

1 Answers1

1

Assuming you already have built your relay and setup all the wiring you can just create a simple python script to use the relay:

#!/usr/bin/env python

import time

import RPi.GPIO as GPIO


GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17, GPIO.LOW)

time.sleep(0.25)

GPIO.output(17, GPIO.HIGH)
GPIO.cleanup()
Noah670
  • 81
  • 5