AeroCap - a Smart Cap With Fan
by DaanHertveldt in Circuits > Raspberry Pi
161 Views, 2 Favorites, 0 Comments
AeroCap - a Smart Cap With Fan
.jpg)

.jpg)
.jpg)
AeroCap is a smart cap equipped with a fan, designed to measure and process real-time body and environmental data. I made it for Project One, the first big assignment in the Bachelor MCT at Howest. The cap features a temperature sensor to measure the ambient temperature, a galvanic skin response sensor to detect sweat production, and a heart rate sensor to monitor your pulse. Based on these readings, the built-in fan can automatically activate to cool the user when needed. The web dashboard supports up to three users, who can easily switch profiles by scanning their badges on the RFID reader. This lets each person track their own progress with clear, user-friendly graphs and manage their individual settings. Finally, you can switch to manual mode to turn the fan on or off whenever you need.
Supplies















Controller
- Raspberry Pi 4 4GB
Sensors
- DS18B20: waterproof temperature sensor
- GSR sensor: galvanic skin response sensor (sweat)
- Heart rate sensor
- RFID-reader: switch between profiles + 2 badges
Actuators
- Cap with fan: built in in the cap
- LCD display: show the IP address
- Potentiometer: control the brightness of the LCD screen
Extra parts
- MCP3008: convert and read the GSR and heart rate sensor
- Diode: to protect the Pi from the fan
- Breadboard: For easily connecting wires and components without soldering
- Powerbank: Lets you use the device during sports
- GPIO extension: Makes it easier to connect devices to your Raspberry Pi
- Jumper wires: Used to connect all the components together
- SD card 16GB: to place your img on for the Raspberry Pi
The total cost of this project is around €203, so be prepared to spend some money!
Downloads
Fritzing Scheme




.jpg)
.jpg)
.jpg)
First, we created the scheme in fritzing before making the real circuit, to avoid damaging our Raspberry Pi on the first days. Make sure to look at the attachments below. Once the fritzing was ready, it was time to build the actual circuit! Wiring can quickly become messy, so we refer to the pictures to keep everything as neat and organized as possible. Make sure you double-check everything!
The wires on my heart rate sensor came loose, so I had to solder an extension to it. This made it easier to reconnect the wires and ensure everything stayed in place.
Database

Now it's time to make the database! I needed 3 tables: one for all my components, one for all my history, and one for the users. I connected to MySQL through SSH and created the database based on my schema. If you're having trouble creating this schema, just go to my GitHub and find the file projectone.sql, run that code in a SQL file and it should set everything up for you.
https://github.com/howest-mct/2024-2025-projectone-mct-HertveldtDaan/tree/main/data
Just a bit more info: the names starting with drempelwaarde_... are the threshold values for the sensors. These are saved for each profile in the database.
Coding the Project
.jpg)
Connecting to the Database
In the code, make a copy of config_example.py and use it as your own configuration file.
In your own configuration file in the [connector_python] section, replace:
- USER_HERE with your database username
- PWD_HERE with your password
- DATABASENAME_HERE with the name of your database
Backend
For the backend, I used FastAPI to handle the standard endpoints, and Socket.io to send data in real time, allowing me to display live updates on my website. The Datarepository contains all the functions that handle the execution of MySQL statements, ensuring proper communication with the database. The app.py file contains the main backend code, including all the core functionality. The protocols I used are OneWire, SPI, SSH, and VNC to connect remotely to the Raspberry Pi. To use OneWire and SPI, you need to enable them via the terminal using the command: sudo raspi-config > 3 Interface Options > Enable OneWire and Enable SPI.
You can find the backend on my GitHub via this link: https://github.com/howest-mct/2024-2025-projectone-mct-HertveldtDaan/tree/main/backend
Frontend
For the frontend, I used HTML for the structure of the page, CSS for the styling, and JavaScript to make everything functional and interactive. I have three HTML files one for each page, one CSS file, and one JavaScript file. The JavaScript file continuously checks in the init which page is currently active and runs the corresponding code for that page.
You can find the frontend on my GitHub via this link: https://github.com/howest-mct/2024-2025-projectone-mct-HertveldtDaan/tree/main/front
Hacking the Box and Cap
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
Finally, we’re at the stage where everything comes together.
First, you need to unscrew the fan from the cap and modify it. Use a screwdriver to remove the small solar panel from the fan so you can access the inside. Take out the small battery and disconnect the solar panel. Next, strip the little white connector to expose the red and black wires, then solder your own jumper wires to them. In the end, you’ll be left with just the red and black wires from the fan, which you can then connect to your Raspberry Pi using a transistor and a diode.
The final step is to hack the box. I got mine from Brico. Take a lighter and a nail with a sharp point, warm the tip of the nail with the lighter until it starts to smoke. Then, carefully press the nail against the plastic of the box. You’ll notice the plastic begins to melt, allowing you to gently create a hole. We use this method to make the side hole for the wires and the front hole for the button. Finally, we're going to paint the box using black spray paint to cover the transparent parts. Place a 7 cm × 2.3 cm piece of painter's tape on the front of the box where the LCD screen will be, and another 3.1 cm × 2.8 cm piece on the top where the RFID reader is located. This way, when you spray over the box and then remove the tape, the designated areas will remain clear, allowing you to see the LCD screen and RFID reader through the box.
That’s it, the final step. Just place the box in your backpack, and your smart cap is ready to go. The automatic fan will keep you cool without you having to lift a finger!