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

preview_player
Показать описание
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.

__________________________________________________

►My twitter: @GyroMakes

Рекомендации по теме
Комментарии
Автор

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

mujahidalfattaah
Автор

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.

maxr
Автор

Thank you so much for this tip. I couldn't for the life of me work out why this wasn't working!

bradserls
Автор

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)

EricJorgensen
Автор

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.

alvinmast
Автор

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!!

vks
Автор

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?

AsDurTube
Автор

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

speedyairsoft
Автор

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.

dedesite
Автор

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?

IIIXJannikXIIIDE
Автор

Yeah. That's exactly what I was looking for, exactly relay I want to mess with.

Thank you! 👏👏👏

marcelosantos
Автор

I just connect the VCC to 3.3v instead of the 5v and it works perfect.... is there something wrong with that solution?
Thanks!

BrunoGaspar
Автор

Is it a high level or low level switch?

IonCubekhanz
Автор

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!

zabagar
Автор

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.

elektronkim
Автор

This was a year ago is there a better way now? Is there a relay module you don't need to solder anything to?

pcysneros
Автор

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?

bellwlobell
Автор

Thanks !! I thought I was the only one having this problem. Your Very Well Produced video really helped me.

patrickm
Автор

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.

Berghiker
Автор

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.

freedomishealthy
join shbcf.ru