Initial: Our project comprises of a fan that works upon the following criterion: 1) Certain temperature readings. 2) Motion/movement sensing.

We use a ping sensor and a temperature sensor to determine whether our thresholds have been fulfilled, and if so, the fan proceeds to turn on. The thresholds for required temperatures will be user-friendly i.e. user can decide whatever temperatures they want the fan to turn on at. More so, the ping sensor will make sure the fan does not stay on in the absence of motion/movement. The addition of ping sensor thus makes the fan efficient/power-saving.

For inclusion of Bluetooth: the fan will be attached to the Bluetooth slave module, and sensors will be attached to the Bluetooth Master.

Parts: 1) Arduino 2) Code 3) Ping Sensor 4) Temperature Sensor 5) 5V/0.16A Fan 6) Bluetooth Slave/Master modules

For Demo Day1: Temperature Sensor and Ping Sensor working with the Bluetooth. For Demo Day2: Temperature Sensor/Ping Sensor working with the Bluetooth and the fan.

Final Project Write-up:

A description of what the idea is and why you chose it For our final project, we made a motion and temperature sensored fan. The fan on one Arduino board automatically turns on when the temperature threshold is met and when a person is detected. If both of these conditions are not met, the fan will not turn on. We chose to do this project in an effort to develop a product that would save energy. This fan saves energy by turning off automatically when no one is around or if the temperature is already cool enough.

Explain what you had ready for the first demo day and how you improved that for the final demo. For the first demo day, we prepared our circuit without the actual fan, and instead replaced the fan’s nodes/ports with an LED--to ensure that the ends were functional. We did this because our fan had not been shipped to us yet. We also made sure that the Bluetooth© modules (slave/master) were functioning in connection with the ping sensor. We, for the first demo, had the following result set to output:

if ((val1 >= 65) && (dur <= 2750)) { BTSerial.print("H"); Serial.println("H"); }

However, for the final demo, we improved (debugged) this to say the following:

if ((temp >= 65) && (dur <= 2750)) { BTSerial.print("H"); Serial.println("H"); }

Aforesaid correction within the code lead to a compliance between the ‘H’/’L’ output on the serial monitor and the true temperature on the serial monitor instead of the val1 used to compute it.

Final bits of rectifications that were made: 1) addition/replacement with a 5V/0.25A Fan 2) Increased temperature threshold from 55℉ to 65℉

Separate each subsystem of the project and explain in detail how you implemented it. If it is hardware explain the wiring and how components work together. If it is code explain how the logic works. One subsystem of our project is the temperature sensor. This sensor recorded the temperature of the room which we could then convert to degrees Fahrenheit in our code. We stored the initial measurement under a variable called “val1” and the temperature in degrees Fahrenheit under a variable called “temp.” This can be seen in the code below.

val1 = analogRead(SENSOR); temp = (val1 / 1024) * 500; Serial.println(temp); delay(10);

Another subsystem of our project is the ping sensor. This records the amount of time it takes for a signal to be sent out, bounce off an object, and return back to the sensor. We stored this under a variable called “dur.” By observing the values on the serial monitor, we could determine what we wanted our threshold to be for distance away from the ping sensor. We settled on 2750 milliseconds. We also had to implement code in order to send out a signal and turn of the signal. This can be seen in the code below.

digitalWrite(8, LOW); //turn off Trig pin if it was on before delayMicroseconds(2); //a very short break digitalWrite(8, HIGH); //turn on Trig pin to send a sound wave delayMicroseconds(10); //a short break digitalWrite(8, LOW); //turn off Trig pin, end soundwave output long dur = pulseIn(7, HIGH); //record soundwave reflection time Serial.println(dur);

We also incorporated bluetooth into our project. If both the temperature and distance thresholds are satisfied, the sender bluetooth will send and “H” to the receiver bluetooth. Otherwise, an “L” will be sent. This can be seen in the following code.

if ((temp >= 65) && (dur <= 2750)) { BTSerial.print("H"); Serial.println("H"); } else { BTSerial.print("L"); Serial.println("L"); }

The sender code saved the incoming letter as a char called “inChar” as seen in the code below.

char inChar = (char) BTSerial.read();

We also had to setup the bluetooth in both the sender and receiver code by using the following pieces of code.

include SoftwareSerial BTSerial(2, 3); //TX RX



The last crucial aspect of our project was the fan. We attached the fan to the receiver circuit. If “inChar” read “H” the fan turns on. If “inChar” read “L” the fan would turn on. You can see this implemented in the following code.

if(inChar == 'L') {
  digitalWrite(led, LOW);
else if(inChar == 'H') {
  digitalWrite(led, HIGH);

How this project could be turned into a real product that could be sold. While working on this project, we made sure to keep its practical applications in mind. We believe that a fan that works with a temperature and motion sensor is ideal for workstations in laboratories or places where the workers tend to move around a lot while putting in quite a few hours of work. In settings like these, the ease offered by a system where a fan automatically turns on when needed and turns off when no one is present in the vicinity can be of great convenience, while also saving energy. However, as is obvious, the fan used in our project is very small and runs on a low voltage and for the project to be turned into a real product, you would need to replace it with a bigger fan. Moreover, in the case of a bigger fan, the code can be modified to include levels of speed based on the temperature of the surroundings so the fan works at a higher or lower speed depending on how warm it is.

Improvements if you had to do anything additional. One thing we would have liked to modify in our current project is the size of the fan used but for practical purposes and for the ease it offered, we decided to use the 5V fan as it allowed us to properly demonstrate the project while still using the 5V arduino as our power source. Moreover, we considered using more than one fan placed in different positions so a person working at a workstation would feel the breeze coming from more than one directions.

Lastly, as is evident from our demonstration, the fan needs a light nudge for its blades to start spinning as the current power supply from the Arduino isn’t strong enough for it to overcome the initial friction. To overcome this issue, we can use an stronger power supply other than the Arduino to provide the fan with that extra bit of power to overcome the friction and start working.

Link to Video

[link] https://drive.google.com/file/d/1zfwYGMcqwQv3I4Me5uJ9nczWK6U1DD3w/view?usp=sharing

Built With

Share this project: