vincexie369
Posts: 13
Joined: Sat Jul 18, 2015 5:39 pm

gpio pin question

Sat Jul 18, 2015 5:45 pm

hello,

sorry for the rookie question...I am going to use the raspberry pi to control 2 ground state relays. The input required is 3-30V DC to turn on the switch. So, im thinking about using GPIO pins 2 and 4 (the ones with the 5V output), but are those pins meant to perform that kind of job? If not, any other suggestions? Also if i were to use those pins, would i need a more powerful power supply for the raspberry pi? I had a 5V 1amp power supply but that might not be enough right? thanks so much for your help!

- Vince

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

Re: gpio pin question

Sat Jul 18, 2015 5:57 pm

Do you have a link to the relays. "ground state relay" is a phrase I have never encountered before.

The RPi and its PSU may well be able to provide enough current to energise the relay(s) but it may be necessary or just advisable to have a transistor between a RPi GPIO output pin and a relay.

(The 5 volt pins you mention are constant 5 volts. There is no control to turn them on or off.)

vincexie369
Posts: 13
Joined: Sat Jul 18, 2015 5:39 pm

Re: gpio pin question

Sat Jul 18, 2015 6:36 pm

im sorry i meant solid state relays haha:
http://www.amazon.com/Input-3-32V-Outpu ... 74820011_5

How about the 3.3V outputs? can you switch those, or are those constant too? thanks for the reply

klricks
Posts: 6593
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: gpio pin question

Sat Jul 18, 2015 7:40 pm

vincexie369 wrote:im sorry i meant solid state relays haha:
http://www.amazon.com/Input-3-32V-Outpu ... 74820011_5

How about the 3.3V outputs? can you switch those, or are those constant too? thanks for the reply
The 3V3 on physical pins 1 and 17 are full time power only and are not switchable by coding.
The 3V3 and 5V and Grounds are technically not really GPIO even though they are contained what many call 'the GPIO header'.

The relay may or may not work on a GPIO? It's right on the specification edge. If not then add a transistor switch to a GPIO pin of your choice and use it to switch the 5V power to the relay inputs.

BTW what voltage do you plan to connect to the output of the relay? The one in your link is for DC output only.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

vincexie369
Posts: 13
Joined: Sat Jul 18, 2015 5:39 pm

Re: gpio pin question

Sat Jul 18, 2015 9:37 pm

Ok thanks. Ill look into the transistors. Also, can someone explain how this guy did this:
https://www.youtube.com/watch?v=7cDbz4aw02E

Its kinda exactly what im looking to do. using a solid state relay to switch something on/off. I just dont understand how he did it with the pi. Thanks so much i appreciate your help

-Vince

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

Re: gpio pin question

Sat Jul 18, 2015 9:53 pm

vincexie369 wrote:Ok thanks. Ill look into the transistors. Also, can someone explain how this guy did this:
https://www.youtube.com/watch?v=7cDbz4aw02E

Its kinda exactly what im looking to do. using a solid state relay to switch something on/off. I just dont understand how he did it with the pi. Thanks so much i appreciate your help

-Vince
Unfortunately the sort of input that relay has will require two transistors. I'd recommend an NPN common emitter followed by a PNP common emitter.

User avatar
sommersoft
Posts: 35
Joined: Sat Jul 11, 2015 1:43 pm
Location: Delaware, US

Re: gpio pin question

Sat Jul 18, 2015 10:34 pm

The SS relay in that video is this one:
https://www.sparkfun.com/products/13015

SSR-40 DA, as can be clearly read in the video.

It has the same input voltage range as the one the OP posted from Amazon.
"We mock what we don't understand." - Dr. Trowbridge

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

Re: gpio pin question

Sat Jul 18, 2015 11:45 pm

sommersoft wrote:The SS relay in that video is this one:
https://www.sparkfun.com/products/13015

SSR-40 DA, as can be clearly read in the video.

It has the same input voltage range as the one the OP posted from Amazon.
It is not the same relay as the OP's. His is for switching DC. That Sparkfun one is for switching AC.

User avatar
sommersoft
Posts: 35
Joined: Sat Jul 11, 2015 1:43 pm
Location: Delaware, US

Re: gpio pin question

Sun Jul 19, 2015 1:35 am

drgeoff wrote:
sommersoft wrote:The SS relay in that video is this one:
https://www.sparkfun.com/products/13015

SSR-40 DA, as can be clearly read in the video.

It has the same input voltage range as the one the OP posted from Amazon.
It is not the same relay as the OP's. His is for switching DC. That Sparkfun one is for switching AC.
I didn't say it was the same relay; I said same input voltage. So unless my understanding of how a relay is setup, the input voltage will be dealt with the same for an output of AC or DC?

Unless of course you're controlling the relay from the Pi, to power the same Pi... :shock:
"We mock what we don't understand." - Dr. Trowbridge

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

Re: gpio pin question

Sun Jul 19, 2015 7:55 am

It may have the same input voltage but the behaviour with marginal inputs is different between the DC and AC versions.
www.clin.cn/DownloadFiles/1-5A.pdf
The zero crossing detector plus triac in the AC version will cause it to either switch or not and the triac will always be in its Safe Operating Area (provided the load voltage and current are within its limits).

By contrast, with low input voltages the Darlington pair in the DC version might operate as a current amplifier rather than a switch. With high voltage, high current loads this could result in significant power dissipation in the relay and its failure. I don't say this will certainly happen but it needs to be considered especially as we do not know what load the OP wants to control.

Return to “Beginners”