ESP32, Relay Module, and 5V DC Pump configuration

Hello guys, sorry to the ugly diagram. I am playing around the 5v DC water pump and a relay module. I plugged the components like in the diagram and uploaded the code to test the components. After uploading the code to the esp32, it shows errors once in a while which sometimes messes the esp32. I don't have a power module at the time so i have to use the 5v of the Arduino Uno. Also the 5Vin of the esp32 that I have doesn't output any voltage hence i just used the 3.3v of the esp32. I tried to use the components on their own and it works fine, but once i put them all together, like in the diagram, it shows weird behavior. code of the esp32:
c++
#define RELAY_PIN 10

void setup() {
Serial.begin(115200);
pinMode(RELAY_PIN, OUTPUT);
}

void loop() {
digitalWrite(RELAY_PIN, HIGH);
Serial.println("ON");
delay(5000);
digitalWrite(RELAY_PIN, LOW);
Serial.println("OFF");
delay(5000);
}
c++
#define RELAY_PIN 10

void setup() {
Serial.begin(115200);
pinMode(RELAY_PIN, OUTPUT);
}

void loop() {
digitalWrite(RELAY_PIN, HIGH);
Serial.println("ON");
delay(5000);
digitalWrite(RELAY_PIN, LOW);
Serial.println("OFF");
delay(5000);
}
errors that showed in the serial monitor:
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x29 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037bef8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x116c
load:0x403c8700,len:0xc2c
load:0x403cb700,len:0x3108
entry 0x403c88b8
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x29 (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037bef8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce2820,len:0x116c
load:0x403c8700,len:0xc2c
load:0x403cb700,len:0x3108
entry 0x403c88b8
No description
5 Replies
Maverick
Maverick19h ago
You will need a separate power supply for the relay and pump. The relay should not be connected to the 3.3v pin. I also wouldn't connect both the relay and the pump to the 5v pin of the Arduino board. So, you need a different option to provide 5v to both the relay and pump.
Scooby-Doo
Scooby-DooOP19h ago
Like that sir? ps. I am bad at lines. sorry for this
No description
Maverick
Maverick19h ago
I would use a different power supply, not an Arduino board.
Scooby-Doo
Scooby-DooOP19h ago
ok sir, thank you for the insight. I will try a different power module. But would the configuration would be the same to the updated diagram? Also, what would be the difference if I used a different power source compared to the 5v of the arduino? Will if fix the crashes of the esp32?
Maverick
Maverick19h ago
Not powering the relay from the 3.3v pin might help with any issues you're having with the ESP32. The difference between using a different power source compared to the 5v of the Arduino would be the ability to reliably handle the current draw and the longevity of the power supply.

Did you find this page helpful?