Honestly, I would have never imagined working on a family farm for rent my junior year of college. Among many other things, I figured I could create something to make my job easier - a water detection system aimed at sending notifications when water has been depleted. Pure water does not conduct electricity; however, the well water here has impurities and ions that do make the water conductive. Therefore, this project has been very straight forward and easy due to the incorporation of water into my electrical circuit. For the code, I just reversed what a water leak detector would do (detect water); I made it so a notification would be sent when no water was detected. As I am a noob with coding, I used Gustavo Gonnet's water detection system to reverse engineer my prototype. I only had to change a couple of code lines, so the alarm would trigger when no water was detected. His project can be found here.
Out of all the animals on the farm, I would say the chickens are the most labor intensive. They are loud, poop all the time, and have the tendency to hurt themselves. They also drink all their water in spurts, meaning they will not touch water until it is absolutely necessary. This leads to "KFC or bust" chickens during the heat of the summer (means they will die).
I needed a system to alert me when the waterer container was empty. Using electrodes, 1 plastic poultry waterer, and a photon particle board, I can send notifications to my phone when the water level drops below a certain amount. Please note for this to work, Wi-Fi must be present on the farm (satellite tends to do the trick).
The first step was to modify the container. I used two wood screws as my electrodes and drilled them into the container. One should be located at the bottom of the container and the other where the water level is nearly depleted. You can order actual zinc electrodes for about $15 a piece off amazon as metal screws will corrode over time. Attach two wires to the electrodes (the bottom one GND) and the container is ready to go.
For this part, I will assume you are a code noob like me. The Firmware is the coding part of the project. It involves signing up for a website, downloading a program, uploading code, and flashing your photon. So I guess I'm going to take my time on this.
Sign-up for PushbulletThe first step is to sign-up for pushbullet. Pushbullet is responsible for sending the notification to your mobile device. Sign in with a gmail account, allow access, and click sign-up your phone. Install the Pushbullet app on your mobile device from the app store. To your left click settings, scroll down till you see create access token key. Once the key is created, paste it into the code below where you see QWERTY (copy this to webhooks file). Protect this code as it is unique to you.
So, If all of that went as expected, you have your API token access key. The file below titled "copy this to webhooks" needs to be downloaded to your computer. Head here to access the particle console and click the integration console (looks like small spheres connected to a large sphere). Click new integration, webhook, and then custom JSON file. Copy and paste the information from the JSON file into the custom editor. Make sure your API token access key is pasted in the place of QWERTY. Click the save button to successfully upload the information to webhooks. Click test to receive a message on your phone through the pushbullet app.
Almost done! Now, if everything is entered in as above, the next step should be simple. Head to the build.particle.io site to enter the photon code. Make sure your photon is synced with build.particle.io. Name your project "chickenwater" and paste the code from "Particle Firmware" into the editor. It should look something like the picture below:
Next, click the libraries button. In the communities, library search elapsedMillis; click it and click include in app. After this you should be ready to go! Click code then select your project to head back. Hit verify to make sure the code is working properly and flash it to your device. It will flash magenta, blink blue for some time and then stay a solid blue. Wire the device in the schematic shown. When the container is empty, you should receive a message on your phone! You can change this message by editing lines 110 and 113 within the parentheses of "Chickens need water!" You will receive the message in increments of time until the waterer is filled. These notifications can be disabled via pushbullet or editing the code. The phone will alert you every 4 hours at maximum.
Here is a video proving I completed this project:
ConclusionOverall I enjoyed this project. At first I had planned on creating a complex project, but I actually created something that improved my overall quality of life (and the chicken's lives) . I am finding that as I continue with my degree it is easier to keep things simple rather than complicate things. Plus adapting farm technology is what we really need, not a glowy toilet robot.
The chickens jumping (for extra credit)
Comments
Please log in or sign up to comment.