🌡 Arduino Temperature-Based Fan Control
This project demonstrates how to control a fan (simulated with an LED) using an Arduino Uno and a temperature sensor.
Below 25°C → Fan OFF
25°C to 30°C → Fan runs at 50% speed (PWM)
Above 30°C → Fan runs at 100% speed
The live temperature and fan state are printed to the Serial Monitor.
🛠 Components (Virtual in Wokwi)
Arduino Uno
Temperature input: LM35 (or Potentiometer to simulate NTC)
LED + 220Ω resistor (Fan simulation on pin D9)
Serial Monitor (built-in)
📂 How to Use
-
Open this code in Wokwi Arduino Simulator.
-
Connect components as described:
LM35 OUT → A0, VCC → 5V, GND → GND
LED + resistor → Pin D9 → GND
-
Paste the code into sketch.ino.
-
Run the simulation → open Serial Monitor to see live updates.
-
Change the temperature sensor value to test different fan states.
📷 Demo
25°C: LED OFF (Fan OFF)
25–30°C: LED dim (Fan 50%)
30°C: LED bright (Fan 100%)
🔗 Wokwi Link