Get Maximum Control Over Your Fans with PWN Fan Controller with Temperature Sensing and Button Override

13 May 2023 Balmiki Mandal 0 µC - µP

Introducing the PWN Fan Controller with Temp Sensing and Button Override

Are you looking for a fan speed controller that can give you ultimate control over the temperature in your home? Look no further than the PWN Fan Controller with Temp Sensing and Button Override. This fan controller gives you the flexibility to precisely regulate the temperature of your room without having to manually adjust the fan speed.

The PWN Fan Controller is equipped with a temperature sensor that continuously monitors the room's temperature. If the temperature rises above the set point, the fan speed will automatically adjust to maintain the desired environment. Additionally, the fan speed can be manually adjusted with the on-board button override switch.

The PWN Fan Controller also features power saving modes. When enabled, the fan controller will reduce the fan speed when the temperature drops below the target temperature. This helps save energy and reduces fan noise.

Whether you need to maintain an ideal temperature for sleeping, working, or entertaining guests, the PWN Fan Controller with Temp Sensing and Button Override gives you the ultimate control over the temperature in your environment. Try it today and enjoy the perfect climate all year round.

Here is an example code for the PWN Fan Controller with Temp Sensing and Button Override using Arduino

#include <LiquidCrystal.h> // Include the LiquidCrystal library
#include <OneWire.h> // Include the OneWire library
#include <DallasTemperature.h> // Include the DallasTemperature library

// Temperature sensor setup
#define ONE_WIRE_BUS 2 // Define the pin for the temperature sensor
OneWire oneWire(ONE_WIRE_BUS); // Create a OneWire object
DallasTemperature sensors(&oneWire); // Pass the OneWire object to DallasTemperature object

// Fan control setup
#define FAN_PIN 3 // Define the pin for the fan control
int fanSpeed = 0; // Define the initial fan speed

// Button setup
#define BUTTON_PIN 4 // Define the pin for the button
int buttonState = 0; // Define the initial button state

// LCD display setup
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // Initialize the library with the pins connected to the LCD display

void setup() {
  pinMode(FAN_PIN, OUTPUT); // Set the fan pin to output mode
  pinMode(BUTTON_PIN, INPUT_PULLUP); // Set the button pin to input mode with internal pull-up resistor
  lcd.begin(16, 2); // Initialize the LCD display
  sensors.begin(); // Initialize the temperature sensor
}

void loop() {
  sensors.requestTemperatures(); // Request the temperature reading from the sensor
  float temperature = sensors.getTempCByIndex(0); // Get the temperature reading in Celsius

  buttonState = digitalRead(BUTTON_PIN); // Read the button state

  if (buttonState == LOW) { // If the button is pressed
    fanSpeed = map(analogRead(A0), 0, 1023, 0, 255); // Read the analog input and map it to the fan speed
  } else { // If the button is not pressed
    if (temperature <= 25) { // If the temperature is below 25 degrees Celsius
      fanSpeed = 0; // Turn off the fan
    } else if (temperature >= 40) { // If the temperature is above 40 degrees Celsius
      fanSpeed = 255; // Set the fan speed to maximum
    } else { // If the temperature is between 25 and 40 degrees Celsius
      fanSpeed = map(temperature, 25, 40, 0, 255); // Map the temperature to the fan speed
    }
  }

  analogWrite(FAN_PIN, fanSpeed); // Set the fan speed
  lcd.setCursor(0, 0); // Set the cursor to the first column of the first row
  lcd.print("Temp: "); // Print the temperature label
  lcd.print(temperature); // Print the temperature reading
  lcd.print("C"); // Print the temperature unit
  lcd.setCursor(0, 1); // Set the cursor to the first column of the second row
  lcd.print("Fan Speed: "); // Print the fan speed label
  lcd.print(fanSpeed); // Print the fan speed value
  lcd.print("%"); // Print the fan speed unit
  delay(1000); // Delay for 1 second before repeating
}

This code uses a temperature sensor connected to pin 2, a fan connected to pin 3, and a button connected to pin 4. The code also uses a 16x2 LCD display connected to pins 2-7.

The code reads the temperature from the sensor, adjusts the fan speed based on the temperature readings or button input, and displays the

 

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.