1. Three low power consumption modes of stm32
STM32 has three low power consumption modes: sleep mode, stop mode and standby mode.
2. Current consumption of STM32 in different modes
a. Operating mode: the current consumption is between 27ma and 36ma.
b. The consumption current of sleep mode was between 5.5ma and 14.4ma.
c. Stop mode and standby mode: stop mode consumes 15ua; standby mode consumes 5ua
3. Wake up conditions in various low power consumption modes
As can be seen from Figure 1 above, external interrupt can be used to wake up in sleep mode and standby mode, while only the following four ways can be used to wake up in shutdown mode:
a. Rising edge of wakeup pin
b. RTC alarm events
c. External reset on NRST pin
d. Reset of iwdg independent watchdog
4. Project requirements and low power consumption mode selection
The special requirements of the project are as follows:
a. In case of smoke alarm, exit from low power consumption mode at any time, and use WiFi to transmit alarm signal
b. The alarm needs to report its status regularly, so it is time to exit from low power consumption mode.
According to requirement B, the RTC function of STM32 must be used. Therefore, the power selection mode must be standby mode, that is, MCUThe current consumption is about 30 MA in operation and 5 UA in low power consumption mode.
5. Smoke sensor module
The circuit of smoke sensor module mainly uses xc5012 chip. It matches Freescale’s mc145012 pin to pin. The structure block diagram of mc145012 is as follows:
Note the IO pin in the figure above, which is just for expansion. Its detailed definition is as follows:
Its function is to output pulse signal when its own smoke sensor detects smoke. When it is cascaded, it can receive alarm signal from other modules.
The sequence diagram is as follows:
When the chip detects that the smoke alarm condition is met, it outputs a high level on the IO pin until the chip detects that the smoke alarm condition is not met.
6. Connection between smoke sensor and stm32
Due to the constraint of project requirement a, STM32 low-power standby mode must be used, but this low-power mode does not support external interrupt wake-up. Therefore, use the wakeup pin of STM32 to wake up the standby mode.
The reset circuit of STM32 is as follows:
It can be seen from the above figure and actual test that when the system is reset from low power management, the program code will start to run again.
howeverIn the design of hardware circuit, we must distinguish whether the current reset is caused by the rising edge of the wakeup pin (in fact, it is caused by the smoke alarm) or by the RTC alarm clock event (in fact, it is caused by the timing report event).
The interface circuit diagram designed according to the above situation is as follows: