Introduction: Temperature Controlled Fan

This instructable will take you through the steps necessary to create your own temperature controlled fan using an old computer fan. The materials that you will need are listed below.

1 x 12VDC computer Fan ($7.00 from Amazon)

1 x 120V / 12.6 V Transformer ($5.49 from radio shack)

1 x Arduino Uno Microcontroller

1 x NPN MOSFET (IRF520 Power MOSFET)

1 x Arduino Temperature Sensor

5 x Diode (found in unused electronics around the house)

1 x Outlet Connector (found in old electronics)

Wire

Wire Stripper

Soldering Iron

Solder

Step 1: Attach Your Transformer

The first step is to bring power from the wall outlet to your fan motor. You will need to attach your transformer to an outlet plug.

Strip the casing back on your power cable and inside you will find two insulated wires. Strip these wires back and solder them onto the primary side of your transformer. Orientation does not matter for this step but make sure that you wrap the chords in electrical tape afterwards so that everything is fully insulated.

Step 2: Assemble a Simple Rectifier

Assemble an connect a full wave bridge rectifier using 4 diodes as shown in the figure. These diodes can be found in many home electronics and desoldered. I was able to find 4 in an old battery charger that I don't have any use for. Solder these together making sure that they are all oriented correctly. The white strip on the diode indicates the direction that current is able to flow. It is pointing the same direction that the arrow is pointing on the diagram.

Step 3: Test Your Rectifer

Plug in the circuit that you have built so far and probe the positive and negative output nodes of your rectifier with a multimeter as shown in the picture. You should be getting a value between 12 and 13VDC. If this is not correct, something is not connected properly and you should not proceed until you are able to fix the error.

Step 4: Build Your Circuit

Build the circuit as shown in the diagram attached.

The NPN MOSFET is going to be used as a switch that will allow our motor to be connected to power when our Arduino indicates. (With the metal tab facing away from you, the left pin is the Gate, middle is Drain, and right is Source).

We will put another diode in parallel to our DC motor in the direction indicated in order to prevent transient current from backflowing into the motor and damaging the motor. (Remember that the white strip is pointing in the same direction as the arrow).

Finally, we will connect a temperature sensor to one of the Analog channels of the arduino in order to get our input from the circuit. (With the rounded part facing away, the left pin should be attached to +5V, middle pin should be attached to A0 and right pin is Ground).

Assemble your circuit.

Step 5: Program Your Arduino

Download the attached .ino file, or copy and paste the below text into your Arduino programming environment. Note that in my code, i have set the temperature for the fan to turn on at anything above 34 degrees Celsius. If you want to adjust this temperature, simply go into the code and change it to whatever temperature you want your fan to turn on at.

const int tempPin = A0;
const int gatePin = 2;

void setup() {

Serial.begin(9600);

digitalWrite(gatePin, LOW);

}

void loop() {

int tempValue = analogRead(tempPin); Serial.print("Temperature Reading = "); Serial.print(tempValue);

float conversion = (tempValue/1024.0) * 5.0;

Serial.print(", Conversion: "); Serial.print(conversion);

Serial.print(", degrees C: "); float Ctemperature = (conversion - .5)*100; Serial.println(Ctemperature);

if(Ctemperature < 34) { digitalWrite(gatePin, LOW); } else { digitalWrite(gatePin, HIGH); } delay(1000); }

Step 6: Finished! Time for Testing!

Upload your code onto the arduino board and plug the transformer into the wall. Pull up your serial port on the computer and watch the temperature that your temperature sensor is reading. You should be able to see the fan turning on and off depending on the temperature!

Comments

author
Karavan made it! (author)2016-05-22

Name model temperature sensor?

About This Instructable

3,161views

48favorites

License:

Bio: I'm a design consulting electrical engineer working in downtown Chicago and I do a lot of small electronics side projects! Passionate about learning new ... More »
More by bohmbac2:Temperature Controlled Space HeaterBuild a Simple Binary Counter using your ArduinoTemperature Controlled Fan
Add instructable to: