Project 2: Temperature Controlled Fan

Research into target market

My cooling aid products main reason for development was to be used in 3rd world countries where most often ill patients are cared for in tents, with temperatures average for the year being 28.58 degrees (Africa) there is need for cooling systems, but even some of the bigger hospitals do not have these facilities such as air conditioning. My product would help patients to stay cool in these hot conditions, and also gives the staff abit of awareness of how hot the patient may be.

I was hoping that my product could be produced a cheap as possible then these 3rd world hospitals would be able to have these fans for selected patients in need.

Because some of these hospitals a quickly put up in certain areas my product would mean it could be moved to a new location if needed somewhere else so the hospitals dont have to invest into large and expensive permanent cooling systems.

Research into existing projects

http://www.electroschematics.com/9540/arduino-fan-speed-controlled-temperature/        (really helpful to grasp how to work a fan with temp)

http://forum.arduino.cc/index.php?topic=230800.0

http://electronics.stackexchange.com/questions/62324/arduino-controlled-pwm-pc-fan

http://playground.arduino.cc/Learning/SingleServoExample

http://www.instructables.com/id/Temperature-Sensor-with-LED/

For my second project I thought it would be a good chance to go further with my last project. To do this I wanted to add more leds and use them as a way to show the user the speed of something, so next I bought a 12v fan.

As I already knew how to set up the temperature sensor this was easy but the difficult bit was setting it up with 3 leds that would change at certain temperatures and as there were 3 I couldn’t use the temperature cutoff like I did for my last product, so I had to find a new way to work the leds and that was ‘if (temperature <= 14.00)’ meaning if the temperature was 14 or over then it would light up one of the designated leds, I had to do this for every temperature change.

IMAG0903

Getting the fan to do the same thing within that ‘if’ statement took a few days to work out, and in the end had to use different parts of codes and trying out different ideas but even then it still wasn’t working that well with the leds, so more tweaking of the code and set up was involved to eventually get it working with the leds and right fan speeds.

IMAG0883

I then added a servo to my set up so that this could rotate the fan. This was not as hard as setting the fan up but was still a challenge. Once the servo was connected it reduced the power to my fan giving me problems with fan speed so I had to buy a battery to power the fan separately. I still had problems with the fan working after adding the battery but it could at least run.

To finish my product off I wanted to add a button to the whole set up that would turn everything off or have it on. I was able to easily get it to turn everything off but had trouble with getting things to run as before when pressed again. It is something I need to look into more with the coding to get working the way I want.

//final code

#include

int temperaturePin = 0;
int led_red = 13;
int led_orange = 12;
int led_green = 10;
int fan = 9;
int button = 2;
int buttonValue = 0;
boolean currentState = LOW;
boolean lastState = LOW;
Servo myservo;
int pos = 0;
void setup()
{

Serial.begin(9600);
pinMode(led_red, OUTPUT);
pinMode(led_orange, OUTPUT);
pinMode(led_green, OUTPUT);
pinMode(fan, OUTPUT);
pinMode(button,INPUT);
myservo.attach(6);

}
void loop(){

float temperature = getVoltage(temperaturePin);
temperature = (temperature – .5) * 100;

Serial.println( temperature );
delay(1000);

currentState = digitalRead(button);
if (currentState == HIGH && lastState == LOW)
{
digitalWrite(led_red,LOW);
digitalWrite(led_orange,LOW);
digitalWrite(led_green,LOW);
analogWrite(fan, 0);

}
else
{

if (temperature <= 14.00) { digitalWrite(led_red, HIGH); digitalWrite(led_orange, LOW); digitalWrite(led_green, LOW); analogWrite(fan, 0); } if (temperature > 16.00 && temperature < 18.00)
{

digitalWrite(led_red, LOW);
digitalWrite(led_orange, HIGH);
digitalWrite(led_green, LOW);
analogWrite(fan, 255);

for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15ms for the servo to reach the position } for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}

}
if (temperature >= 18.00)
{

digitalWrite(led_red, LOW);
digitalWrite(led_orange, LOW);
digitalWrite(led_green, HIGH);
analogWrite(fan, 255);

for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable ‘pos’ delay(15); // waits 15ms for the servo to reach the position } for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}

}

}
}
float getVoltage(int pin){
return (analogRead(pin) * .004882814);
}

Final model.

This is my final model, a cooling aid fan that is designed to be deside someone who is bed bound. My main intention was to have this as a aid in 3rd world hospitals where they do not have the money to install large air conditioning system.

For my model I wanted to show the size and show that I want to have a small product that fits on a bed side table.

IMAG0905

My product is inactive below a crtain temperature and the red led is lit but above the minimum temperature the orange led then lights up and the fan starts to speed, the servo also comes on. when the max temperature is reached( could be set to a dangerous temperature for patients to be at) the green light lights up and the fan reaches full speed, the servo just carries on as it was before. when button is pressed, everything will shut down.

final fritzing fan complete_bb

After these two projects I feel I have learnt loads about physical computing and it has given me the chance to try something I was never really interested in or knowledgeable about. I now have a strong interest and a good amount of research to do my own things in the future and I will be using Arduino again.

if I was to do this project again I would like to push myself further. I was happy with what I cold achieve as I had never done anything like this before but with all the help available I believe I can now create better and more complex projects.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s