AVR single chip microcomputer used in practical circuit of vehicle air conditioner controller

Publisher:谁与争锋1Latest update time:2020-02-27 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction: The block diagram of the automobile air conditioning control system is shown in Figure 1. The system consists of key scanning, voltage detection, temperature detection, fan control, compressor control, LED digital tube display, buzzer alarm circuit and single-chip microcomputer.


The block diagram of the automobile air conditioning control system is shown in Figure 1. The system consists of key scanning, voltage detection, temperature detection, fan control, compressor control, LED digital tube display, buzzer alarm circuit and single-chip microcomputer.

Figure 1 Block diagram of automobile air conditioning control system


The main working principle of the single-chip microcomputer is: scan the keyboard, when the cooling key is pressed, and there is no fault alarm, the system compares the in-car temperature sampled by the ADC with the pre-set cooling temperature. If the in-car temperature is higher than the set temperature, the condensing fan and compressor cooling are turned on; when the in-car temperature is 2°C lower than the set temperature, the compressor and condensing fan are turned off. If the cold key is pressed at this time, the system will ignore the preset temperature and start cooling directly. Among them, the single-chip microcomputer PB0 and PB1 ports output high and low signals to control the switch of the MOS tube, and then control the start and stop of the fan and compressor; PC0 port samples the input voltage and compares it with the system default value to determine whether the voltage is normal; PC2 port samples the defrost temperature to determine the defrost operation; PC3 port samples the in-car temperature and outputs the calculated result to the LED digital tube display.


System hardware design


1 Introduction to the main control chip


The Atmega8 microcontroller has 8Kb of online programming Flash program memory, 512 bytes of EEPROM, 1Kb SRAM, 32 general working registers, 23 general I/O ports, 3 timers/counters with flexible comparison modes, 18+2 internal and external interrupt sources, 1 programmable SUART interface, 1 I2C bus interface, 4-channel 10-bit ADC, 2-channel 8-bit ADC, programmable watchdog timer, 1 SPI interface and 5 power saving modes selectable by software.


2 Power supply


The system power supply circuit is shown in Figure 2. The DC/DC conversion chip uses MC34063, which has the characteristics of integrated reference voltage, oscillator synchronization and wide input voltage range. Its output voltage can be expressed as Vout=1.25(1+R39/R40), and the output current can reach 500mA, which fully meets the power consumption requirements of this system. In order to reduce interference, capacitors C10, C12, and C13 are added to the input and output ends of the chip for filtering.

Figure 2 System power supply part


3 Voltage and temperature detection circuit


As shown in Figure 3, voltage and temperature detection uses the dedicated ADC sampling channel inside the microcontroller, which does not add additional chips and is conducive to reducing system costs. The ADC reference voltage is equivalent to the microcontroller operating voltage of 5V. The system input voltage is simply filtered by R3 and R8 and sent to PC0 (ADC0). This port continuously samples 21 times according to the voltage division ratio, and then adds the values ​​obtained each time to restore the system input voltage; RT1 and RT2 are negative temperature coefficient sensors. When the temperature rises or falls, their resistance decreases or increases accordingly. The corresponding ADC port performs numerical averaging filtering on the voltage values ​​sampled multiple times and compares them with the known voltage/temperature range to obtain the real-time temperature.

Figure 3 Voltage and temperature detection circuit


4 Keyboard and display circuit


As shown in Figure 4, due to the limited I/O ports of the single-chip microcomputer, the keyboard and display circuit adopt port multiplexing, and the SN74164 serial input and parallel output chip is added to the 3-bit 8-segment LED digital tube driver to further alleviate the pressure of limited ports. The keyboard has 7 buttons, namely, power on/off, cooling/ventilation, forced cooling, setting, up, down, and can be used to set the temperature and fresh air time. The LED digital tube can display the current temperature in the car, the system preset temperature, the input voltage, etc. When the buzzer alarms, it can display the fault code, which provides convenience for maintenance and debugging.

Figure 4 Keyboard and display circuit


5 Output control circuit


The fan and compressor output control circuit is shown in Figure 5. The microcontroller output control signal is reversed by ULA2003 to drive transistor Q2. The collector of Q2 is then connected to the control input of the compressor's start-stop switch relay. When the relay turns from closed to open, the diode D10 is the relay coil. In order to effectively control the conduction and shutdown of the transistor, the system adds a high input voltage and high current ULN2003A driver chip. It uses Darlington internally with a maximum input voltage of 50V and a maximum current of 500mA.


Figure 5 Output control circuit


software design


Program design can be divided into two parts: the main program and the interrupt service program.


The main program includes timer, ADC module initialization, keyboard display processing, buzzer alarm, etc. After the main program is initialized, the system judges whether the input voltage is normal and whether the temperature sensor is short-circuited or open-circuited according to the ADC conversion results. If the above situation occurs, the system will cut off all outputs and give a fault code, otherwise it will display the indoor temperature. Then scan the keyboard and perform corresponding operations according to the key value, such as switching between high, medium and low air volume, cooling on/off, forced cooling selection, cooling temperature setting and fresh air supply time setting.


The interrupt service program includes timer T0 and T1 interrupt service programs. The timer T0 timing time is 1ms. Set variable a. Each time the interrupt subroutine is entered, if the fault flag is valid, a increases by 1. The buzzer is turned on before a is less than 50; when a is greater than 50, the buzzer is turned off and a is cleared. This is done to distinguish the key ring tone. The timer T1 timing time is 1s, which is mainly used for the delay between the compressor and the condensing fan. That is, the time interval between two consecutive compressor openings cannot be less than 6s, and the condensing fan is turned off after a delay of 3s after the compressor is turned off.


Conclusion


This controller is controlled by Atmega8 single-chip microcomputer, with simple circuit structure, stable performance, strong functions, high reliability and low cost. Practical application proves that this controller has strong anti-interference ability and can work stably for a long time in low and high temperature areas. Because it uses a single-chip microcomputer with Flash technology, it is convenient to upgrade online and can be used for the control of automobile air conditioners in economy cars, luxury buses, large trucks, etc.

Reference address:AVR single chip microcomputer used in practical circuit of vehicle air conditioner controller

Previous article:Temperature plotter based on tinyAVR and Nokia3310 LCD
Next article:AVR microcontroller - use of I/O port

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号