Arduino MKR WiFi 1010 - Control Pump

Learn to control 12V water pumps with your Arduino MKR WiFi 1010! Master relay-based pump switching to build automated watering systems, aquarium controllers, cocktail makers, and fluid management projects. This fundamental tutorial teaches safe high-power pump control—essential for any liquid-handling automation.

What You'll Learn:

Real-World Applications:

Arduino MKR WiFi 1010 Pump

Safety Note: Always use submersible pumps rated for your liquid (water pumps for water only!). Never run pumps dry—they require liquid for cooling and lubrication.

Tutorial Scope: This guide covers basic ON/OFF timing. For advanced sensor-triggered pumping (moisture-based watering, level-controlled filling), see our project tutorials listed at the end.

Hardware Preparation

1×Arduino MKR WiFi 1010
1×Micro USB Cable
1×Relay
1×12V Pump
1×Vinyl Tube
1×12V Power Adapter
1×Breadboard
1×Jumper Wires
1×Optionally, DC Power Jack

Or you can buy the following kits:

1×DIYables Sensor Kit (30 sensors/displays)
1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of 12V Submersible Pumps

12V DC submersible pumps are compact, low-voltage water pumps designed for Arduino projects. Understanding their specifications ensures reliable operation and proper power system design.

Pump Pinout and Specifications

Arduino MKR WiFi 1010 Pump Pinout
image source: diyables.io

Electrical Connections:

  • Red wire (+) - Positive terminal:
    • Connects to +12V of DC power supply
    • Polarity-sensitive—reversing damages internal electronics!
  • Black wire (-) - Negative terminal:
    • Connects to GND (ground) of DC power supply
    • Completes circuit for motor operation

    Key Specifications (check your pump's label/datasheet):

    • Voltage: Typically 12V DC (operating range: 9-13.5V)
    • Current draw: 0.5-2A depending on pump size and load
    • Flow rate: 2-6 liters/minute (L/min) or 120-360 L/hour
    • Max head height: 1-3 meters (vertical pumping capability)
    • Power consumption: 6-24W typical
    • Duty cycle: Some pumps require rest periods (check specs!)

    Important Notes:

    • Submersible design: Must be submerged in liquid for cooling—running dry damages seals and motor
    • Water only: Use water-rated pumps for water; chemical pumps for other liquids
    • Inlet filter: Keep inlet screen clean to maintain flow rate and prevent clogging
    • Priming: Some pumps need priming (filling tubing before operation) to start pumping

    How to Control Pump with Arduino MKR WiFi 1010

    Direct Power Operation: Connect 12V power supply directly to pump → Pump runs continuously at full speed.

    Arduino-Controlled Operation: We need a relay as an electronic switch.

    Why Relay Control is Necessary:

    1. Voltage incompatibility: Pump requires 12V; Arduino pins output only 3.3V
    2. Current demand: Pumps draw 0.5-2A; Arduino pins supply maximum 15mA
    3. Electrical isolation: Keeps high-power pump circuit separate from Arduino logic

    Direct connection would:

    • Fail to start the pump (insufficient voltage)
    • Overload and destroy the Arduino pin (excessive current)
    • Risk damaging the entire Arduino board

    The Relay Solution:

    The relay acts as an electrically-isolated switch controlled by low-power Arduino signals:

    • Arduino sends LOW signal → Relay coil deactivated → Relay contacts open → Pump OFF (no 12V connection)
    • Arduino sends HIGH signal → Relay coil activated → Relay contacts close → Pump ON (12V applied to pump)

    Control Circuit:

    • Low-power side: Arduino pin → Relay coil (3.3V, ~50mA)
    • High-power side: 12V supply → Relay switch → Pump (12V, 0.5-2A)

    Relay Selection: Choose relay rated for at least:

    • Coil voltage: 5V or 12V compatible with your Arduino setup
    • Contact rating: Minimum 10A @ 12V DC (safety margin above pump current)
    • Example: SRD-05VDC-SL-C relay (10A contact rating) works perfectly

    Not Familiar with Relays? Our Arduino MKR WiFi 1010 - Relay tutorial provides comprehensive coverage:

    • Relay pinout and electromagnetic operation principles
    • How coils control switch contacts
    • Wiring diagrams for NO (Normally Open) and NC (Normally Closed) configurations
    • Programming relay control with digitalWrite()
    • Selecting appropriate relay ratings
    • Troubleshooting common relay issues

    Master those concepts first, then return here to apply them to pump control!

Wiring Diagram between Arduino MKR WiFi 1010, Relay and Pump

The wiring diagram between Arduino MKR WiFi 1010 Pump

This image is created using Fritzing. Click to enlarge image

Arduino MKR WiFi 1010 - Pump Code

The code below turns the pump on and off every 4 seconds.

/* * This Arduino MKR WiFi 1010 code was developed by newbiely.com * * This Arduino MKR WiFi 1010 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-mkr/arduino-mkr-wifi-1010-controls-pump */ // constants won't change const int RELAY_PIN = 3; // the Arduino pin, which connects to the IN pin of relay // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin D3 as an output. pinMode(RELAY_PIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(RELAY_PIN, HIGH); // turn on pump 5 seconds delay(5000); digitalWrite(RELAY_PIN, LOW); // turn off pump 5 seconds delay(5000); }

Detailed Instructions

New to Arduino MKR WiFi 1010? Complete our Getting Started with Arduino MKR WiFi 1010 tutorial first to set up your development environment.

  • Connect the components to the Arduino MKR WiFi 1010 board as depicted in the diagram
  • Plug your Arduino MKR WiFi 1010 into your computer's USB port
  • Launch the Arduino IDE on your computer
  • Select the Arduino MKR WiFi 1010 board and its COM port
  • Copy the above code and paste it into the Arduino IDE.
  • Compile and upload the code to the Arduino MKR WiFi 1010 board by clicking the Upload button in the Arduino IDE.
  • Check the pump’s status.

Line-by-line Code Explanation

The Arduino MKR WiFi 1010 code above explains each line. Please read the comments in the code!

Video Tutorial

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!