Controlling a pump
As pumps tend to draw more current than simple sensors, we are not going to power the pump directly through a GPIO port. Drawing too much current could permanently damage the Arduino. So, we will use an external power supply and a relay to power the pump. Before we start assembling the circuit, let's have a brief look at how relays work.
Working with relays
A relay that is used for microcontroller projects typically comes mounted on a board, which typically has six ports. It has three input ports: VCC, GND, and Signal. It also has three output ports: normally open, common, and normally closed.
When a high signal is given, the current flows between normally open and common.
When a low signal is given, the current flows between normally closed and common.
As we now know how to use a relay, we can continue to add the new components to our circuit. To do so, follow these steps:
- Connect the GND pin from the relay to GND on the power bus using...