Temperature Controlled Fan – Overview

The idea for this project was to build an enclosed device that would actively attempt to cool itself as temperatures inside increased. The main components for the project were the ATmega328P Xplained Mini microcontroller, a temperature sensor, and a 5 volt DC fan. The device was placed into a small plastic enclosure. A circular hole was cut into the top to mount the fan, a rectangle was cut to fit an LCD screen for displaying the temperature, and two rectangles were cut on the side for ventilation and USB power. This project utilized variations of analog to digital conversion (ADC) from Lab 3 and pulse width modulation (PWM) from Lab 4.

The ADC on the microcontroller was used to convert readings from the temperature sensor into a temperature value. A separate temperature value was set as a target temperature. As the temperature inside the case increased beyond the target temperature, the fan would switch on to ventilate the hot air out of the case to cool it down. Additionally, a transistor was used along with PWM via the board’s Timer Counter 1 and Compare Match Interrupt to limit the voltage to the fan and control its speed. The fan would start at a 40 percent duty cycle and increase by 10 percent for every degree above the target temperature, maxing out at a 100 percent duty cycle. Conversely, the fan would decrease its duty cycle as the temperature decreased, turning back off after reaching below the target temperature.

Top View of the Case

Inside View of the Case


Temperature-Controlled Fan

To create our circuit for the temperature controlled DC fan, we built off the existing schematics used in labs 3 and 4. Our hardware includes an LCD, AtMega 328p board, temperature controlled sensor, fan, battery pack, transistor, two diodes, and multiple resistors at varying resistances. Challenges encountered wile wiring the circuit included changing our original plan to run the whole circuit off of the 6V battery pack. We found that this set up was not achievable due to the fan needing to pull more voltage from the circuit than we intended. To combat this issue, we decided to run just the fan off of the 6V battery pack and run the remainder of the circuit off of the USB. After much trial and error working with our circuit and varying resistors, we were able to find the optimal set up for the transistor used in the circuit while also finding that we needed to replace our original fan with a smaller spare fan that was in the lab room.