Solenoid push pull 5V with Raspberry Pi 3

#1

I am looking for the code of solenoid 5V push pull which is in your project list but when i am trying to download the zip file it is always showing error. Please help

0 Likes

#2

Do you have a link to the circuito project?

0 Likes

#3

Yes I do. Please look into the matter. Here’s the link

https://www.circuito.io/app?components=9443,11015,200000

0 Likes

#4

Hello Sir,

Do you have any solution for it. Its very urgent.

0 Likes

#5

I see the error now:

<Error>
    <Code>AccessDenied</Code>
    <Message>Access Denied</Message>
    <RequestId>E4EC11C238EB89CF</RequestId>
</Error>

I think we’ve seen this before and there wasn’t a solution we as users could come up with. It seems to be a problem with the code generated for the Raspberry Pi. If you swap out your controller for an Arduino you’ll be able to download the code. But that’ll be Arduino code in C/C++ rather than Python so probably not what you want. :frowning:

Here’s that circuito anyway if you want to see it: https://www.circuito.io/app?components=514,11015,11022

Sorry I can’t be more help. :disappointed:

0 Likes

#6

The circuit which you have shown is right. Isn’t it?? The RPi one

0 Likes

#7

The circuit I showed uses an Arduino Nano v3, not a Pi.

0 Likes

#9

I have written the code for the circuit which i gave the link to you. Could you please check with it once??

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 pin 8 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

0 Likes

#10

Hi rajbuddy007,
Your code seems correct apart from the fact that in the circuito link you’ve posted the circuit diagram is referring to GPIO pin 4.
Your code is referring to pin 10…
Was it working for you?

0 Likes

#11

Hello thanks for the reply. No that isn’t a problem. The problem is with the components in the circuit which i couldn’t figure out. Any help would be appreciated.

0 Likes

#12

Sure,
Looking at this arranement: https://www.circuito.io/app?components=9443,11015,200000

At the top left you have a MOSFET transistor that you need in order to switch a high load like the solenoid. The model of this one is FQP30N06
below it there’s a 10KOhm resistor and a rectifier diode 1N4001.
you can click on each component and get more info on it by clicking the “More info” button.

1 Like

#13

I have built the same circuit with same components but still its not working. While checking the voltage of the solenoid its not getting enough current. Could you please help me with the circuit i am not able to figure out yet where am I getting wrong in spite of making a same circuit what you have shown!

0 Likes

#14

First of all, are you sure that you are using a 5V solenoid?
If you are than it should work, if you provide the raspberry pi with a good power source (2.5 Amps for RPi3B!!)
if it isn’t a 5V solenoid than you need to hook it up to an external supply like done here:
https://www.circuito.io/app?components=9443,10457,200000

0 Likes

#15

As i said, I am using the same components as shown in the ckt and so is the solenoid. Its still not working, i even tried to give external source instead of Rpi but still it didnt work.

0 Likes

#16

mmm could you take a picture of it for me?
also, what if you switch the transistor with a led (just want to make sure that the gpio is working)

1 Like

#17

Have a look at the picture. Yes i did run the code and measured the voltage of gpio pin and it was working. I just wanted to ask like the transistor you have state has a threshold of 4V and GPIO gives 3V then how will it swtitch??

1 Like

#18

I have measured the voltage of solenoid its not supplying desired current to it. The circuit is the same like in the above picture. What should be the problem??

0 Likes

#19

I’m sorry, I’ve found out that my error and the error in circuito is this difference:

The actual and correct model is FQP30N06L
without the L it won’t be switching for 3.3V input (like the pi has).
Actually, the schematic has the right model drawn on it but the parts list is giving the wrong link…

Sorry :man_facepalming: If this won’t work let me know, I will investigate further on…

0 Likes

#20

whats the difference between FQP30N06 and FQP30N06L?? As i can see both have the same threshold (2 to 4).

0 Likes

#21

Hopefully it got worked. But the solenoid is getting heated up what should i do?

0 Likes