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.
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
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.
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)
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 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 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.
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?
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.
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.
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).
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!
@@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 🤣
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.
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
Před 3 lety
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.
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.
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
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?
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.
Thank you Gyro, I added a link to this video in my robot arm project under description (czcams.com/video/0TPGga4PDmM/video.html). I really appreciate your work.
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.
@@ygreq Tried it. Doesnt work. But you can just use the 3.3v pin on the PI instead of the 5V, and not bother with doing a custom circuit. Just got it to work now, using pins 13, 17 and 6.
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.
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
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.
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?
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.
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
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.
This idea works perfectly simple fast and to the point
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)
my god, this has worked, thank you
this is the easiest solution, thanks so much!
Thank you
Sorry, but I don't understand what you mean, can you be more specific ?
@@dedesite86 gpio pin > cathode > led anode > relay signal pin
Thank you so much for this tip. I couldn't for the life of me work out why this wasn't working!
genuine TONGLING quality :P
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!!
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
@@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.
@@vks002 thank you sir. what if we cut off the o/p by GPIO pin after some time, does it still be activated ???
@@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.
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?
Thx... Your video save my project 🙏
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?
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.
Thanks you a lot I got my relay working on nodemcu❤
@@alvinmast8551 so is it possible to run with 5v or not ? do i need 5v or 3.3v ?
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.
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).
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?
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!
Thanks !! I thought I was the only one having this problem. Your Very Well Produced video really helped me.
Glad you're back
I made this MOD .It Works fine for me. Thank You
I just connect the VCC to 3.3v instead of the 5v and it works perfect.... is there something wrong with that solution?
Thanks!
@@stevechacon1613 for me it is still working with the 3.3v lol in my case it did not work with the 5v
@@stevechacon1613 yap exactly that. But with the 3.3v it worked as normal
@@stevechacon1613 sure, www.ebay.com/itm/5V-1-Channel-Relay-Module-Interface-Board-220V-for-Arduino-PIC-AVR-DSP-ARM/293069763253
@@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 🤣
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.
Thank you!!!!, just what I needed!
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
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.
Thanks a lot.. It saves my money and time.. God bless you
This was a year ago is there a better way now? Is there a relay module you don't need to solder anything to?
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.
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.
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
Works perfecty for me! Thanks a lot!
Thankyou Very Much Sir
you are perfect good man !!!
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?
If you are using RPi Pico you can use `machine.Pin.OPEN_DRAIN` instead of `machine.Pin.OUT`
Question please Sir.... is it much different using arduino instead of raspberry pi? Are you familiar with arduino?
A bidirectional logic converter would work as well? Or no?
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.
Look for trimmer not pot 😉
Thank you Gyro, I added a link to this video in my robot arm project under description (czcams.com/video/0TPGga4PDmM/video.html). I really appreciate your work.
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.
Sure. That would be no problem
can i do this trick on relay module 2 channel version?
what about swapping the pnp with p channel mosfet?
I don't understand why you cant use the 5V pin. Why it wont work?
Yeap. 5V should work well on Raspberry Pi
@@ygreq Tried it. Doesnt work. But you can just use the 3.3v pin on the PI instead of the 5V, and not bother with doing a custom circuit. Just got it to work now, using pins 13, 17 and 6.
@@jakhva This is brilliant! It works without soldering.
@@jakhva I was doing that and working, and for some reason now it does not work anymore :/
@@BrunoGaspar5 see if any wires got out of place or if the relay is still fine. Did you change anything on the software side?
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...
Nvm... The relay is rated 5v, but only at 3.3v do the task with success.
Thanks !!!!
Use an binary optocoupler
Can you share which compenent use in 0:23 please?
czcams.com/video/p7wmzAzDX-Q/video.html
When you turn off the printer remotely, the Raspberry pi also power off?
No
@@Gyro1 Stand by mode?
Oof
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.
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
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.
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?