Trying to get this relay working. Ive got a level shifter. Do I need anything else?

April 6, 2023, 14:04

ruhel

Hi. Im trying to get this relay to trigger and I'm concerned I'm not providing enough power to the relay to trigger them. I've got an i2c level shifter thats able to put the voltage from 3.3v to 5v to the relay but the instructions advice that the shifter needs to have a 5v power supply on the HV side. Can I just use a 5v power supply or do I need to find a 5v supply from my Pi 4? The issue is I don't have access to any of the GPIO pins as they are occupied by the HyperPixel Screen. Parts: Raspberry Pi 4 4gb MLink 4 Channel I2C / Parallel Relay Module ( https://hobbycomponents.com/recently-purchased/1090-mlink-4-channel-i2c-parallel-relay-module ) I'm using the Pimoroni breakout connectors for quick release from the relay.







oops.se

Dont mix the 5v from RPi4 and I2C level shifters HV.

ruhel

So do I use an external 5v supply? Im a bit stumped with how to wire it. Trying to follow this : https://littlebirdelectronics.com.au/guides/196/using-a-logic-level-shifter-with-raspberry-pi

oops.se

Yes, you need a separate 5V (Arduino in your URL) that drives the HV side. In your case a separate PSU (Power Supply Unit) 5V will drive the relay module and the 5V side of the level shifters HV.

ruhel

Thank you for the advice. Can I get away with using a USB board and take 5v from there?

oops.se

It depends, if it uses the same USB power as the Pi = No

ruhel

Ah ok. I was planning on taking the 5v from the Pi's USB but ill just use an external 5v battery pack.

verustus

Or you can just solder a wire to 5V rail on the down side of the gpio.

ruhel

Not mine but found this online

verustus

yeah just put some hot glue later so it doesn't short

oops.se

i Wouldn't do it that way!

verustus

why not 😄

herogaca

ah relay board with its own controller, yep not there yet for me

herogaca

just get a psu for the relay board tbh

verustus

Well there is not reason for that but if you want it that way.

verustus

The rpi wound have no problem with 235mA.

herogaca

i mean is there some pins that can extend under the board ?

herogaca

also like that you put more stress in the 5v rail since already the lcd gets power from there (imo)

verustus

yeah not much

verustus

like i am saying 235mA is nothing

ruhel

<@570603770195738645> <@190422021757206530> I had a USB power bank near me so I've tried using that before drilling holes in my case. I joined the GND from the Battery to both the Pi and Relay GND and only the 5v from the Battery to the relay. SDA and SCL are connected normally. I can see the relay in the Pi CLI now but still can't trigger the relay. It could be that I don't have the right relay number but I have no idea how to find that info out automatically without going through each relay 1 by 1.

verustus

you are not using any level shifter

verustus

the scl and sda needs to be 5v for the relay module

verustus

not 3.3v that is coming from the rpi

herogaca

idk relays like those i activate them with like 12v

herogaca

maybe less even thats why i use them

herogaca

Those ones are bus operated yes But ig the 5v isn't just to activate the relay, maybe to power the controller too If the coil is sensitive it can operate even from the Pi's 5v rail then

verustus

i have no idea why did he use the powerbank

verustus

the whole relay module has max current of 235mA and that is almost nothing for the rpi

verustus

so there woulnt be a problem using the rpi to power the relay module

herogaca

Forgot the specs of original pi4 psu even

verustus

its 5v 3a

herogaca

Use some 12v psu, like 12v 2a and use stepdown to USB for 5v pi, plus you get 5v for whatever else you want

verustus

why?

herogaca

I have similar one

herogaca

Just incase something is power hungry

herogaca

Main supply and plenty room to work with

herogaca

Can pull more wattage than pi4 psu

verustus

why?

verustus

just use the normal 5v 3a original usb-c power supply it is enought

herogaca

I mean just incase he wanna add more stuff later or idk rly xd

verustus

well if than why not but its not needed yet so why waste money

herogaca

It will cost like 10$ max

verustus

the level shifter and relay module should use the same 5v rail but it would propably not make any diference because those are just data pins but still it would be better if they would use the same 5v rail

herogaca


herogaca

Now make music with the relays Like click clack in rythm

ruhel

Nearly. I can talk to them but they not activating 🙄

verustus

then use the coreect library

herogaca

Was about to say see the voltage output but it's bus operated 🗿

ruhel

I bloody did it!!!! I found it easier to read the memory address of the chip and use the command i2cset with SBUS and memory address.

ruhel

Thanks for the help lads!!

oops.se

NP

verustus

close this thread then

herogaca

Don't close it I wanna see progress

ruhel

Im working on getting the relay buttons on the touchscreen but thats a big bridge to cross. Mind you I have no experience in ANY on this stuff.

herogaca

Sounds like Minecraft redstone

ruhel

I should have it all finished by tonight. Ill make a video when Im done.

herogaca

Oh you making 3d printer

herogaca

I have friend that has some 3d printer that bed heat just goes to max like controller gone

ruhel

Yeah. It's all finished now. Working perfectly

herogaca

so you got 3d printer and mod some features on it ez

herogaca

wait...

ruhel

No. Pixel 7 Pro. It seems to be pretty decent.

herogaca

:(((( had hopes someone could help with mine g

herogaca

saw camera and curves thought was

ruhel

Whats wrong with yours?

herogaca

cant connect to certain wifi's

herogaca

like my home miktorik 5ghz specifically and some public ones

ruhel

Try this.

smorkyyyy

Why are ther I2C Pins on your Relay?

smorkyyyy

Oh okay

ruhel

They are fun to play around with. Getting another one for my projects.