Any help with 5V relay

Hi, total noob here. I am somewhat stumped.

I have an ESP32 board i want to switch relays with.

I have connected a 3.3 to 5V logic level converter between GPIO and relay. When I measure with a multimeter, I get 5V when GPIO is switched on.

However when a relay (HF41F) is connected to it, the voltage drops to about 2.5V and relay does not trigger. 5V power supply is 2.4A, so it should be plenty. The relay triggers if I connect 5V to it directly, so it should be functional.

Is the logic level converter too cheap or am I doing something wrong?

  • Always show us a good schematic of your proposed circuit.
    Show us good images of your ‘actual’ wiring.
    Give links to components.

  • In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.
    Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

HF41F

1 Like

I wonder, the relay which is inductive will require over 30 mills at 5V. The Arduino is not rated for that much current. This may help you understand what is happening and consider yourself very lucky if the ESP has not been damaged.
Gil's Crispy Critter Rules for Processor Hardware:

  1. Rule #1: An Arduino is NOT a Power Supply!
  2. Rule #2: Never connect anything inductive (motors, speakers) directly to an Arduino!
  3. Rule #3: Avoid connecting or disconnecting wires while the power is on.
  4. Rule #4: Do not apply power to any pin unless you are certain of what you're doing.
  5. Rule #5: Do not exceed the maximum voltage ratings.
  6. Rule #6: Many Arduinos cannot power transmitters directly.
  7. Rule #7: Before powering your project, take a break and double-check the wiring.

LaryD’s Corollaries:

  1. Coro #1: When starting out, add a 220Ω resistor in series with both input and output pins to protect against shorts.
  2. Coro #2: Invest in a Digital Multi-Meter (DMM) to measure voltages, currents, and resistance.

Note: Violating these rules can turn your Arduinos into crispy critters. For optimal performance, keep your wires under 25 cm (10 inches).

Hi, @xfr
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Are you powering the DC-DC converter from the GPIO?
If so STOP, the output current from your ESP is not enough to power a 5V DC-DC converter.

How are you powering your project?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Thank you for your patience.

DC-DC converter gets 5v power directly from the same PSU that powers everything (2.4A). Its 3.3v is connected to ESP 3.3v

I will try to draw it, it is currently in my mind only :frowning:
It is quite hard for me as I am more of a software/network person, but I try to learn. While I draw, enjoy this mess:

Logic level shifter is for signals, not for powering relay coil.

What you show in the photo is not a HF41F, it looks some kind of DIN rail relay that probably has additional electronics inside.

Please post the datasheet for the DIN relay you are using.

Yeah, suspected as much. It probably does not provide enough current? What is the correct thingamabob to be used there?

This is what you need to do

I tried to document the current setup. I apologize in advance for any readability issues or wrong symbols.

Is it available as a ready-made thingie like the logic level shifter? I will need two channels once it is working.

Yes but I have to draw a new schematic

On your wiring scheme you have also wrong polarity for that relay coil.

Depending on the ESP board, you may be able to connect the 5V to the ESP 5V, otherwise you need a separate 5V supply

Yeah, sorry. Drawing error. Actually they were right.

Great, thank you very much!

Bonus question - if I plan to use multiple DS18B20 temp sensors, should I provide them with a separate 3.3v or will the ESP output do?

As indicated previously the logic level shifter are not for powering relay coil, and the wiring of coil is wrong, be careful with such wiring errors, the microcontroller is at high risk of being damaged. Using a switching transistor MOSFET well enslaved is a good solution for this type of setup, the use of an optocoupler could also do the trick very well to order this relay.

ESP 3.3V is fine. At the most each will only draw 1uA (microamp) when idle and only draw 1.5mA when you ask for a temperature. So 20 more would be no problem but remenber there should only be one pullup resistor on the bus.

Yes, i gathered that. I need 5 so hopefully ok.
Thank you.