https://github.com/mosnfar/raspi-temp-manager
A comparative tool and hardware setup for Raspberry Pi (RasPi) to manage temperature and monitor essential information.
https://github.com/mosnfar/raspi-temp-manager
3d-printing home-lab python raspberry-pi raspberry-pi-4
Last synced: 8 months ago
JSON representation
A comparative tool and hardware setup for Raspberry Pi (RasPi) to manage temperature and monitor essential information.
- Host: GitHub
- URL: https://github.com/mosnfar/raspi-temp-manager
- Owner: mosnfar
- License: mit
- Created: 2024-11-24T17:08:52.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T18:57:32.000Z (10 months ago)
- Last Synced: 2024-12-16T19:52:12.475Z (10 months ago)
- Topics: 3d-printing, home-lab, python, raspberry-pi, raspberry-pi-4
- Language: Python
- Homepage: https://forge.mosn.me/keeping-your-raspberry-pi-cool-a-temperature-manager-tool
- Size: 24.7 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RasPi Temp Manager
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](https://forge.mosn.me/keeping-your-raspberry-pi-cool-a-temperature-manager-tool).---
Table of contents:
- [:sparkles: Features](#sparkles-features)
- [:nut_and_bolt: Hardware](#nut_and_bolt-hardware)
- [Hardware Components](#hardware-components)
- [Schematic](#schematic)
- [:package: 3D Case](#package-3d-case)
- [:computer: Software](#computer-software)
- [:information_desk_person: More Information](#information_desk_person-more-information)
- [Image Gallery](#image-gallery)
- [Complete Instruction](#complete-instruction)
- [Contribution](#contribution)---
## :sparkles: Features
- **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.## :nut_and_bolt: Hardware
### Hardware Components
1. **128×64 px OLED Display (SSD1306):** Uses I2C protocol to display system metrics, including temperature, system, and network status.
2. **Miniature 5V Fan:** Provides active cooling to maintain optimal system temperature.
3. **DRV8833 Dual Motor Driver:** Controls the 5V fan with PWM for precise speed adjustments.
4. **Raspberry Pi 4:** Serves as the mainboard.### Schematic
Here is the schematic for connecting all components to the Raspberry Pi GPIO.

#### DRV8833 Driver ←→ Rasberry Pi
| *DRV8833* | *Raspberry Pi 4 GPIO* |
| --- | --- |
| AIN1 | GPIO13 |
| AIN2 | GPIO12 |
| VM | 5V (Pin #4) |
| GND | GND (Pin #6) |
| STBY | GPIO27 |#### 5V Fan ←→ DRV8833 Driver
| *5V Fan* | *DRV8833 Driver* |
| --- | --- |
| 5V (RED) | AIO1 |
| GND (BLACK) | AIO2 |#### OLED (SSD1306) ←→ Raspberry Pi
| *OLED - SSD1306* | *Raspberry Pi 4 GPIO* |
| --- | --- |
| VCC | 3v3 (Pin #1) |
| SDA | GPIO2 |
| SCL | GPIO3 |
| GND | GND (Pin #9) |## :package: 3D Case

I used the [Argon NEO Case](https://argon40.com/products/argon-neo-case-for-raspberry-pi-4) 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](/3d-files/) or through this [link](https://www.printables.com/model/1085113-rascase-raspberry-pi-argon-neo-case-add-on). You can also 3D print any other case of your choice to house the components.
## :computer: Software
#### 01. Clone Repository
Clone the repository into your raspberry pi:
```bash
git clone https://github.com/mosnfar/raspi-temp-manager
```#### 02. Install Requirements
To run this script you need these libraries gpiozero, Pillow(PIL), and adafruit_ssd1306 that are not in raspberry pi, install requirements libraries:
```bash
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.#### 03. Copy essential files
You should copy essential files "font and boot lofo" to `/usr/local/share`, use the following command:
```bash
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
```#### 04. Test Configs
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:
```bash
python test_config.py
```#### 05. Configure Boot Script
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`:
```bash
sudo cp ./source/temp_manager.py /usr/local/bin/
```Now add new service for temperature manager:
```bash
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:
```bash
sudo systemctl enable temp_manager.service
sudo systemctl start temp_manager.service
```**:smiley: Awesome, everything is set up perfectly and should work great!**
## :information_desk_person: More Information
### Image Gallery
Here are some images that highlight the project:
![]()
Measuring Case
![]()
Soldering Components
![]()
Component Preview
![]()
Glue Magnets
![]()
Connection Preview
![]()
Assembled Product
### Complete Instruction
I wrote a complete guide and instructions on my blog "The Forge" you can read it through [this link](https://forge.mosn.me/keeping-your-raspberry-pi-cool-a-temperature-manager-tool).### Contribution
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! 😊