In this project, we show how to use the ‘Plantmate DC 5V to 3.3V, 5V, 6.6-12.6V converter & Water Comparator Module’ to control a DC 12V water pump’s speed and ON/OFF with an Arduino UNO board.
Hardware:
- Plantmate DC 5V to 3.3V, 5V, 6.6-12.6V converter & Water Comparator Module’
- 12V DC water pump
- Jumper wires
- Mini-USB male connector (it comes with the Module)
- Arduino UNO board
Plantmate Converter & Water Comparator Module | 12V DC water pump | Jumper wires | Mini-USB male connector | Arduino UNO board |
Tools:
- Scissor
- Soldering iron
- Multimeter
Scissor | Soldering iron | Multimeter |
Software:
Arduino IDE V1.6.5 or later.
Download link: https://www.arduino.cc/en/software
Get Things Ready:
1. Solder the water pump wire to Mini-USB male connector. |
2. Connect the USB-C to a 5V power supply. Set multimeter on DC Voltage range Put the positive probe(red cable) on module pin 6, and the black cable(COM) on module pin1. Adjust the potentiometer on the module board to have 12V output on pin 6 to match the water pump voltage. 3. Disconnect the USB-C power supply. |
4. Connect the Jumper Cap on the 5V jumper pinhead while using a 5V MCU. |
5. Use the jumper wires to wire the Module and the Arduino UNO board. |
Use the Arduino USB cable to connect with your computer; Connect the water pump to the mini-USB adapter on the module board; Connect the USB-C to the power supply. Open the IDE program on your computer, make sure the Board and the Port on your IDE ->Tools drop-down menu are correct; Copy the codes below and upload them to your Arduino UNO. |
/* * DC 12V water pump with Plantmate DC 5V to 3.3V 5V 6.6-12.6V DC Converter & Water Comparator Module * and Arduino UNO PIN connection: * * 1. Pin 1 to UNO GND * 2. Pin 3 to UNO D3 * 3. Pin 5 to UNO 5V * 4. UNO 3.3V Pin to UNO AREF Pin (option) * */ // Upload the code below to your Arduino UNO #define control 3 // pin that controls the load int pwm = 0; // water pump speed inital. void setup() { pinMode(control,OUTPUT);// define control pin 3 as output Serial.begin(9600); } void loop() { pwm = 255; // speed = highest analogWrite(control,pwm); Serial.println("Water pump @ High speed"); delay(5000);// Wait for 5000 ms or 5 second analogWrite(control,0); // Turn of water pump delay(5000);// Wait for 5000 ms or 5 second pwm = 205; analogWrite(control,pwm); Serial.println("Water pump @ Medium speed"); delay(5000); analogWrite(control,0); delay(5000); pwm = 155; analogWrite(control,pwm); Serial.println("Water pump @ Low speed"); delay(5000); analogWrite(control,0); delay(5000); }
Your water pump should be running at high speed for 5 seconds and stop for 5 seconds and so on. On the right-top corner of your IDE, click the Serial Monitor. You will see something like this picture in your pop-up window. |
The END!