Posts

Showing posts from December, 2024

School Project: Temperature Controlled fan using Arduino in Proteus

Image
 Temperature Controlled fan using Arduino in Proteus  Below is an Arduino code for a temperature-controlled fan using an analog temperature sensor (e.g., LM35) connected to an analog pin. The fan speed is controlled using PWM output. This code is suitable for simulation in Proteus. Arduino Code: Copy the code and Paste: // Temperature-Controlled Fan Using Arduino // Components: LM35 (Temperature Sensor), DC Fan, Arduino UNO, and NPN Transistor // Pin configuration const int tempPin = A0;       // Analog pin connected to LM35 const int fanPin = 9;         // PWM pin connected to the fan (via transistor) // Temperature thresholds const float tempMin = 25.0;   // Minimum temperature (in Celsius) for the fan to start const float tempMax = 40.0;   // Maximum temperature (in Celsius) for full fan speed void setup() {   pinMode(fanPin, OUTPUT);    // Set the fan pin as an output   Serial.begin(9600);...