The Arduino restarts when the motor, pump or relay switches on
- Arduino
- ESP32
- Motors
- Pumps
- Relays
Why it happens
- The motor shares the Arduino's 5 V.
- The battery is weak. Small 9 V batteries can't drive motors.
- No diode across the motor or relay coil.
How to fix it
- Give the motor its own battery or adapter.
- Join the grounds.
- Put a 1N4007 diode across the motor or coil, stripe to the positive side (relay modules have one built in).
- Use AA cells or a rechargeable pack, not a 9 V block.
It worked if: Switch the motor ten times: the Arduino doesn't restart.
Related errors
Tutorials where it can happen
- Air Quality and HVAC Control with Arduino, DHT11 and MQ-135
- Arduino Greenhouse: Temperature and Humidity Control with LCD
- Automated Plant Watering System with LCD Feedback
- Automatic Blinds Control Based On Light Intensity
- Automatic Pet Feeder with Arduino and Servo
- Automatic Plant Grow Light with Arduino and Relay
32 more
- Building a Smart Plant Watering System with Soil Moisture Sensor
- Building an Automated Plant Watering System using ESP32
- Capacitive Touch Sensor-Based Home Automation System with LCD Display
- CO Sensor-Based Ventilation Control System with LCD Output
- Creating a Touchless Hand Sanitizer Dispenser with LCD Display
- Distance Measurement and Stepper Motor Control with LCD Output
- ESP8266 NodeMCU Relay: Control AC Appliances
- Gas Leakage Detection and Solenoid Valve Control with Arduino
- Gas Sensor-Based Air Freshener System with LCD Display
- Home Hydroponics System with Arduino
- How to use the BLE on the ESP32?
- Human Presence Detection and Lighting Control with LCD Output
- Light Sensitive Blinds Control System with LCD Output
- Light-Sensitive Motorized Blinds with Arduino and LCD
- Line Following Robot with LCD Display
- Liquid Level Detection and Pump Control
- Motor Speed Control Based on Temperature with LCD Output
- Obstacle Avoiding Robot Car with Arduino and LCD
- Obstacle-Avoiding Robot Arm with Arduino and LCD
- Plant Monitoring System with Arduino: Soil Moisture and DHT22
- Put Your Web Page on a Real ESP32
- Raindrop Detection and Automatic Wiper Control with LCD Output
- Rainwater Harvesting and Recharge: a Project for Kids
- Smart Plant Pot with ESP32 (IoT)
- Smoke Detection and Exhaust Fan Control with LCD Display
- Smoke Detection and Fire Sprinkler Control with LCD Display
- Soil Moisture Monitoring and Irrigation System with Arduino Uno
- Soil Moisture-Based Plant Watering System with LCD Feedback
- Temperature-Controlled Fan with Arduino and LM35
- Water Level Monitoring and Fish Tank Pump Control with Arduino
- Water Level Monitoring and Pump Control System with Arduino
- Water Level Monitoring and Solar Water Heater Control
From how the part works. Explained from how the part works; not tried on a real circuit for this page.
Didn't help? Search another error or ask us.

