+21622886281
DC Motor Micro:bit

Control a water pump by the Micro:bit card

A Micro:bit is a small, programmable microcontroller that can be used to control various devices, including a water pump. To control a water pump using a Micro:bit, you would need to connect the water pump to the Micro:bit‘s output pins, and then write code that sends a signal to turn the pump on or off. This code can be written using the Micro:bit’s online coding editor, which supports several programming languages, including the Microsoft Blocks, JavaScript, and Python.

It is important to mention that the Micro:bit board does not have a lot of current and voltage to power a water pump, so you would need to use a relay or a transistor to switch the power of the water pump.

Purpose of tutorial:

In this tutorial, we will control a water pump by the Microbit card:

  • If we press button A , we start the water pump to fill a bottle

  • Pressing button B stops the water pump

Necessary components

Micro:bit card

A Micro:bit card is a small, programmable microcontroller board that is designed for use in educational settings. It is developed by the Micro:bit Educational Foundation and is used to teach students how to code and create interactive projects. The Micro:bit card is equipped with a number of features, including a 5×5 LED matrix, two programmable buttons, a built-in accelerometer and magnetometer, and the ability to connect to other devices via Bluetooth or a USB connection. It can be programmed using a variety of languages, including Microsoft Blocks, JavaScript, and Python. Micro:bit can be used in a wide range of projects, from simple games to more advanced projects such as robotics, IoT, and more.

12V water pump

A 12V water pump is a type of pump that runs on 12V DC power. These pumps are commonly used in a variety of applications such as irrigation systems, water fountains, and other small-scale water transfer applications.

12V water pumps are available in different types, including centrifugal, diaphragm, and gear pumps, and can be used in both freshwater and saltwater environments. They are also available in different flow rates and head pressure, which is the maximum height that the pump can lift water.

These pumps typically come with a built-in voltage regulator, which allows them to be powered by a 12V DC power source, such as a battery or a solar panel.

Relay

A relay is an electronic switch that can be used to control the power to a water pump using a Micro:bit. The Micro:bit can send a signal to the relay to turn the pump on or off, allowing you to control the water pump remotely or based on specific conditions.

To control a water pump using a relay and a Micro:bit, you would need to connect the relay to the Micro:bit‘s output pins and the water pump to the relay‘s normally open (NO) contacts. The Micro:bit would then send a signal to the relay to close the contacts and turn on the water pump.

When using a relay with a Micro:bit to control a water pump, it’s important to use a relay rated for the voltage and current of the water pump. Also, use a diode across the relay coil to protect the Micro:bit from voltage spikes caused by the relay.

GPIO expansion board

A GPIO (General Purpose Input/Output) expansion board is a device that can be connected to a microcontroller board, such as a Micro:bit, to provide additional input and output pins. This allows the microcontroller to interact with a larger number of external devices and sensors, such as LEDs, buttons, and motors.

GPIO expansion boards typically connect to the microcontroller board using a standard interface, such as I2C or SPI, and are controlled using the microcontroller’s firmware and libraries. Some expansion boards include additional features such as built-in level shifters, voltage regulators, and protection circuits to ensure safe and stable operation.

Battery of 9V

A 9V battery is a type of primary (non-rechargeable) battery that provides a nominal voltage of 9 volts. It is commonly used in portable devices such as smoke detectors, remote controls, and small electronic toys. 9V batteries are also used in some low-power projects such as small robots and simple electronic circuits.

Test plate

A test plate for Arduino is a type of test plate that can be used in conjunction with an Arduino microcontroller to automate experiments or tests. The test plate typically contains multiple wells or compartments that can hold samples or test solutions, and is designed to interface with the Arduino’s digital inputs and outputs.

Connecting wires

Wires in a robotic system are used to connect and transmit electrical signals between different components of the robot. These components can include sensors, actuators, motors, and the microcontroller, such as an Arduino. The wires in a robotic system are typically made of copper and are insulated to prevent electrical interference and short circuits.

The type of wires used in a robotic system depends on the specific application and requirements of the robot. For example, a robot that requires high-current power transmission may use thicker, high-gauge wires, while a robot that requires a high degree of flexibility and movement may use thinner, more flexible wires.

Mounting the Microbit board with the water pump:

The relay is the intermediate component between the Micro:bit board and the water pump. It allows the Micro:bit board to control the water pump.

The role of the relay is to start or stop the pump responsible for filling the bottles.

  • We connect the (-) terminal of the relay to the GND pin of the Micro:bit

  • We connect the (+) terminal of the relay to the 3.3V pin of the Micro:bit

  • We connect the terminal (S) of the relay to the pin P5 of the Micro:bit

Makecode program:

Here is the makecode program which allows to control the water pump by the Micro:bit card.




2 commentaires

zameer 05-09-2222

what type of pump did you use? can i get the details of the pump?

Med Ali 05-09-2222

12v water pump


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top