SOLVED: How do I drive a relay that uses 5v from a d1 mini?

So my effort of setting up a d1 mini to handle a MAX6675 and two relays continue.
The 5v out from the d1 mini powers the relay board fine, but do I need to figure out some levelshifter of some sorts for the GPIO’s to have it powerfull enough to pull the relays?

And if so, any good suggestions for two relays? I have a a bunch of sn74ahct125n 's from my wled project, can I use that somehow, and if so, how do I wire it up?

I found this image with google:
image
So does that mean that the 'A’s are 3.3v input, and the 'Y’s are 5v output? So I can put the two relays on pin 3 and 6 and the GPIO’s on 2 and 5? What are the OE thing, is that just for ground? So I should ground to 1, 4 and 7?

Not sure what you are exactly asking. But I use these type of relays… powered:

  1. directly by 5v from esp
  2. or powered separately 5v and only signalled from esp (see jumper).

I guess the first thing to do is see if 3.3V from a GPIO pin will trigger those relays - it might. If not then a level shifter should work. I managed to find some 3.3V relays - you can pick them up but they take a bit of hunting down.

2 Likes

It says on the banggood page that it can be triggered by 3v3.

2 Likes

Hmm, ok, that made me look very closely on the page, but I didn’t find it anywhere, until I checked the FAQ :slight_smile:
I’ll try and wire it up directly, crossing fingers :slight_smile:

Hey that worked, I used D1 and D2 for the relays, and apart from me having an inverted relay, and it won’t remove the inverted somehow, it works :smiley: Weeheee, thankyou @nickrout , @deckingman and @sender for helping out, not as complicated as I feared.

1 Like

And I found a change in the new esphome, which explained why I felt that it didn’t save the changes.
Previousy when you did a ‘flashing’ which is now an ‘install’ it saved the code first. It doesn’t do that any more :frowning:

yep, https://github.com/esphome/issues/issues/2170

And fixed Fix save on intall from editor by balloob · Pull Request #23 · esphome/dashboard · GitHub