2

I need to use a ESP32 WROVER B based MCU board with a standard (cheap) one-channel 5 V relay (e.g. to switch on a mains-power appliance).

Attempted removal of excess solder around the headers permanently disabled the 5 V power output line from the board (to power a relay or other modules), but other pins functional/board boots up correctly.

So at present, there is only a 3.3 V power source and 3.3 V GPIO pins (and others such as for external microphone and speaker).

I assume it is safe to connect a 3.3 V GPIO from the MCU to IN and external 5 V power source to VCC ad GND of the relay and connect the grounds of the MCU and relay together to complete the circuit.

The relay only needs to switch the appliance on when triggered (for example a lamp) and switch off when triggered again. I have a 3.3 ↔ 5 V bidirectional level shifter, but don't think it is suitable here (unless it can be incorporated directly). An alternative maybe is to use an Arduino Uno to connect with the relay, itself triggered by the ESP32 and more complex circuitry (bearing in mind the ESP32's GPIO is 3.3 V and the Arduino's is 5 V).

ocrdu
1,7953 gold badges12 silver badges24 bronze badges
asked Nov 25, 2020 at 11:42

2 Answers 2

1

Assuming a relay module: check if it is OK to drive it with 3.3 V logic when it is on a 5 V power supply, or show the specs for us to look at.

Driving a relay module with 3.3 V logic is unlikely to harm the ESP32, but it may not drive the relay properly if the relay module expects 5 V logic.

Generally, I would even prefer using an external power supply rather than the 5 V pin on a microcontroller board to power a relay module.

As long as you connect everything as you describe, it should work just fine (if the relay module accepts 3.3 V logic).

answered Nov 25, 2020 at 12:14
0

These "digital relay" modules are available in 3.3V and 5V versions. Simply buy one of the 3V models. Here is one, for example: https://www.dfrobot.com/product-1572.html

answered Nov 25, 2020 at 17:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.