hello guys,
I have made a circuit of connecting a 5V push pull solenoid with a Rapberry PI but its not working. I have attached a circuit diagram where i have used an N channel mosfet of 60V 30A and diode rectifier with 1A 50V and a resistor of 10KR. I have also written a code please do have a look and tell me whas wrong.
Here,s the code:
I have made a circuit of connecting a 5V push pull solenoid with a Rapberry PI but its not working. I have attached a circuit diagram where i have used an N channel mosfet of 60V 30A and diode rectifier with 1A 50V and a resistor of 10KR. I have also written a code please do have a look and tell me whas wrong.
Here,s the code:
Code:
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BCM) # Use physical pin numbering
GPIO.setup(10, GPIO.OUT, initial=GPIO.LOW) # Set GPIO 10 to be an output pin and set initial value to low (off)
while True: # Run forever
GPIO.output(10, GPIO.HIGH) # Turn on
sleep(1) # Sleep for 1 second
GPIO.output(10, GPIO.LOW) # Turn off
sleep(1) # Sleep for 1 second
Attachments
-
95.1 KB Views: 20