Temperature-Controlled Fan

Kim Dang

Overview:

This project proposal is for a temperature-controlled fan that changes to low, med, and high speeds depending on how hot the temperature is. The project will use I2C protocol with the TC-74 temperature sensor. Temperature data and fan speed will be displayed on a 16x2 LCD display through I2C and will be sent to a computer through the HC05 Bluetooth Module through UART protocol. Based on the temperature, PWM will be used to change a simple DC Brushless fan's speed. The user can also interact and manually change the fan speed by typing into the Termite terminal.

Software Structure:

  • Interrupt upon detecting temperature change to a different fan speed range

  • PWM, or changing duty cycles, to control fan speed

  • User interaction in terminal can lead to interrupt to set speed manually

Block Diagram

Goals:

  1. Control fan speed with PWM

  2. Create interrupts based on temperature readings to change fan speed

  3. Display temperature and speed information on LCD

  4. Get temperature values and fan speed through Termite

  5. Disable automatic speed change and set speed upon user input through Termite

Demo:

Reflection:

Problems encountered:

  • A large amount of time was spent waiting for parts to come in (battery, NMOS). Of course, I still worked on my project using on-board functions to check functionality but there were times when I couldn't progress without a part.

  • Parts without datasheet: The 16x2 LCD display I got didn't have an official datasheet I could reference. I just looked up the HD447800U and the PCF8574T datasheets (together make the LCD with I2C) and worked from there. In the end, I got the LCD on but could not display characters.

  • Parts w/ wrong specifications: I had mistakenly assumed that PWM would go as far as 5V output when in reality it is lower. My original NMOS gate had too high of a gate threshold and so I had to buy new transistors to get my PWM w/ the fan to work.

  • Software: When interrupted, scanf() will stop recognizing characters, which causes problems when switching between Auto and Self Mode.

Project Completion:

  • PWM Fan: Fan has different speeds based on PWM duty cycle.

  • Temperature Control: Auto Mode allows automatic change to fan speed in response to different temperatures through SysTick interrupts that periodically read temp. and set speed. Querying in Self Mode also changes fan speed depending on temperature (can be commented out if only want temperature display and not speed change).

  • LCD Display: Unfortunately, the original plan for the 16x2 LCD Display did not come to fruition. Current state of the project is using the on-board LCD.

  • User Interaction through Termite: User can query temperature, set speed, and enable auto mode through Termite.

Overall, I got the majority of my project completed and successfully implemented a Temp. Controlled PWM Fan. The only part of my project that was omitted from the final submission was the external LCD which did not affect the functionality. I meet the requirements of two peripherals (fan and temp. sensor) and two communication protocols (I2c temp. sensor and UART Termite). If I had to improve the final submission, I would include the LCD and streamline the switching between modes (change to FSM?).