Prevent the external SSD connected to my PC from Overheating. The goal was achieved by a raspberry pi 5 4-Pin Fan, controlled by an ESP32 and a temperature sensor.
Automatically adjust the speed of fan using linear mapping (could be improved). Manually adjust the speed of the fan Read the temperature of the SSD (this is not 100% accurate, due to the temperature sitting on the SSD and being influenced easily by surrounding stuff)
- How to use esp32-hal-ledc API on esp32.
- Connect a temperature Sensor to the esp32 and communicate using I2C.
- Adjust an Output based on Input.
- Create a simple UI to allow control of the fan, and viewing the data, such as the Temperature and its development over time, and switching between linear mapping to other algorithms or manual mode.
PC to ESP32 commands:
- SET_AUTO -> enables auto mode
- SET_MANUAL:<duty> -> manual mode, duty 0-255 example: "SET_MANUAL:180"
- GET -> request one status frame immediately
ESP32 to PC (every 500 ms, and on GET):
- DATA:<temp>:<duty>:<mode>
example: "DATA:42.0:148:AUTO"