A comparative tool and hardware setup for Raspberry Pi (RasPi) to manage temperature and monitor essential information.
This repository outlines a project designed to enhance the thermal management and monitoring capabilities of a Raspberry Pi 4 housed in an Argon NEO case. The project combines hardware modifications and custom software to provide effective cooling and real-time system monitoring through a small OLED display.
Note
You can read the complete instructions on The Forge blog.
Final Product | Demo Video |
---|---|
Table of contents:
- Dynamic Cooling: Automatically adjusts the fan speed according to system temperature thresholds.
- Real-Time Monitoring: Displays key metrics like:
- CPU & GPU temperature
- Network status
- System overview
- Compact Design: Retains the Argon NEO case's form factor with minimal modifications.
- 128×64 px OLED Display (SSD1306): Uses I2C protocol to display system metrics, including temperature, system, and network status.
- Miniature 5V Fan: Provides active cooling to maintain optimal system temperature.
- DRV8833 Dual Motor Driver: Controls the 5V fan with PWM for precise speed adjustments.
- Raspberry Pi 4: Serves as the mainboard.
Here is the schematic for connecting all components to the Raspberry Pi GPIO.
DRV8833 | Raspberry Pi 4 GPIO |
---|---|
AIN1 | GPIO13 |
AIN2 | GPIO12 |
VM | 5V (Pin #4) |
GND | GND (Pin #6) |
STBY | GPIO27 |
5V Fan | DRV8833 Driver |
---|---|
5V (RED) | AIO1 |
GND (BLACK) | AIO2 |
OLED - SSD1306 | Raspberry Pi 4 GPIO |
---|---|
VCC | 3v3 (Pin #1) |
SDA | GPIO2 |
SCL | GPIO3 |
GND | GND (Pin #9) |
I used the Argon NEO Case for my raspberry pi 4 and I modified this case to place the components. You can find the 3D design file in the ./3d-files
directory or through this link. You can also 3D print any other case of your choice to house the components.
Clone the repository into your raspberry pi:
git clone https://github.com/mosnfar/raspi-temp-manager
To run this script you need these libraries gpiozero, Pillow(PIL), and adafruit_ssd1306 that are not in raspberry pi, install requirements libraries:
pip install -r requirements.txt
Tip
If you are using a newer version of Python, install the libraries globally rather than in a virtual environment.
You should copy essential files "font and boot lofo" to /usr/local/share
, use the following command:
mkdir -p /usr/local/share/temp_manager
cp ./fonts/lucan.ttf /usr/local/share/temp_manager
cp ./images/raspberrypi_logo_inverted.bmp /usr/local/share/temp_manager
You can test everything to make sure configs are working correctly by running test_config.py
to check "Required libraries installation", "I2C connection", "Fan connection", and "Essential files". You can run test by this:
python test_config.py
After successful testing, configure a service to add that into system boot and the script will be running at startup. First copy temp_manager.py
script into /usr/local/bin
:
sudo cp ./source/temp_manager.py /usr/local/bin/
Now add new service for temperature manager:
sudo nano /etc/systemd/system/temp_manager.service
And add content below to service file:
[Unit]
Description=Temperature Manager
After=network.target
[Service]
ExecStart=/usr/bin/python3 /usr/local/bin/temp_manager.py
Restart=always
[Install]
WantedBy=multi-user.target
Finally enable and start the service to run at startup:
sudo systemctl enable temp_manager.service
sudo systemctl start temp_manager.service
😃 Awesome, everything is set up perfectly and should work great!
Here are some images that highlight the project:
Measuring Case | Soldering Components | Component Preview |
Glue Magnets | Connection Preview | Assembled Product |
I wrote a complete guide and instructions on my blog "The Forge" you can read it through this link.
Feel free to customize and improve the project however you'd like! Your contributions are always welcome, and together we can make it even better. Don't hesitate to jump in and help out! 😊