Code written for arduino uno to control a pump in a self watering plant system.
List of materials needed:
- 1x Arduino Uno
- 1x Soil moisture sensor
- 1x USB pump
- 2x USB type A Female adapter
- 1x NPN Transistor (To act as relay to deliver 5V to the pump with sufficient current)
- 2x 47Ohm Resistor
- 1x 1N4001 One-way current diode
- A few wires
Steps:
- Upload code into Arduino Uno
- Set up according to circuit diagram.
#Code uses polling method.