“This article analyzes the low-power software and hardware design methods in detail, and choosing different working modes under different tasks is of great significance to reducing power consumption. After using proper software and hardware measures, the battery life of the designed portable controller module reaches about half a year, which meets the application needs of the wireless sensor network system. The low-power design methods and ideas in the article have a certain reference value for the development of actual products.
Author: Zhang Kefan Wang Xifeng Zhang Shuhua Li Ying
1 Low-power design of the controller module based on IA4421
1.1 Low power consumption design of portable module node hardware
(1) Processor selection
ATmega324p is a powerful single-chip microcomputer, which provides a flexible and low-cost solution for many embedded control applications:
① TQFP (Thin Plastic Quad Flat Package), small size, high integration;
②6 power saving modes that can be selected through software;
③Up to 20MIPs throughput rate (under 20 MHz).
(2) Low power consumption design of interface circuit
The low-power design of the interface circuit is often a link that is easily overlooked. In this link, first choose a low-power peripheral chip, and then the fundamental method is to make the interface circuit normal in a low-power state. In addition, the following two factors should be considered:
① Selection of pull-up resistor/pull-down resistor. In the case that the latter stage can be driven normally, choose a larger resistance value as much as possible. In addition, when the signal is low in most cases, you can also consider using a pull-down resistor to reduce power consumption.
② Treatment of dangling feet. The input impedance of the floating CMOS input terminal is extremely high, which may induce some charges to cause the device to be broken down by high voltage, and it will also cause the signal level of the input terminal to change randomly, causing the CPU to be constantly awakened during sleep and thus cannot enter the sleep state. Or cause other inexplicable failures. So the correct way is to connect the unused input terminal to the power supply VCC or ground.
(3) Selection of communication chip
IA4421 is an integrated radio frequency transceiver chip launched by Integration Associates, which works in the 433/868/915 MHz frequency band. The chip’s operating voltage is 2.2 to 5.4 V, low power consumption mode, standby current of 0.3 μA, FSK modulation mode, transmitting power of 5 to 8 dBm, and receiving sensitivity of -109 dBm.
IA4421 has high data transmission rate, the transmission rate of digital signal can reach 115.2 kbps, the transmission rate of analog signal can reach 256 kbps.
1. 2 portable controller low power consumption software design
(1) Conversion of various power consumption modes
The portable controller is composed of ATmega324p, IA4421 and Samsung’s LCD and peripheral circuits in hardware. Taking the portable controller as a whole, four different working modes are defined, as listed in Table 1. Different working modes are determined by the working mode combination of related function chips on the portable controller.
①The reason why ATmega 324p chooses Power-save mode: In Pow-er-save sleep mode, except for all functions in Power-down mode, Timer/Counter2 can work normally, so in Power_save sleep mode, the real-time clock system of the system It can run normally, which also provides conditions for the timing wireless transceiver in the system power consumption test.
②Working process of wireless transceiver based on power consumption mode conversion: When the portable controller does not receive and send tasks, it enters sleep mode, that is, LCD turns off, ATmega324p is in Power-save mode, and IA4421 is in SLEEP mode. In practical applications, the portable controller should be in sleep mode for the longest time.
If the user has the requirement to transmit data, the portable controller can wake up the controller through the button, asynchronous timer 2 (real-time clock) and the external interrupt signal (INT2) generated after receiving the signal from the host, and perform the related operations of sending and receiving. After the task is completed, enter the sleep mode again.
(2) Low-power keyboard software design
PortA, PortB, PortC, PortD of ATmega 324p altogether have 32 I/O mouths, each I/O mouth is an external interrupt source. When a level transition is detected on the port, an external interrupt (PCINT) can be generated. This function makes the number of external interrupt ports of the controller no longer limited. The 6 interfaces of the 3×3 keyboard can be connected to the ordinary I/O ports to realize the interrupt button. The interrupt button has the following advantages in this system:
①The interrupt key program does not require the controller to be in the scanning operation state all the time, which greatly reduces the power consumption compared with the keyboard scanning program in Polling mode.
②The interrupt button program can wake up the controller by generating an interrupt by pressing the button, which is convenient for the system to switch between various modes without affecting the system functions. The detailed keyboard system software design process is shown in Figure 1.
2 Low-power experiment and result analysis
2.1 Power consumption experiment of ATmega324p small system
The ATmega324p small system includes the ATmega324p microcontroller, Samsung’s S6B0741 LCD module, and power supply (5 V, 2.5 A power adapter). The wireless communication chip is not added to the minimum system power consumption experimental system.
(1) Theoretical value of current consumption
ATmega324p works at 8 MHz frequency and LCD (S680741) works in open Display (backlight off), sleep mode and close LCD (S680741) when the current consumption theoretical values are listed in Table 2.
(2) The measurement of the actual current value of the minimum system in different working modes. Download the C program in the system to measure the current consumption of the system in different combination modes. The test environment is in the laboratory, the temperature is about 20℃; use a multimeter and 100 Ω resistor, ICCAVR development environment, STK500 downloader to download.
Connect a 100 Ω resistor in series with the total power interface of the portable controller, measure the voltage value on the resistor in different system modes, and then calculate the current value. The comparison result of the test value and the theoretical value is listed in Table 3.
(3) Analysis of experimental results
①LCD module mainly includes control chip and LCM (display). In the theoretical value, the theoretical current value of the LCD (S6B0741) does not include the current consumed by the LCM (display). When the LCD is turned on and the ATmega324p is in Idle mode and normal working mode, there is a difference of approximately 3 mA between the theoretical value and the actual measured value. It can be concluded that the current of 3 mA is the approximate current consumed by the LCM (display).
②The actual measured current value is larger than the theoretical value. This difference in energy consumption is mainly consumed on the peripheral circuit of the portable controller module. The theoretical current consumption value of each Electronic component in the peripheral circuit is difficult to find, and it is not added in the calculation.
③Although the measurement method is very simple, the measurement is only the static value of the system current, but the measured current value can roughly reflect the power consumption trend of the system under different working conditions, and there is a certain degree of research on the low power consumption of the system. Meaning and application value.
④ It can be seen from the comparison of actual test results in various working modes that the difference between the minimum energy consumption and the maximum energy consumption of the minimum system is about 10 mA. Therefore, in a low-power design, the conversion of different working modes under different functional requirements is very meaningful.
⑤The difference between the current consumption of the LCD module’s backlight turning on and the backlight turning off is about 6 mA. It can be seen that the LCD backlight is a very energy-consuming device in the system. Therefore, from the perspective of energy saving, the LCD backlight is generally not turned on under normal conditions.
2.2 Portable controller low power consumption test experiment
In order to verify the power consumption performance of the portable controller, after taking the above-mentioned software and hardware low power consumption measures, the following experiments were done on the power consumption performance of the portable module. The verification result shows that the designed module basically meets the application requirements of the system in terms of power consumption.
(1) Experimental content
① Use ATmega324. Timer 2 of p carries out regular sending and receiving, sending and receiving data once every 2.5 hours, and sending data 9 times a day.
②At the time when there is no sending and receiving tasks, ATmega324p is in the low-power sleep state Power-save, the LCD module is turned off, and the IA4421 works in sleep mode. It can be seen from the above small system power consumption experiment that the entire portable module consumes the lowest energy under such working conditions. The software flow of the test is shown in Figure 2.
③The wireless communication parameters of IA4421 are: working frequency band 433 MHz, data transmission rate 9.6 kbps, relative transmitting power 0 dBm, receiving sensitivity -109 dBm. Such parameter selection, under the condition that the system’s transceiver function is normal, use low frequency band and low transmission rate as much as possible, in order to meet the long-distance transmission and reduce the power consumption of transmission and reception as much as possible.
④Use 3 AAA alkaline high-energy batteries to supply power, and the battery voltage is 4.86 V at the beginning of the test.
(2) Experimental results and significance
The test system is designed for point-to-point communication between the portable controller and the host. The experimental results are listed in Table 4.
Communication is carried out every 2.5 hours. This communication frequency has a good simulation of the frequency of users using this system. It can be seen from the experimental results that the battery life is about 5 and a half months, and it is the result of the test on the basis of 10 communications per day. This indicator of battery life basically meets the requirements of system design, and also proves that the above-mentioned software and hardware measures are appropriate and effective.
This article analyzes the low-power software and hardware design methods in detail, and choosing different working modes under different tasks is of great significance to reducing power consumption. After using proper software and hardware measures, the battery life of the designed portable controller module reaches about half a year, which meets the application needs of the wireless sensor network system. The low-power design methods and ideas in the article have a certain reference value for the development of actual products.