Introduction: Arduino Fan Controller


In this short instructable i will show my very simple but yet useful gadget. I created this for the son of my friend of mine for educational purpose, for a school presentation.

Lets start.

Step 1: A Simple Controller

This is an arduino nano based simple controller using a nokia 5110 display, BC547 NPN transistor, a 3 wire (12V) pc fan, 2 leds and a DS18B20 temperature sensor. As you can see in the picture it is a simple and basic setup.

Step 2: Materials

Parts needed:

- Any arduino board

- Nokia 5110 LCD / or the HX1230 LCD is suitable too

- breadboard

- a few jumper wires

- BC547 or any other similar NPN transistor

- DS18B20 temperature sensor

- 2 or 3 wire 5/6/12/24V fan or any other electronic component

- 2X 200 ohm resistors and two LED

- Female pin headers

- if wanting to measure fan rpm then a simple 1N4007 diode and a 10K pullup resistor will be needed.

Step 3: Software

For this setup i made a very simple sketch to demonstrate the functionality.

Download libraries needed, compile and upload to arduino.

For the PCB file go to this link, open in editor and you can generate the gerber file.

My second PCB is downloadable at this link:

This similar pcb uses the SSD1306 display with 4 transistors.

Step 4: Schematic

As you can see i had the time and made a fritzing schematic for easier understanding.

If you want to see the fan rpm please make the correct setup. If not, don't add the diode and pullup resistor.

Step 5: Arduino in Work

A little explanation:

In this setup let's suppose we wan to cool down something with a cooling fan. The arduino is measuring the temperature of the object/or liquid/. When the temperature is over a certain value the arduino gives a signal(HIGH) to the transistors base, so the electricity can flow through it, turning the fan on.

In our case the the transistor is acting like a switch.

The only disadvantage is that most NPN transistors(like BC547) have current limitation to max 100-150mA.

When the temperature drops under a certain value, the arduino switches output pin from HIGH state to LOW. So after that no electricity flows through it, turning the fan off .

For this reason i used arduinos D6 pin (pwm).

As long as the cooling is on , the RED led is on, when not cooling , the GREEN led is on.

On the pcb there is a 5/12V input for the fan supply. There is a jumper for switching the power supply from Arduino or the 12V input. In theory the jumper can be used even with 12V supply, because i connected it to the arduino's VIN pin that is connected to the AMS1117 voltage regulator. In theory it can handle 12 volt input, but did not want to risk the "magical smoke".

But with this setup it can control relays, mosfets etc...

I DONT RECOMEND USING THE LGT8F328PU NANO BOARDS!!!! It has a very weak power supply capability, ergo it will not work. Tried it.

Step 6: RPM

When i designed the pcb i did not count with the rpm measuring and did not wrote it in the sketch first. I added it later. When i first assembled everything on the pcb i realised that after the arduino stopped cooling and the fan turned off, the fans propeller moved a bit every two seconds. I did not know what to do so i installed a simple diode with back direction to the hall effect sensor and added a 10K pullup resistor to the D2 pin. Even if the fan stops, this disturbing moving in stops. Now it works fine.

Step 7: Future Plans

I have two plans for the summer. I want to make a ventillator cooling for my motorcicle because it is air cooled only. But when it is stopped no more cooling and risk a damage by overheating.

The second plan is a plant watering system in my backyard. A 6 or 12 volt water pump is more than enough and they will be controlled with the IRF520 mosfet module. But usually i solder them off and replace it with IRLZ44N, because a logic mosfet it better for arduino than the N channel fet. Maybe i will post them too when finished.

Hope someone will find it handy. Pls feel free to use it!