Hello,
I have a breadboard, an ESP32, and a relay I want to use.
If I provide external power supply to breadboard, 5v on the left (for the relay) and 3.3v on The right (for the ESP), do I have to connect the ground from 5v to the ground of 3.3v in order for the 4 channel relay to work?
Thank you.
The ESP and any devices connected to it need a common GND. This may be provided by whatever is providing the voltages but there is no harm in doing it explicitly as well
So If a device is using 3.3v it will not be damaged by connecting it to a ground from 5v
Hi,
No as long as its the gnd of the 3V3 supply and the gnd of the 5V supply.
Tom...
![]()
If your relay board has optical isolation, you should not connect the grounds.
Not in this case!
More correctly, a common return which might be ground, or in this case, the 5 V supply.
And interestingly, I do mean the 5 V supply, not the 3.3 V.

Don't let's jump to any conclusions, me included, until we know what the relay is and whether or not it has optical isolation. For instance I have a relay board that connects to an ESP32 and it has no optical isolation
@mongol please provide more details of the relay that you have
This is the relay I use:
I also have another one, which is not installed for the moment:
Do I need to connect the ground to the esp 3.3 ground also for any of these 2 relays?
From the first link that you posted
NOTES: If you want complete optical isolation, connect "Vcc" to Arduino +5 volts but do NOT connect
Arduino Ground. Remove the Vcc to JD-Vcc jumper. Connect a separate +5 supply to "JD-Vcc" and board
Gnd. This will supply power to the transistor drivers and relay coils.
If relay isolation is enough for your application, connect Arduino +5 and Gnd, and leave Vcc to JD-Vcc
jumper in place.
The diagram I gave in #6 is correct for the first option; you do not connect the ground to the ESP - at least you do not connect it directly!
But in your project, I suspect you are deriving your 3.3 V for the ESP32 from your 5 V supply. If so, what you need to do is to connect the 5 V and ground as in the diagram in #6 directly to the actual 5 V power supply by a pair of wires, either as a"figure 8" or ribbon, or at least keeping them tied together all the way.
Now you can run another similar pair of wires kept together, from the 5 V supply to the ESP. Then directly from the ESP to the relay module, you run the four "IN" wires plus the 5 V wire (not the 3.3 V) as another group kept together.
You need the 5 V wire and not the 3.3 V line so that you will pull the relay module input down with sufficient voltage to drive the green LED and optocoupler diode in series as shown in the PDF. Note where it says "It may be necessary to change the value of R1 from 1000 ohms to something like 220 ohms, or supply +5V to the VCC connection". Using 5 V is more sensible than trying to change resistors on the board.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.