I'm making smart farm where i'm using
Ldr to control led
Dht11 to control 5v fan
And water level to control pump
And iam using relay module 5v to control the pump
But when the relay works it flickers resting the whole system
And when i disconnect the relay everything works fine
Welcome to the forum
Please post a schematic of your circuit showing the components used, how they are interconnected and powered
A 'photo of a hand drawn circuit is good enough
To post images etc. you need trust level 1, you can get there by:
Entering at least 5 topics
Reading at least 30 posts
Spend a total of 10 minutes reading posts
Users at trust level 1 can...
Use all core Discourse functions; all new user restrictions are removed
Send PMs
Upload images and attachments
If it is a DC motor, add a kick back, free wheel diode across the motor.
jim-p
January 24, 2026, 10:17am
4
Have a look at this forum topic, it sounds similar to what you are doing with a solution to your problem
I have my arduino connected to a water pump that connects with a 4 aa battery case, and a water moisture sensor that is connected to a relay, which finally connects to my arduino uno. The program runs just fine when I only have the water moisture sensor connected, but when I connect the water pump to it, the program stops running. Does anyone know how I can fix this? ( The code here:)
void setup() {
pinMode(5,OUTPUT);
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
…
2 Likes
horace
January 24, 2026, 1:47pm
5
give links to the specific modules you are using?
what voltage/current is the pump?
relays used with arduino type dev boards are typically rated 250volt/10amp resistive load - when controlling an inductive load such as a squirrel cage motor reduce the rating to 2 to 3amps
e.g. recently controlling a Jabsco_28520_pump I used a ESP32 driving a 3.3V relay which switched a Contactor, LC1D, 12 A, DIN Rail, 230 VAC, 3PNO, 3 Pole, 5.5 kW to control the pump
I find it good idea to use screened cable to connect the microcontroller relays to the contactor/pump
jim-p
January 24, 2026, 2:41pm
7
See post #4 on how to fix the problem.