// INTRODUCTION
Smart Fan is an Arduino cooling system prototype developed during the Programming and Physical Computing seminar. Smart Fan aim to provide a simple and efficient system that can be used to cool up any space while saving energy through the commute use of sensors and actuators. It is sufficient to set an optimal temperature, after which it will activate automatically if you are nearby. The system integrates a smart lighting function that automatically turns on according to the same distance field.
// CONCEPT
// SENSORS AND ACTUATORS
// OPERATION
1. If you get close to your desk, in range of 2 meters, desk knows and lamp turns on automatically.
2. If the temperature starts to rise above 25 celsius, the cooling fan is activated.
3. If you walk away but the temperature is still high, the fans turn off to save energy.
4. But if you get close again, the fan and lamp are automatically reactivated until the temperature returns to its optimal value.
// INTERACTIONS BETWEEN SENSORS, ACTUATORS AND EXTERNAL AGENTS
// PROTOTYPE
// CODE
#include <SimpleDHT.h> #include <NewPing.h> #define TRIGGER_PIN 10 #define ECHO_PIN 11 #define MAX_DISTANCE 200 NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); int pinDHT11 = 5; SimpleDHT11 dht11(pinDHT11); int greenLed = 9; int redLed = 8; int yellowLed = 7; int dcPin = 3; void setup() { Serial.begin (250000); pinMode (redLed, OUTPUT); pinMode (greenLed, OUTPUT); pinMode (yellowLed, OUTPUT); pinMode (dcPin, OUTPUT); } void loop() { byte temperature = 0; byte humidity = 0; int err = SimpleDHTErrSuccess; if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) { Serial.print("Read DHT11 failed, err="); Serial.print(SimpleDHTErrCode(err)); Serial.print(","); Serial.println(SimpleDHTErrDuration(err)); delay(1000); return; } Serial.print((int)temperature); Serial.print(" *C, "); Serial.print((int)humidity); Serial.println(" H"); int distance = sonar.ping_cm(); Serial.print (sonar.ping_cm()); Serial.println(" cm"); Serial.println("______________________________________"); delay(1500); if (temperature >= 25 && distance >= 20) { digitalWrite (redLed, HIGH); digitalWrite (greenLed, LOW); digitalWrite (yellowLed, LOW); digitalWrite (dcPin, LOW); } else if (temperature >= 25 && distance < 20) { digitalWrite (redLed, HIGH); digitalWrite (greenLed, LOW); digitalWrite (yellowLed, HIGH); digitalWrite (dcPin, HIGH); } else if (temperature < 25 && distance >= 20) { digitalWrite (redLed, LOW); digitalWrite (greenLed, HIGH); digitalWrite (yellowLed, LOW); digitalWrite (dcPin, LOW); } else if (temperature < 25 && distance < 20) { digitalWrite (redLed, LOW); digitalWrite (greenLed, HIGH); digitalWrite (yellowLed, HIGH); digitalWrite (dcPin, LOW); } }
// VIDEO
Smart Fan is a project of IAAC, the Institute for Advanced Architecture of Catalonia, developed during the Master in Advanced Architecture (MAA01) 2021/22 by student: Angelo Desole; faculty: Angel Munoz, Cristian Rizzuti, Bernat Morato; faculty assistant: Daniil Koshelyuk