Skip to content

A comparative tool and hardware setup for Raspberry Pi (RasPi) to manage temperature and monitor essential information.

License

Notifications You must be signed in to change notification settings

mosnfar/raspi-temp-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Final Product Demo Video
Image of final product Yotube thumbnail of demo video

Table of contents:


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.

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.

Schematic Diagram

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)

3D Case

Image of 3D printed part

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.

Software

01. Clone Repository

Clone the repository into your raspberry pi:

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:

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:

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:

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:

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!

More Information

Image Gallery

Here are some images that highlight the project:

Image Measuring Case Image Soldering Components Image Component Preview
Image Glue Magnets Image Connection Preview Image Assembled Product

Complete Instruction

I wrote a complete guide and instructions on my blog "The Forge" you can read it through this link.

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! 😊

About

A comparative tool and hardware setup for Raspberry Pi (RasPi) to manage temperature and monitor essential information.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages