Smart Fermentation Tank (Beer)

by jensverbrugghe in Circuits > Raspberry Pi

336 Views, 4 Favorites, 0 Comments

Smart Fermentation Tank (Beer)

IMG_7083-removebg-preview.png
IMG_7085.jpg
IMG_7083.jpg
IMG_7084.jpg
IMG_7086.jpg

I really enjoyed drinking beer this year, and when the final months of the end of the schoolyear came nearby, and I had to chose a subject for my Project-One, I immediately followed my heart and chose for a Smart Fermentation Tank, so I could finally brew my own beer in the vacation.

All jokes aside, I really wanted to brew my own beer but when I looked at the prices some companies ask for fermentation tanks I just fell over, this motivated me to create a cheaper alternative for beginners.

The smart fermentation tank is full of sensors, so you can follow up the brewing process, and set a certain temperature you want the tank to be at when you are in the fermentation process. The tank also has a tilt sensor, to let you know when the tank isn't standing straight up. The LDR and the DHT22 module will show you data like the light percentage, the temperature and the moist level of the air around the tank, so you will know where to put the tank in your environment for a more efficient process.


This project contains HTML, CSS, JavaScript, Python and SQL.

Supplies

The total cost of the project will be 332.40 euros, but if you already have the main components like the pi, jumper wires, some sensors and a fermentation bucket, the price could drop down by a huge number.


All the needed components are listed in the Bill Of Materials that I attached below.


IMPORTANT: I wrote the bill of materials thinking that you have access to the following tools:

  1. Screws (2.5 mm - 4mm)
  2. Flat top screwdriver
  3. Cross slot screwdriver
  4. Wire stripper
  5. Luster terminal block
  6. Some superglue
  7. Clams for tubing
  8. Zipties

Buying Materials

Buy all the needed things on the Bill Of Materials


Note: Some things could be unavailable, but don't worry, there are a lot of alternatives out there for you to buy.


IMPORTANT: Please check if you already have some components at home, for example the Raspberry Pi, this could save you a lot of money!

Creating the Actual Frame

IMG_7060.jpg
IMG_7071.jpg
IMG_7072.jpg

You need a frame/case to put in all those electrical components into. I put the download links in the attachments.

3D printed

  1. box_final.3mf
  2. componenten_sensoren.3mf

Lasercut (6mm wood plate)

  1. plaat_beneden_final.3mf
  2. plaat_boven_final.3mf


I also printed some 3D models I fount on makerworld, for the load cells on the HX711

https://makerworld.com/en/models/1186234-loadcell-holder?from=search


[file plaat_boven_final.3mf hier]

[file load_cell_holder.3mf hier]

[file componenten_sensoren.3mf hier]


Note: You still need to convert the plaat_boven_final and plaat_onder_final to a lasercut file, because for some reason I could not do it anymore with the editing program I chose (autodesk fusion)


The bucket that comes with the other parts needs to be modified in order for the circulation to work, you do this by inserting the tubing with the biggest diameter (8mm) in a coil position, if you do this you should be left at the top with 2 parts of the tube:

[foto hier]

Mark the 2 spots where you want the tubing to come out of the lid and drill some holes so you can push the tubing trough the hole, make sure the holes are made airtight!


Once you have put all the electronical components in their place (the following step) you can also put tubing from the Peltier-element to the water pump, the water pump to the bucket, and the bucket to the Peltier again. For these steps you will need to use the 4mm to 8mm connector bits that I mentioned in the bill of materials. You can fasten the tubing together to make the circuit waterproof by using zipties.

[foto hier]


IMPORTANT: For the 3D printing part, I uses my own P1S printer from Bambulab, so make sure your printer can print in the same measurements as mine did. (25.5cm * 25,5cm * 25.5cm),

the same goes for the lasercutting, I used a lasercutter that cuts 40*40 cm.


IMPORTANT: There are some spaces reserved for specific components, i will mention them below.


Space for LCD:

[foto hier]


Space for Peltier-element:

[foto hier]


Space for waterpump:

[foto hier]


Holes for LDR and DHT22:

[foto hier]

Assembly of Electrical Components

Once everything has arrives, you need to assemble the components on a breadboard. Use this Fritzing scheme to assemble everything. Orange = 3,3V, Red = 5V, Black = GND


Note: The external power supply is not that visible, or it may not be so clear, this is because I couldn't find a good model for it. It is 12V 10A.


You will need to solder some components to extend the cable range to your breadboard, don't worry it is really easy, here are the components that I soldered:

  1. LDR
  2. HX711
  3. Waterpump


The HX711 component is a really hard one to set up and connect to the circuit, at least, that was my experience. If you can't really get it to work I will link a more clear scheme and a video for you to watch, these made it more clear to me.

[foto hier]

https://www.youtube.com/watch?v=LIuf2egMioA


The following components should be going out of the front hole of the 3D printed frame:

  1. HX711 loadcells (the square looking cells)
  2. MPU6050 (tilt sensor)
  3. DS18B20 (temperature sensor)


The MPU6050 should be mounted on the top of the upper wooden plate, you can choose where, the loadcells must be mounted in the circle part of the lower plate using the covers that I provided, and the temperature sensor will need to be inserted into the lid of the bucket, you do this by drilling a hole in it, make sure it is airtight!


To connect the external power supply to the components that need it, you will have to cut of the tip and strip the cable a little bit, once you do that you will be left with a red and black wire, put the cables in a luster terminal.

Solder the cables for the GNDs and the VCC of all the Mosfets and H-bridges together, so you will be left with 3 GNDs cables soldered together, and 3 VCC cables together. Now you will have to put these cables on the other side of the luster terminal.

Setting Up Your Pi

To really begin the fun part now, you first need to set up your Raspberry Pi, if you don't know how to do the basic installment, you don't have to worry! I have linked a video tutorial below.

https://www.youtube.com/watch?v=jLff_K39qL4


IMPORTANT: Make sure to set up Raspberry Pi connect in the Raspberry Pi Imager, so you can connect to your Pi and manage it easily. I've linked a guide to do this below.

https://www.raspberrypi.com/news/a-new-raspberry-pi-imager/


Once you have installed the basic Raspberry Pi OS, you can begin installing the apps needed to begin coding.


Requirements

  1. MariaDB
  2. Python3
  3. Apache2


If you have installed these programs, you can now setup an SSH connection to your Pi via the Raspberry Pi connect, well done!

Importing the Database

[foto hier]


Install MySQL Workbench if you haven't already, the download should be really easy. I will link the download link below.

https://dev.mysql.com/downloads/workbench/


Once you have installed the MySQL Workbench, you will be met with this homescreen

[foto hier]


To add a database connection, you will need to click on the + icon, it is right next to "MySQL Connections". If you did this you will be met with this screen. It is verry important that you exactly copy what I did.

Note: change the SSH Hostname IP to the IP of your Pi, also change the SSH Username to the username you picked when you set up your Pi.

[foto hier]


After that, you double-click the connection you just made and insert this code into the query section:


create database if not exists db_vergistingsvat_v3;
use db_vergistingsvat_v3;

create table tbl_sessie (
id int auto_increment primary key,
bier_naam varchar(100) not null,
start_datum datetime default current_timestamp not null,
eind_datum datetime null,
status_sessie tinyint default 1 not null
);

create table tbl_apparaat (
id int auto_increment primary key,
naam varchar(100) not null,
hardware_adres varchar(50) not null,
is_sensor boolean not null
);

create table tbl_sensor_kanaal (
id int auto_increment primary key,
apparaat_id int not null,
naam_kanaal varchar(100) not null,
eenheid varchar(20) not null,
foreign key (apparaat_id) references tbl_apparaat(id) on delete cascade
);

create table tbl_meting (
id int auto_increment primary key,
sessie_id int not null,
kanaal_id int not null,
waarde decimal(5,2) not null,
timestamp datetime default current_timestamp not null,
foreign key (sessie_id) references tbl_sessie(id) on delete cascade,
foreign key (kanaal_id) references tbl_sensor_kanaal(id) on delete cascade,
index idx_meting_timestamp (timestamp),
index idx_meting_kanaal (kanaal_id)
);

create table tbl_actielog (
id int auto_increment primary key,
sessie_id int not null,
apparaat_id int not null,
status_actuator tinyint not null,
waarde_num int null,
commentaar varchar(255) null,
timestamp datetime default current_timestamp not null,
foreign key (sessie_id) references tbl_sessie(id) on delete cascade,
foreign key (apparaat_id) references tbl_apparaat(id) on delete cascade,
index idx_actielog_timestamp (timestamp)
);

create table tbl_configuratie (
id int auto_increment primary key,
setting_key varchar(100) not null,
setting_value varchar(100) not null,
beschrijving varchar(255) not null,
constraint uk_setting_key unique (setting_key)
);

To run the query you need to click on the lightning bolt located on the upper side of the screen.

[foto hier]


Once you completed all these steps, you are all set!

Downloading and Using VSCODE

For this step you will need to download Visual Studio Code, I will link to it below

https://code.visualstudio.com/download


Once you have downloaded VSCode, you will need to install the following extensions:

  1. Remote SSH
  2. Live server
  3. Prettier


The most important extension is Remote SSH, once installed, you can set up a connection.

You can do this by clicking the small >< icon on the left bottom side of the screen.

[foto hier]


On the top of the screen, a menu will open. You need to press "+ Add New SSH Host", after that, fill in the IP address of your Pi. Finally, chose an SSH config file you want to keep the SSH connection in.

[foto hier]


To connect to the Raspberry Pi, you need to repeat the previous steps, but instead of add a new SSH host, you will now see the SSH connection. Click on it to connect.



Cloning the Git Repository

To access the website I have already programmed, you need to clone my Github repository, to do this, simply just click on the clone repository and insert my repository link.

https://github.com/howest-mct/2025-2026-projectone-mct-jensverbrugghe.git


The first thing you will need to do before running my code is create a virtual environment, you can do this by opening up a terminal screen and running this code:

python -m venv venv_fswd

After you have started a virtual environment, you will need to install the requirements, you can do this by running this code in the terminal:

pip install -r ./requirements.txt


IMPORTANT: In order to make your database connection work, you will need to update the config.py file and fill in the settings with the settings of your database.

Running App.py

If you have followed these steps, and everything has worked so far, good job. If something has failed, be sure to try again.


It is time to run the code, open app.py and click on run, the virtual environment will start the back-end and front-end of the page.

You can now see the website by opening the front folder, right clicking index.html and click on "open with live server", you are all set!

Setting Up Apache

Note: This step is optional if you are only going to run the code on localhost.


If you want to open up your website to other devices on the same network, you will need to configure the apache2 config file, i will attach a step by step guide how to do this in the attachements.

The file will also tell you how to automatically run app.py in the startup on your Raspberry Pi.


[file hier]

All Set

[foto hier]


If you have completed all the steps above, you will have a working website, and a working circuit, congrats!

I hope you enjoyed the creating and learning how to make this product all by yourself. Thank you for taking your time to read this and making this, I have put a lot of work in this product!



Sources:


Aleksandar Haber PhD. (2023, August 11). Raspberry Pi From Scratch: Properly Set Up, Connect, and Install Raspberry Pi Operating System [Video]. YouTube. https://www.youtube.com/watch?v=jLff_K39qL4


Indrek. (2020, April 17). Arduino Scale with HX711 and 50kg Bathroom Scale Load Cells | Step by Step Guide. [Video]. YouTube. https://www.youtube.com/watch?v=LIuf2egMioA


user_3654325057. (2025, March 8). LoadCell Holder. Makerworld. https://makerworld.com/en/models/1186234-loadcell-holder?from=search


Howest - MCT. (2026). 3_Production: File for setting up Apache2 Config and automatically running App.py. In www.howest.be. Howest -MCT.