Introduction: Water Saver Project
Authors: Monique Castillo, Carolina Salinas
We were tasked with designing a project with the purpose of contributing to sustainability. We decided, being native Californians who feel like they are constantly in a drought, to create a Water Saver specifically related to sprinkler systems. As we know most water systems are set on automatic timers which tend to be very archaic in the fact that they are either on or off, with no gauge if anything actually needs water or not. On the rare occasion that we do get rain and everything is properly saturated, sprinklers still go off. It is because of this we have built a prototype system that will notify you to turn off the sprinkler system when it reaches the predetermined moisture level avoiding wasting water.
So, today we are going to show you how to make your own water saver so you can help do your part with water conservation all while having fun creating it!
Step 1: Hardware
What you will need to get started:
- Diligent Basys 3 FPGA Board
- Arduino UNO board
- Soil Moisture Sensor
- Bread Board
- A green LED
- A red LED
- Micro USB for Basys 3 Board
- USB Type A/B for Arduino
- (2) 330 ohm resistors
Access to Vivado which can be downloaded from XILINX's website:
And access to the Arduino IDE which can be downloaded from Arduino's website:
And finally a positive attitude :)
Step 2: Designing the Program
Firstly you are going to need to understand what you are going to use for the program from start to finish (and everything in between). So we created a Black Box Diagram - this will help you in visualizing the steps and what it will take to create the project.
Step 3: Arduino
Doing each file one by one is essential in debugging and seeing if you have any errors so, we will start with the code for the Arduino. The Arduino code here is used to collect the sensor data and translate the analog data to digital.
Step 4: More Code Yay!!!!!!
Next we implemented the D Flip-Flop.
The D Flip-Flop for our purposes served to filter the Arduino data to our system.
Once you verify that it is synthesizes, then you can move on to the next part.
The SSEG display base code was provided to us by our generous leader, Professor Danowitz, with minor edits to fit our needs. We also used the clock divider module given to us by Professor Danowitz to multiplex the display.
And once again make sure this synthesis goes off without a hitch, because you are about to put it all together.
Step 5: You Put It All Together and Pray That It Synthesizes (AKA Create Your Master File)
Finally you will use all the separate files and put them together. This is the last but could be the most arguably frustrating step, assuming it does not synthesize. It is always fun to troubleshoot what happened. That is why it is important that you do each file step-by-step to ensure (well, most of the time) that it runs.
The master file connects all the sub-files together.
Step 6: Setting Up Your Hardware AND Constraints
We assigned our switches, outputs and inputs (also known as your constraints) for aesthetic, organization, and flow purposes, and you can also play around with moving these around as well. The constraints file determines how we physically connect the wires.
The bread board and LED wiring were done as so, instead of posting a tedious step-by-step guide here is a picture and a reference guide which assisted in the setting up our bread board - from the Arduino tutorial website.
and this picture was used by
Step 7: Running the Program!
Now is the time to run everything and test for errors. If it does not run, go through each of your files and make sure that your assignment names match. We make this mistake more then we would like to admit, but syntax is very important.
We set our threshold at 550, and you can play around with this as well.