How to make 5V relay work on raspberry pi (hack)

  Рет қаралды 66,255

Gyro

Gyro

Күн бұрын

Relays and raspberry pi should be easy to implement but as it turns out, it can be complicated. Mostly because pi runs on 3.3V and common relay modules are rated for 5V. o in this video, I'll show you a really simple hack of any common relay module to make it 3V3 compatible. Best of all, only one trimmer is necessary.
►Instructions: www.instructables.com/id/5V-R...
__________________________________________________
►My twitter: @GyroMakes
►Subscribe: kzfaq.info?sub_confi...

Пікірлер: 74
@fladam8584
@fladam8584 5 жыл бұрын
Glad you're back
@bradserls7875
@bradserls7875 3 жыл бұрын
Thank you so much for this tip. I couldn't for the life of me work out why this wasn't working!
@mujahidalfattaah5957
@mujahidalfattaah5957 4 жыл бұрын
Buddy, you are my hero, I've not sleeping for two days caused by this problem, and u save me with this video, thank you my friend, now I can sleep, peacefully
@patrickm9953
@patrickm9953 3 жыл бұрын
Thanks !! I thought I was the only one having this problem. Your Very Well Produced video really helped me.
@maxr382
@maxr382 5 жыл бұрын
Thanks for doing this video. Some posers may not notice that the transistor in the schematic is the one that comes in the board. You are just hacking one component to make it work. BUT - I have just finished experimenting with the values, and the best working value for me is 20k ohms between center and Vin. You mentioned being able use a pot between 10k and 100k. I would recommend >30k on the pot.
@jurgenenders132
@jurgenenders132 4 жыл бұрын
I made this MOD .It Works fine for me. Thank You
@vks002
@vks002 4 жыл бұрын
Hey Buddy , you saved my day, I have been looking for the simplest way to make these 5V relays work with 3.3V and didn't want to use a lot of components. This is by far the best way! thanks again!!
@ashritpawar2001
@ashritpawar2001 2 жыл бұрын
did you try this ??? does it work? please let me know as soon as possible. I'm doing a project using this technique, please help
@vks002
@vks002 2 жыл бұрын
@@ashritpawar2001 Well I did and it worked but getting the sweet spot of the pot is a bit tricky. You have to adjust it for turning ON properly and then it doesn't turn OFF. So you have to adjust again, then turn ON becomes an issue so you adjust many times to arrive at a place where both ON and OFF work fine.
@ashritpawar2001
@ashritpawar2001 2 жыл бұрын
@@vks002 thank you sir. what if we cut off the o/p by GPIO pin after some time, does it still be activated ???
@vks002
@vks002 2 жыл бұрын
@@ashritpawar2001 Not sure if I get your question clearly. The state of the relay should follow the GPIO input. So assuming you have an active LOW relay module, a LOW on GPIO will turn the relay ON and a HIGH on GPIO will turn it OFF.
@bjirlar
@bjirlar 4 жыл бұрын
Thx... Your video save my project 🙏
@EricJorgensen
@EricJorgensen 4 жыл бұрын
It's way easier to use a random LED (and maybe a current limiting resistor) as a current sink between the "in" pin and the gpio pin, so that when the gpio is pulled low the relay is triggered (and the LED maybe lights depending on the CLR)
@SirDrakeful
@SirDrakeful 3 жыл бұрын
my god, this has worked, thank you
@OlivierVanHeulen
@OlivierVanHeulen 3 жыл бұрын
this is the easiest solution, thanks so much!
@omg.itswendelin9374
@omg.itswendelin9374 Ай бұрын
Thank you
@dedesite86
@dedesite86 23 күн бұрын
Sorry, but I don't understand what you mean, can you be more specific ?
@alvinmast8551
@alvinmast8551 3 жыл бұрын
I think simply putting a diode (or series of diodes) in series with the signal wire should work as well. The voltage drop across the diode will allow the voltage on the transistor to go all the way HIGH to 5 VCC where it would otherwise be blocked at 3.3 V which is the HIGH state of the signal pin on PI. 3.3 volts is still enough lower than 5 to keep the relay turned on. Therefore the minimum voltage drop that you will need to have across the diode (or diodes) is (5V minus 3.3V) 1.7 volts. Three regular diodes should have approximately 1.8V which should work. Connect the cathode (the end with the stripe) to the PI and other end to the relay module signal pin. (If you want to try something different, you could try using an LED with ~1.7V drop.) PLEASE NOTE: I didn't try any of this yet. This is just my speculation of what should work.
@miko192837
@miko192837 Жыл бұрын
This idea works perfectly simple fast and to the point
@TheOneWhoHasWallnuts
@TheOneWhoHasWallnuts 5 жыл бұрын
genuine TONGLING quality :P
@BlkNit60
@BlkNit60 Жыл бұрын
Thank you!!!!, just what I needed!
@hienthanhquan
@hienthanhquan 4 жыл бұрын
Works perfecty for me! Thanks a lot!
@MuhammadAli-ys5hq
@MuhammadAli-ys5hq 4 жыл бұрын
Thanks a lot.. It saves my money and time.. God bless you
@elektron2kim666
@elektron2kim666 4 ай бұрын
It's called level shifting as the Pico/RPI is built for 3.3-3.6 volts signal lines. It's a trouble source and you need to be sure it doesn't go over the specs. Always think it through, back and forth before you blow something out by "let's try it this way" and it's too late after a bit of smoke or dead devices. With more signal lines use a level shifter module. This "hack" is a normal procedure, but might not work always.
@zabagar
@zabagar 3 жыл бұрын
I replaced a dead relay with this model and couldn’t get it to work with my Pi. Now I know why. I could do your mod but it’ll be easier to purchase the same model relay as the one that died! Great video though, thanks!
@IIIXJannikXIIIDE
@IIIXJannikXIIIDE Жыл бұрын
Didnt work for me. However I adjust the trimmer, it never turns off again. However, WITHOUT the mod, using 3.3V from the Pi, it works! wtf?
@omkarbansode6305
@omkarbansode6305 Жыл бұрын
Thankyou Very Much Sir
@speedyairsoft1877
@speedyairsoft1877 2 жыл бұрын
idk if im doing something wrong my 5v relay isnt being powered on. on the board it haves g v and s but the but the only time i do get it to turn on is when i have 3v or 5v going into it s which i assume is the switch and the ground on the v which i also assume is the volts and when i add more power to the g which is the ground it clicks and if i put more power into it while plugged into the printer and its on it turns off
3 жыл бұрын
I got two of those and not surprisingly I could not get the first one to work. The second one worked without any mod though.
@pcysneros
@pcysneros 3 жыл бұрын
This was a year ago is there a better way now? Is there a relay module you don't need to solder anything to?
@Josh-oe4ex
@Josh-oe4ex 4 жыл бұрын
A bidirectional logic converter would work as well? Or no?
@musthycmbs20
@musthycmbs20 5 жыл бұрын
Thanks !!!!
@Berghiker
@Berghiker 3 жыл бұрын
Can I use the same battery for both outputs on the relay for 2 different circuits? I did this but the relay keeps clicking. It can't stay on.
@freedomishealthy1086
@freedomishealthy1086 2 жыл бұрын
Can I use a "2 Channel Logic Level Converter 3.3V to 5V TTL Bi-directional Module" instead? I've already got one on my board for something else and am only using one channel.
4 жыл бұрын
what about swapping the pnp with p channel mosfet?
@NevaEdizUfuk
@NevaEdizUfuk 2 жыл бұрын
you are perfect good man !!!
@jonathanoeijoeng
@jonathanoeijoeng 3 жыл бұрын
Is there no other pin that can give 5V ? I remember you mentioned in your previous video that the reason you use that pin is because you use 3.3v relay, does it mean there is other pin that can be used with 5v relay ? Thanks so much
@sandidwikurniawan1809
@sandidwikurniawan1809 4 жыл бұрын
can i do this trick on relay module 2 channel version?
@AsDurTube
@AsDurTube 4 жыл бұрын
I use the same relay board with no MOD. When I connect VCC to 5V on PI (as it should be) it only turns on, not off. When I connect VCC to 3,3V on PI it turns ON/OFF changing LOW or HIGH on the IN connected to PI - I would say: works as expected however VCC to 3.3V instead of 5V. As I am not an expert I have no idea why 5V does not work while 3,3V works and what can happen if I continue use this relay with VCC plugged to 3,3V?
@alvinmast8551
@alvinmast8551 3 жыл бұрын
The reason 3.3V works and 5 volts doesn't. The relay module is looking at the voltage between "VCC" and "IN", when you connect a pin to "IN" that has a high state of 3.3 volts the voltage is still 1.7 volts lower than VCC. Apparently 1.7 volts difference is enough to turn the relay on. To let the relay turn off you will need to allow the voltage on "IN" go all the way up to voltage that is on VCC. About the worst thing that could happen with to lower voltage is: reliability problems. That is: the relay might not consistently turn on when it's supposed to.
@selenaaktar5744
@selenaaktar5744 Жыл бұрын
Thanks you a lot I got my relay working on nodemcu❤
@utkuduman7231
@utkuduman7231 Жыл бұрын
@@alvinmast8551 so is it possible to run with 5v or not ? do i need 5v or 3.3v ?
@dedesite86
@dedesite86 23 күн бұрын
I got the same relay (actually 2 in the same board) and unfortunetly it doesn't work with the 3.3V from a Raspberry pi Pico... I'll maybe try your hack, but on my board I can supply to a different VCC for the relay circuits, so I may create something less hacky with a voltage regulator.
@user473
@user473 4 жыл бұрын
If anyone wants to use resistors instead: the values that worked for me are 33k in place of the default 1k resistor and 56k to VCC (fits nicely between the legs of the transistor if you find an SMD one).
@azfilmmaking6734
@azfilmmaking6734 2 жыл бұрын
Can I just add a 2k resistor between the legs of the transistor? Seems like with 1k it gives the same 3.3v almost as 33k plus 56?
@calvinbarajas5144
@calvinbarajas5144 5 жыл бұрын
Thanks for the great video. Do you know if I can run DC voltage on the NO/C terminals even though it says VAC everywhere on my 5v Relay? I'm trying to power an electromagnet with DC voltage (10V, 2A). Thanks very much.
@Gyro1
@Gyro1 5 жыл бұрын
Sure. That would be no problem
@bellwlobell3199
@bellwlobell3199 2 жыл бұрын
i have question . If JDVCC use +5v (power supply), GND use -5v(power supply) , VCC use +5v (Raspberry pi), IN1(GPIO 17), IN2(GPIO 27),IN3(GPIO22)and IN4(GPIO23). can do like that?
@calvinbarajas5144
@calvinbarajas5144 5 жыл бұрын
Thanks Gyro for a great hack/mod. Can you tell me where you purchased the ultra small pot please. I've looked for them and can only find the bigger ones. Thanks very much.
@Gyro1
@Gyro1 5 жыл бұрын
Look for trimmer not pot 😉
@calvinbarajas5144
@calvinbarajas5144 5 жыл бұрын
Thank you Gyro, I added a link to this video in my robot arm project under description (kzfaq.info/get/bejne/ZrqAesqSmbaonYE.html). I really appreciate your work.
@smartassist9700
@smartassist9700 4 жыл бұрын
Question please Sir.... is it much different using arduino instead of raspberry pi? Are you familiar with arduino?
@BrunoGaspar5
@BrunoGaspar5 4 жыл бұрын
I just connect the VCC to 3.3v instead of the 5v and it works perfect.... is there something wrong with that solution? Thanks!
@BrunoGaspar5
@BrunoGaspar5 4 жыл бұрын
@@stevechacon1613 for me it is still working with the 3.3v lol in my case it did not work with the 5v
@BrunoGaspar5
@BrunoGaspar5 4 жыл бұрын
@@stevechacon1613 yap exactly that. But with the 3.3v it worked as normal
@BrunoGaspar5
@BrunoGaspar5 4 жыл бұрын
@@stevechacon1613 sure, www.ebay.com/itm/5V-1-Channel-Relay-Module-Interface-Board-220V-for-Arduino-PIC-AVR-DSP-ARM/293069763253
@georgeprout42
@georgeprout42 4 жыл бұрын
@@stevechacon1613 I'm dumber. I was looking into 3v relays and completely forgot that I have a bunch of these boards at home already. So thanks for the reminder 🤣
@muratkancaoglu3284
@muratkancaoglu3284 4 жыл бұрын
Use an binary optocoupler
@alexandru-cosminvintila6115
@alexandru-cosminvintila6115 3 жыл бұрын
I don't know what to do. All the time, my pin gpio 2(pin 3) stays high. Doesn't work to turn it off...
@alexandru-cosminvintila6115
@alexandru-cosminvintila6115 3 жыл бұрын
Nvm... The relay is rated 5v, but only at 3.3v do the task with success.
@_emrekocak
@_emrekocak 4 жыл бұрын
Can you share which compenent use in 0:23 please?
@DariusRibinskas
@DariusRibinskas 4 жыл бұрын
kzfaq.info/get/bejne/pp2noN1y36q8XYU.html
@diyer1190
@diyer1190 4 жыл бұрын
When you turn off the printer remotely, the Raspberry pi also power off?
@Gyro1
@Gyro1 4 жыл бұрын
No
@diyer1190
@diyer1190 4 жыл бұрын
@@Gyro1 Stand by mode?
@rikkardo9359
@rikkardo9359 5 жыл бұрын
Oof
@two_boys_and_a_camera
@two_boys_and_a_camera 3 жыл бұрын
For all those people with 5v relays, I had the same problem with it not working. I got it working by using pins 4, 6, 8. If this still doesn't work change it to Gcode command in octoprint.
@worms32
@worms32 3 жыл бұрын
This method requires a high level of soldering skill. Here is an alternative method that can be applied: ogrenilendersler.blogspot.com/2020/12/5v-relay-usage-with-raspberry-pi-for.html
@robson6285
@robson6285 5 жыл бұрын
What a bad designd electronics. Okay it works, just. But use a NPN with two resistors and no need for a trimpot so the transistor will easy switch between totally open and close. Why you used a PNP here? Thats terrible because this will switch depending on the difference between the drive 0 to 3,3v and the 5v rail, so you need to adjust so it can switch on/off on 1,7 and 5v ! You should use the 0v rail as the common, so the transistor will switch on any driving voltage above 0,6v or higher with your choose the resistors.
@SianaGearz
@SianaGearz 5 жыл бұрын
I wonder what you mean exactly. Looks like this relay switches on when it's pulled down by an open-drain output of a microcontroller or microprocessor, where the processor would sink maybe 5 mA of current and the transistor gain of about 200 would make it into up to 1A, with about 100-300mA being necessary to drive the coil. You mean NPN switched collector, low side switching? How do you prevent 5V going into the 3V3 IO?
@codyrap95
@codyrap95 Жыл бұрын
If you are using RPi Pico you can use `machine.Pin.OPEN_DRAIN` instead of `machine.Pin.OUT`
How to Hack Circuit Relay Module to work with ESP8266 3.3V
10:30
FVM Learning
Рет қаралды 10 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 4,4 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 11 МЛН
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 13 МЛН
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН
001 Controlling high voltages with the Raspberry Pi
4:54
exter minar
Рет қаралды 6 М.
Raspberry Pi Relay   Wiring + Code
12:27
Tech Notebook
Рет қаралды 43 М.
Genius Idea! 4 Simple Ways to Make a Welding Machine for Welding at Home
30:55
Build a MIDI to RELAY Box for Arduino
26:01
Notes and Volts
Рет қаралды 4,5 М.
I built my own computer. by hand.
13:03
jdh
Рет қаралды 1,1 МЛН
5 Volt Relay (Raspberry Pi)
10:15
PiddlerInTheRoot
Рет қаралды 124 М.
Top Fifteen Mistakes People Make When Designing Prototype PCBs
12:26
Cosplay Light and Sound
Рет қаралды 136 М.
Using OctoPrint with PSU Control to turn off and on your 3D Printer.
11:38
How To Control Relays With A PICO
42:26
Making Stuff with Chris DeHut
Рет қаралды 2,2 М.
Мой инст: denkiselef. Как забрать телефон через экран.
0:54
WATERPROOF RATED IP-69🌧️#oppo #oppof27pro#oppoindia
0:10
Fivestar Mobile
Рет қаралды 19 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 342 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 3,1 МЛН
PART 52 || DIY Wireless Switch forElectronic Lights - Easy Guide!
1:01
HUBAB__OFFICIAL
Рет қаралды 50 МЛН