Hello,
I was looking at some relays and found that you have this one available, https://www.adafruit.com/product/3191, but need a relay that can handle more amps. I have found some other relays that would work for me like this one https://www.mouser.com/ProductDetail/Om ... 4IbA%3D%3D but the coil voltage is 5VDC which will not work for a raspberry pi. I have found that you sell this https://www.adafruit.com/product/757 for 5v to 3.3.v, but is there something that works the other way?
Thanks,
Nick
Relay with PI
Moderators: adafruit_support_bill, adafruit
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
What do you require in terms of voltage / current?
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
I am using the relay for a 6v 15amp connection. I chose a 20amp relay to be safe
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
We sell a level shifters you can use to easily bump up the Pi 3v logic to 5v to trigger the relay coil.
https://www.adafruit.com/product/3877
I normally use transistors for this as larger relays sometimes need a little more current than the controller pins would provide.
https://www.adafruit.com/product/756
Be sure and use a snubber diode to prevent kickback on the coil.
https://www.adafruit.com/product/1641
https://www.adafruit.com/product/3877
I normally use transistors for this as larger relays sometimes need a little more current than the controller pins would provide.
https://www.adafruit.com/product/756
Be sure and use a snubber diode to prevent kickback on the coil.
https://www.adafruit.com/product/1641
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
Interesting. I will look into these options.
Would it be possible to use this as well https://www.adafruit.com/product/4654 ? To take the 3.3v signal and boost it to 5v for the coil?
Would it be possible to use this as well https://www.adafruit.com/product/4654 ? To take the 3.3v signal and boost it to 5v for the coil?
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
The MiniBoost 5v falls into the category of powered electronics in that it is trying to deliver a significant amount of current at a higher voltage. Your relay coil typically wants 10mA - 30mA of current so this device would be way too powerful.
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
You guys are out of the signal diodes will the power ones work in place?
What is the difference?
Thanks,
Nick
What is the difference?
Thanks,
Nick
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
The power diode will likely work. These large diodes usually have a more significant voltage drop 0.7v for the 1N4001 we sell.
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
Is this correct? I can use the 5v from the pi to switch the relay with a transistor connected to a GPIO pin. Was not sure where to put the diode though.
The larger board connected from the battery to the relay is a 6v 15amp voltage regulator. And the relay that I want to use does not have a common. https://www.mouser.com/datasheet/2/307/ ... 189816.pdf
The larger board connected from the battery to the relay is a 6v 15amp voltage regulator. And the relay that I want to use does not have a common. https://www.mouser.com/datasheet/2/307/ ... 189816.pdf
- Attachments
-
- relay wiring.JPG (166.55 KiB) Viewed 170 times
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
Just looking at the Pi <--> Relay + Diode you are close.
Be sure and set this flyback diode across the trigger coil with the line on the diode connected to this positive side.
You can search for more photos of flyback diode to see what I mean, but in summary one end of the diode connects to the 5v negative coil and the other connects to the 5v positive coil. This will prevent kickback to the Pi.
Be sure and set this flyback diode across the trigger coil with the line on the diode connected to this positive side.
You can search for more photos of flyback diode to see what I mean, but in summary one end of the diode connects to the 5v negative coil and the other connects to the 5v positive coil. This will prevent kickback to the Pi.
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
Thanks, now I need to try it out.
- Attachments
-
- relay wiring 2.JPG (27.16 KiB) Viewed 163 times
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Relay with PI
The diode placement looks good!
When you wire it up try one or two things at a time. eg. Pi --> transistor --> relay coil + diode and make sure you hear the relay correctly clicking before adding all the other stuff in.
When you wire it up try one or two things at a time. eg. Pi --> transistor --> relay coil + diode and make sure you hear the relay correctly clicking before adding all the other stuff in.
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
So this does not work the way that I original thought it would. When you apply the 5v to the collector pin and the 3.3v GPIO pin to the base pin you end up with a voltage of 2.8 on the emitter pin. I thought the transistor would act like a switch and result in 5v on the emitter pin. Is this not how you use a transistor ? I am using a 2N3904BU transistor that I had a few of.
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
Ok so I figured out how I can get it to work. If you always have the +5v connected and use the transistor to switch the ground it works. I have just been testing with a multimeter right now (I don't have the relay yet) but this is how I believe it should work.
Not really sure why switching the 5v did not work. When I had it wired up that way it did not even matter if I had anything connected to the collector, if the base was powered with the 3.3v the emitter was always 2.8v.
Not really sure why switching the 5v did not work. When I had it wired up that way it did not even matter if I had anything connected to the collector, if the base was powered with the 3.3v the emitter was always 2.8v.
- Attachments
-
- transistor_switch2.JPG (43.73 KiB) Viewed 142 times
- lbsa_drexel
- Posts: 31
- Joined: Thu Oct 05, 2017 10:54 am
Re: Relay with PI
I also found that this works as well. I think it's the better option.
- Attachments
-
- transistor_switch1.JPG (39.43 KiB) Viewed 142 times
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/