Skip to content

An STC89C52-Microcontroller-based and PID-powered intelligent cooling system.

License

Notifications You must be signed in to change notification settings

a-w-1806/Intelligent-Cooling-System

Repository files navigation

Intelligent Cooling System

An STC89C52-Microcontroller-based and PID-powered intelligent cooling system.

board

Hardware Connections

hardware

  • STC89C52: 8-bit Microcontroller

    • ROM: 8K bytes flash
    • RAM: 256 bytes, so we need two hex numbers for addressing.
  • HD7279A: used to connect to LED and keyboard.

  • DS18B20: temperature sensor (温度采集)

  • 24C16: A 16K E2PROM (Electrically Erasable Programmable Read-Only Memory)

    • It can store data even without electriciy, which is different from RAM.
  • PC: Personal Computer, which is used to load the program, and print the temperature curve on the screen (bonus!).

  • Other

    • Keyboard (键盘)

      • Each button in the above picture is treated as a key as follows:

        keyboard
      • Support fast value change while holding the button pressed.

    • LED

    • Motor (电机运行), which is used to drive a cooling fan.

Functionalities

menus

  • tP-: temperature sensing
  • run-: tests for the motor
  • Con-: motor speed change according to the temperature sensed
  • PId- (bonus!): adjust the speed of the cooling fan to keep the surrounding temperature at a user-given value
  • PA-: settings for parameters
    • Password Authentication (bonus!)
  • 进入子菜单:entering the sub menus

tP-: Temperature Sensing

Pressing ↵ when the LED shows tP- on the top row to use this functionality. The top row should still show tP- but the bottom row shows the current temperature with two decimal places.

tP

run-: Tests for the Motor

After entering this menu, you can select one of the r-1 to r-10 test cases (which can be set up in PA- menu) to test your motor. Each test case is represented by a number which indicates duty cycle. After navigating using ↑ and ↓, and choose a test case using ↵, a PWM (Pulse Width Modulation) wave with this duty cycle will be generated and used to drive the motor.

run

Con-: Motor Speed Change according to the Temperature Sensed

Calculate the duty cycle and generate the corresponding PWM wave on the fly using the following equation:

equation

in which:

  • Tdown and Tup is the upper and lower threshold of temperature, which can be set up in PA- menu.
  • Tnow is the current surrounding temperature.

Top LED shows the current temperature, and the bottom one shows the calculated PWnow:

control

PId- (bonus!): Adjust the Speed of the Cooling Fan to Keep the Surrounding Temperature at a User-Given Value

Given a temperature (which can be set up in PA- menu), the duty cycle is computed using PID controller. The proportional, integral and derivative terms are set in the source code. The goal is to keep the surrounding temperature at a given value through adjusting the speed of the cooling fan. Top LED shows the current temperature, and the bottom one shows the calculated PWM duty cycle:

pid

PA-: Settings for Parameters

This is where you can set the parameters used in previous functionalities.

Each time you want to change the parameters of PID, you are required to input a password which is set in the source code, or you will not be able to get in.

Plotting the Temperature Curve on Your Computer!

Prerequisites:

  1. The system is connected to your PC.
  2. Set serial port number to COM3.
  3. Python environment is ready.
  4. Type in the command line:
python plotting.py

You should see a temperature curve pop up, and refresh in real time:

plot

About

An STC89C52-Microcontroller-based and PID-powered intelligent cooling system.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages