Hey guys,
I'm doing a project for college entitled " using arduino to control temperature using a PC fan" ..
Basically I programme an Arduino Uno to tell a fan to switch on when the temperature within the air filled enclosure gets too hot(50degrees celcius). The fan is a 3 wire fan... I've heard that I dont have much control over speed as the 3rd line is only a tacho so i will have to buy a 4 pin 12V fan so I can control the speed with PWM.
I will use a 12V power supply to power this fan and another fan(I THINK ANYWAY). If im powering 2 fans (rated 12 V 0.5A and 12V 0.86A) ...one for circulation within the box and one to draw air out... and a heat source(possibly power resistor 3W)..how would I power the Arduino if thats at 5V?..MOSFET I have a IRF520N but im not sure how to read the data sheet. I also want to have a temperature sensor(prob LM35) to read temperature of enclosure and vary outlet speed based on this.
I want to also have an LCD screen to output the current temperature and desired temperature and a buzzer that alerts the user when the desired temperature has been reached on a breadboard. I was thinking a 4 channel 5V relay board could be used to drive the fans as I want some control over when the fans will be switched on and off and at what speed outlet fan will run. Any
advice would be greatly appreciated. I attached a picture of my concept drawing with the 2 fans, the enclosure, the arduino, the board and the heat source. Thanks for your time.
Regards
Kevin
I think that this would work better if you used proportional control over the cooling fan speed rather than banging it on and off. That implies using a transistor based driver circuit rather than a relay. 12V at 0.5A is within the range that you could drive using a common h-bridge motor driver, although you could build a simpler driver cheaper if you know how to design a transistor circuit.
For temperature sensing you need to decide what temperature range you need and what resolution, but a DS18B20 is easy to use and covers the sort of temperature range I'd expect you to want to cover.
I don't know how accurately you want to control the temperature. It would be trivially easy to write a simple proportional control algorithm that increased the cooling as the temperature increases - this would inevitably leave you with a temperature error. A better approach would be to implement a PID control algorithm which would, when tuned correctly, give you optimal response time and eliminate steady state errors.
PeterH,
Thanks for your reply,some very helpful stuff there, appreciate it. The PID control algorithim-I could use the PID library in Arduino right? PID(&Input,&Output,&SETPOINT,Kp,Kd,Ki,Direction)....so the 3 things the algorithim needs to know is the current temperature, the error value(how far away from set point) and the setpoint. The gain values then would be got from testing am i right? Also, I could use the sister programme processing to draw a graph of the temperature change against time???
The temperature range would be from room temperature(approx 17) up to 50 degrees. And I also have 2 fans as mentioned so if I wire them both up i would need 2 transistors?
Thanks again,
Kevin
kevinmc:
PeterH,
Thanks for your reply,some very helpful stuff there, appreciate it. The PID control algorithim-I could use the PID library in Arduino right? PID(&Input,&Output,&SETPOINT,Kp,Kd,Ki,Direction)....so the 3 things the algorithim needs to know is the current temperature, the error value(how far away from set point) and the setpoint. The gain values then would be got from testing am i right? Also, I could use the sister programme processing to draw a graph of the temperature change against time???
The temperature range would be from room temperature(approx 17) up to 50 degrees. And I also have 2 fans as mentioned so if I wire them both up i would need 2 transistors?
Thanks again,
Kevin
No you would not necessarily need two transitors - they can be wired in parallel (it it makes sense for them both to come on at the same time) - what are your temperature inputs and what is the volume of the room - this will tell you whether you need a fancy PID control or whether a simple table that implemented your own basic control would work.
You do not need fans that support pwm - you will handle that yourself through the transistor. As you seem to be new to all of this i would suggest you look at a ready made board like this
(Remember this is designed to switch the negative not the positive wire)
Craig,
the brief for the project is "control temperature of an enclouse using Arduino and a PC fan". The temperature is from room temperature(approx 17 degrees ) to 50 degrees. The enclosure is 400mmx500mmx250mm(0.05m^3) i think i worked it out as something like 1500 J to raise temperature that much neglecting loss from walls.
I've 2 fans at the moment-3 pin one for drawing air out -but was thinking seem as this is cooling fan would it not be easier option to buy a 4pin fan with the PWM lead on it but you say i could handle it through transistor i presume by switching it on and off quickly??
2 pin one for circulation within box (constant)..
Thanks
Kevin
kevinmc:
I also have 2 fans as mentioned so if I wire them both up i would need 2 transistors?
I think you said that only one of them needs to be controlled by the Arduino - the other one would be on permanently so could just be wired directly to a suitable power supply. The controllable fan would be powered by the same / a similar power supply, but going via the Arduino's motor driver circuit or your own transistor-based version of it.
Use a 3-pin fan and drive it with PWM using a power transistor or power mosfet. You can wire them in parallel so you need only only transistor or mosfet. The tacho output from the fans won't work with this arrangement, so you won't be able to measure the fan rpm, except when running it at full speed.
Use a 4-pin fan and have the Arduino drive its PWM pin via a small signal transistor or small signal diode. Depending on what fan you use, you may not be able to turns the fan right off, because the Intel PWM fan specification only requires that the fans can go down to 30% speed or below. But I think most fans can be turned right off using the PWM signal. You can find the specification at www.formfactors.org/developer%5Cspecs%5C4_Wire_PWM_Spec.pdf. The tacho output from the fan is usable even when you are using PWM to control its speed.