Below is a screenshot of the fan control web interface:
This IoT project allows users to control a fan remotely using a web interface built with Flask, Python, and Raspberry Pi GPIO PWM signals.
- Wi-Fi based fan ON/OFF control
- Real-time PWM speed adjustment (0%–100%)
- Lightweight Flask server with AJAX functionality
- GPIO pin management and PWM signal generation
- (Optional) TMP36 sensor integration
- Python 3
- Flask
- RPi.GPIO library
- HTML5, CSS3, JavaScript (AJAX)
-
Install the required Python packages:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Access the fan controller UI by visiting:
http://<your-raspberrypi-ip>:5000/fanControl
- Ensure you have the necessary GPIO permissions (
sudo
if needed). - Tested on Raspberry Pi 4 with Raspberry Pi OS Lite (64-bit).
Saket Chahal