WiFi Module
We use the ESP8266 to receive data from the database, however we can not control the output pins of the Arduino through the ESP8266. Instead, we use serial communication to tell the arduino what to output.
Water Pumps
The pumps connect to a 5V relay which receives inputs from a digital pin on the Arduino. When the Arduino receives a command from the ESP8266 telling it to turn on watering, the digital pin for the corresponding water pump will turn on causing the relay to send power to the pump.
Light System
The LED strips are controlled by the Adafruit Neopixel library allowing us to set the color of the individual lights. When we receive a command from the app the ESP8266 writes to the arduino and the arduino utilizes the library to turn the lights on.
Water Sensor
The water sensor connects directly from the tank to the ESP8266. This will prohibit any watering commands to be sent when the tank is empty. We also update the database when the water sensors senses no water in the tank.
Electrical Set Up