ThePiPeArtist
Posts: 18
Joined: Sun Jan 05, 2020 12:32 pm
Location: Australia

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 2:10 pm

LTolledo wrote:
Wed Jan 15, 2020 1:25 pm
ThePiPeArtist wrote:
Wed Jan 15, 2020 12:59 pm

So the Raspberry Pi Phat is essentially a relay board but it works with Raspberry Pi?
yes as those are specifically designed and tested for use with the RPi boards
ThePiPeArtist wrote: Also I'm getting "raspberry pi compatible" relay board.
https://www.jaycar.com.au/arduino-compa ... d/p/XC4419
sorry to bust your party but the relay board in the link is labled
Arduino Compatible 5V Relay Board
CAT.NO: XC4419

so it needs 5v to turn ON, the RPi GPIO cannot/will never output 5v

but you're free to try it yourself.....if you like to insist....
Yeah I saw that but if you go into the description it says raspberry Pi compatible. Not sure though, might be just them being dumb.
Your probably right though as it says the supply voltage is 5v.
Thanks.

pcmanbob
Posts: 7978
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 3:46 pm

As the relay board in question does not have an opto isolator on board I suspect it will be active high,

So a high on the S pin will turn the relay on , but It depends on were the LED is connected and the value of any resistors in the base circuit of the transistor , as to whether the 3.3v will be sufficient to turn the relay on.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

drgeoff
Posts: 10236
Joined: Wed Jan 25, 2012 6:39 pm

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 4:40 pm

LTolledo wrote:
Wed Jan 15, 2020 11:18 am
better use 24vAC neon lights
I've never heard of any neon light that will strike at a voltage as low as 35 volts.

ThePiPeArtist
Posts: 18
Joined: Sun Jan 05, 2020 12:32 pm
Location: Australia

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 10:45 pm

drgeoff wrote:
Wed Jan 15, 2020 4:40 pm
LTolledo wrote:
Wed Jan 15, 2020 11:18 am
better use 24vAC neon lights
I've never heard of any neon light that will strike at a voltage as low as 35 volts.
how about I don't put an LED there since it would be way too complicated. The diagram is for DC voltage anyways.

How about a system like this:
Untitled.png
Untitled.png (14.91 KiB) Viewed 315 times
Thanks.

pcmanbob
Posts: 7978
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 11:47 pm

That will work assuming your relay board works with the pi.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ThePiPeArtist
Posts: 18
Joined: Sun Jan 05, 2020 12:32 pm
Location: Australia

Re: Controlling Solenoid valve with Raspberry Pi 3

Wed Jan 15, 2020 11:56 pm

pcmanbob wrote:
Wed Jan 15, 2020 11:47 pm
That will work assuming your relay board works with the pi.
Yeah. But I'll probably get a PiPhat just like LTolledo said.
Thanks.

ThePiPeArtist
Posts: 18
Joined: Sun Jan 05, 2020 12:32 pm
Location: Australia

Re: Controlling Solenoid valve with Raspberry Pi 3

Thu Jan 16, 2020 2:01 pm

LTolledo wrote:
Wed Jan 15, 2020 1:25 pm
ThePiPeArtist wrote:
Wed Jan 15, 2020 12:59 pm

So the Raspberry Pi Phat is essentially a relay board but it works with Raspberry Pi?
yes as those are specifically designed and tested for use with the RPi boards
ThePiPeArtist wrote: Also I'm getting "raspberry pi compatible" relay board.
https://www.jaycar.com.au/arduino-compa ... d/p/XC4419
sorry to bust your party but the relay board in the link is labled
Arduino Compatible 5V Relay Board
CAT.NO: XC4419

so it needs 5v to turn ON, the RPi GPIO cannot/will never output 5v

but you're free to try it yourself.....if you like to insist....
I got the relay to work. To power on anyways. Now I need to connect the solenoid valve and PSU
Thanks.

emma1997
Posts: 515
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Controlling Solenoid valve with Raspberry Pi 3

Thu Jan 16, 2020 7:17 pm

ThePiPeArtist wrote:
Mon Jan 13, 2020 10:03 am
https://www.instructables.com/id/Raspbe ... on-System/ - Could I follow this design? to control the solenoid valve?
Yes, IMO that is an excellent circuit. Basically using a MOSFET instead of classic NPN transistor. It's not that the latter don't work. Just there are benefits to using a FET in noise, heat generation, parts count.
ThePiPeArtist wrote:
Mon Jan 13, 2020 10:03 am
Otherwise what is your method to control the solenoid valve? Don't really understand what this means:

Code: Select all

        d---solenoid---12v
GPIO---g
        s--gnd
My philosophy is start with the minimum number of components instead of maximum. Unless there are unusual isolation requirements it's possible just one part will work instead of 4 or 5. No relay, diodes , or resistors. Side benefit easier to build and some performance improvements. Not the only way though.

If there is concern to protect the Pi then a 10k-100k resistor can be used between it and the transistor. I never saw that type of failure and have lots of spare Pi so for hobby use don't bother myself.

Here's a version with a bit more info for those not familiar with these transistors:

Code: Select all

          drain---solenoid---12v
Pi GPIO---gate  MOSFET(2n7000,IRF3205,IRL2703,IRF740,etc)
Pi gnd----source---ground
I do have a working unit here ATM if pics are requested. Google is your friend too.

ThePiPeArtist
Posts: 18
Joined: Sun Jan 05, 2020 12:32 pm
Location: Australia

Re: Controlling Solenoid valve with Raspberry Pi 3

Fri Jan 17, 2020 12:21 am

emma1997 wrote:
Thu Jan 16, 2020 7:17 pm
ThePiPeArtist wrote:
Mon Jan 13, 2020 10:03 am
https://www.instructables.com/id/Raspbe ... on-System/ - Could I follow this design? to control the solenoid valve?
Yes, IMO that is an excellent circuit. Basically using a MOSFET instead of classic NPN transistor. It's not that the latter don't work. Just there are benefits to using a FET in noise, heat generation, parts count.
ThePiPeArtist wrote:
Mon Jan 13, 2020 10:03 am
Otherwise what is your method to control the solenoid valve? Don't really understand what this means:

Code: Select all

        d---solenoid---12v
GPIO---g
        s--gnd
My philosophy is start with the minimum number of components instead of maximum. Unless there are unusual isolation requirements it's possible just one part will work instead of 4 or 5. No relay, diodes , or resistors. Side benefit easier to build and some performance improvements. Not the only way though.

If there is concern to protect the Pi then a 10k-100k resistor can be used between it and the transistor. I never saw that type of failure and have lots of spare Pi so for hobby use don't bother myself.

Here's a version with a bit more info for those not familiar with these transistors:

Code: Select all

          drain---solenoid---12v
Pi GPIO---gate  MOSFET(2n7000,IRF3205,IRL2703,IRF740,etc)
Pi gnd----source---ground
I do have a working unit here ATM if pics are requested. Google is your friend too.
I've decided to go with a relay board.
Thanks.

Return to “Automation, sensing and robotics”