Automatic Sprayer
Created By Anthony Brogni
This GitHub page is for my Automatic Sprayer project. I originally made a prototype of this project in 2017 but was not completely satisfied with the results, so I decided to go back and improve it. I have been continuously improving my Automatic Sprayer project over the past four years. This project is an Arduino-controlled automatic sprayer that can keep plants and pets hydrated while you’re away from home. When you first plug it in, you are prompted to configure the system, and then after that, you’re good to go! Some features of this project are spray scheduling and spray duration control, a visual countdown clock to the next spray, and a manual spray button. Another notable feature that I recently added is Wifi connectivity so that the project can connect to the user’s home Wifi network. This Wifi connectivity allows the project to connect to the Adafruit IO web service for control over wifi. As long as I am connected to the internet, I can use my phone to trigger the sprayer and monitor the current status of the sprayer from anywhere in the world. I can even view an estimate of how many sprays are left before the sprayer will need to be refilled! Using the IFTTT service, I have also connected this project to the Amazon Alexa voice service, allowing me to trigger sprays by giving a voice command to my Alexa-enabled devices. As you can see, there are many ways that my Automatic Sprayer project can be controlled and monitored, which makes it easy and convenient to use for everyone!
Code
All of the code for this project is contained in a single .ino script that is run by an Arduino Mega 2560.
The main functions of the code are to:
- Connect to my home wifi network
- Connect to the Adafruit IO service to allow for commands to be sent and received over Wifi
- Allow the user to configure system settings such as the interval between sprays and the spray duration using the touch screen
- Keep track of the time remaining until the next spray and display it to the user on the touch screen
- Keep track of how many sprays are remaining until the sprayer needs to be refilled and display this to the user
- Allow the user to manually initiate a spray whenever they want via a digital button on the touch screen
The code for this project utilizes the Elegoo_GFX, Elegoo_TFTLCD, Touchscreen, WiFi101, and Adafruit_MQTT libraries, all of which can be found here in the project repository. The SPI library is also used, which is included in the Arduino IDE by default.

Electronics
The electronic components used in this project are:
- Arduino MEGA 2560 REV3
- ELEGOO 2.8 Inch TFT LCD Touch Screen
- L298N Motor Driver Board
- 3.3v/5v Power Supply Module
- Motorized Spray Bottle
- ELEGOO 9V 1A Barrel Plug Power Adapter
- DC Barrel Plug Splitter
- Flexible Breadboard Jumper Wires
- Adafruit ATWINC1500 WiFi Breakout Board
3D Printed Parts
For this project, I designed a 3D-printed stand for the sprayer that also houses the electronics inside it to keep everything compact.
CAD Program Used: Fusion 360
Slicer Program Used: Ultimaker Cura
3D Printer Used: Ender 5 Pro
Filament Used: Black PLA
All of the STL and sliced G-Code files can be found here in the project repository.