Experiment 2
To aim
To run an MCU in low power mode, read temperature, pressure and humidity readings using the AHT10 and BMP280 sensors and send the readings over Wi-Fi.
Requirements
- UCM: ESP32-WROOM-32D (generic Wi-Fi + Bluetooth + Bluetooth LE MCU module)
- Temperature/humidity sensor: AHT10 (temperature and humidity sensor)
- Pressure and altitude sensor: BMP280 (Absolute Barometric Pressure Sensor)
- Battery: KP 903048 (3.7V, 1000mAh)
Theory
In this experiment, we are using ESP32-WROOM-32D MCU. The ESP32 will remain in active mode for 6 seconds, reading temperature and humidity and sending it via WiFi. It will remain in deepsleep mode for 5 minutes. After this time, the ESP32 will return to deep sleep mode.
Schematic
Experiment Setup
Below showing the image is the experiment setup:
Code
Observation
Below is the image showing the MCU sleep and active mode results. So, we can see that the sleep time is 5 minutes and the active mode remains for approximately 6 seconds. In six seconds, the entire device consumes a current of about 120mA.
In sleep mode, the device consumes 10-150 uA of current.
Below are images showing the current consumption of the device from sleep mode to active mode. Reaches ~122mA current in active mode.
Now the battery capacity is 1000mAh. Solar will charge the battery whenever it gets low and this device will work for a long time.
The current consumption when the solar charges the battery is shown below.
Current consumption when charging the battery is about 47mA.
Battery life: If we do not use solar energy to charge the battery, the battery life will be about 16 days.
Results
Below are the results of the data the device sent to the ThinkSpeak platform
- When the device is away from the sun, it means there is no solar charging.
- The temperature remained below 31 degrees Celsius while the device was placed inside the building.
- The battery power consumption is shown, which is between 450-500 mW.
- Solar energy is zero because the device was inside the building and no charging is done.
When solar energy charges the battery:
- The temperature rose above 50 degrees Celsius when the device was placed outside the building.
- When the aolar charges the battery, the power consumption is shown in the analysis above.
So, this was the experiment where the MCU's deep sleep mode was performed. Data and results show that deep sleep mode helps reduce power consumption.