Small program to control the fan for Raspberry Pi depending on temperature
Files:
- ATtiny_fan_control: contains code for ATtiny85
- fan_control.py: python script running on Raspberry Pi
- Clone repository to Raspberry Pi
- Upload ATtiny source to ATtiny85 (e.g with USBtinyISP programmer)
- Connect ATtiny to Raspberry Pi as shown in schematic
- Copy fan_control.service to /etc/systemd/system/fan_control.service (You may first need to adjust the paths inside the file)
$ sudo cp fan_control.service /etc/systemd/system/fan_control.service
- Enable service with
$ sudo systemctl enable fan_control.service
- Start service with
$ sudo systemctl start fan_control.service
- Check if a file temperature_log.txt is created
$ cat temperature_log.txt
The output should look like this:
19:17:48: pi(47.2'C) attiny(32.0'C) -> False
19:18:03: pi(49.1'C) attiny(32.0'C) -> False
19:18:18: pi(48.2'C) attiny(32.0'C) -> False