Introduction: SmartAquarium - Mathias
A big problem for people that have fish is than when they go on vacation they need somebody to take care of them. Me and my family have the same problem and it's always a hustle to find somebody. Now with my project I hope to get rid of this problem with my SmartAquarium.
- average cost is around 313 euro
- total amount of time spend on making everything about the project: 250 hours (tthis can vary depending on your programming skills)
- My personal website: mathiasdeherdt.be
- Bill of material aka BOM: FinalBOM.xlsx
Step 1: Step 1: Making the Casing + Automatic Feeder
- Wood and super glue
- Plastic cup
- door knob
- Iron handle
- Chicken wire
- Drilling machine
- Wood file
Building casing step by step:
- Step 1: saw the wood to your desired size. You want 2 planks for the top and bottom, 2 for left and right side and 2 for the back and front. Once you have everything go ahead glue them together (with wood glue) so the form a box. Make sure there is a lot of pressure on the wood so everything can glue together.
- Step 2: make sure you leave holes for the cables and for airholes. It doesn't really matter where they are, just put them where you seem fit
- Step 3: After you made your holes, take a woodfile and file everything so it is smooth
- Step 4: glue the handle on top of your casing and glue the doorknob on the side that can be opened and closed. Also connect the door with the hinges and put magnetics so the door stays closed
Building the feeder step by step:
- Step 1: Find a not so large plastic bowl and make a tiny hole in it, make sure the lid of the bowl can be removed very easy
- Step 2: Find something to make compartiments inside and connect them to a wooden stick
- Step 3: Make sure the wooden stick is bigger than the rotating iron of the stepper motor, we are gonna make a hole there so the stepper motor moves everything inside.
- Step 4: Make something that can place the feeder above the hole in your aquarium, i made it with some sort of building toys
Step 2: Step 2: Connect Your Components
Components (you can always reference my BOM):
- Raspberry Pi with power supple
- Arduino type A to B
- Waterproof ds18b20
- QAPASS 1602A display
- Step motor 28BYJ-48
- Male to male wires, male to female wires
- PH sensor 40x40 mm
- Force sensitive resistor (FSR)
- 2 potentiometric sensor
- LM2596S DC-DC
- Soldering iron
- Stripping pliers
- Heat shrink tubing
- Hot air blower
So where to start? Well first you are gonna need to get every component, after that try and follow my schematic to the best of your ability.
The Pi is the most important piece of the puzzle, it is going to act like a hub that controls everything, even the Arduino. The Arduino will be the slave of the Pi but more of that later in Step 3.
Most of the schematic is straight forward, connect everything and make sure the grounds are connected good. The hard part is your lamp. We are gonna have to break the switch open and connect it to a relay, if we mess this up you can destroy the lamp. Once the switch is open, connect 2 wires to the wires of the lamp. Connect those to the relay [PICTURE]
Also an important message, use the Heat shrink tubing when cables are exposed so they don't interfere with one another.
Step 3: Step 3: Make Database
First you want to make a model for your database, mine will look like this [Picture 1], I have two tabels, one for my sensor and one for my measurement.
In the sensor table you will need an ID, Name(of the sensor) and an unit. In the measurement table I have my sensor_ID (from my sensor table), a time for when you took a measurement and the value of your measurement. We also need another table for the light, this is so we can toggle it on and off by the website and have the current status be on display.
After you have created the database you are going to put it on the Raspberry Pi.
Step 4: Step 4: Write Python Code & Arduino Code
Now it's time for the real work, writing code for everything. Inside the zip file you will find my (not so good) code. There is information put in comment line.
For the backend you will only need the app.py file.
For the frontend you will need the Templates and static
As i said in Step 2 the Arduino is a slave of the Raspberry Pi. We do this so we can connect the Arduino to the Pi with a usb cable and making a few edits and installing a few things. First of all you are going to install nanpy on the Pi.
The design of the website is also a very important part of the project, it is a way to check on things like the temperature and to give food automatically.
I chose to make rectangles where inside i display my values.
Also there is a cool feature where you can see a graph of all the data from the temperature and PH sensor.
Step 6: Step 6: Assembling the Project
Once all the other steps are completed you can start assembling everything together. All your components are going inside the wooden box you made. We attach everything on the wall by using velcro and placing everything in the right place and still making sure everything is connected properly.