Sitemap

ESP32-H2 Super Mini with environment sensor, battery voltage reading, e-paper display, and LoRa transmission module (the complete project)

5 min readFeb 28, 2026

--

This tutorial is the final part of a series of articles about the small ESP32-H2 Super Mini (“SM”) development board. In the previous tutorials, I explained all the parts of the project and also built a small circuit that ensures minimal power consumption during the processor’s deep sleep phases. In this tutorial, we’ll now assemble all the parts into the complete project.

Complete setup of the ESP32-H2 Super Mini project
Complete setup of the ESP32-H2 Super Mini project

I strongly advise you to at least skim the tutorials for each part, as I won’t be going into further detail here:

Complete setup

I assembled the project and used the GPIO pins as described in the individual sub-projects. If you power the product solely via the USB connection, you can, of course, omit all battery-related components.

In my setup, I placed the SHT41 environment sensor between the ESP32-H2 Super Mini development board and the LoRa module; for a final setup, I recommend placing it with more distance to both modules.

Explanation of the sketch

Since I’ve outsourced many service functions to the components’ own helper files, the main program is pleasingly short. First, I determine the reason the processor wakes up, because the ePaper display should be completely updated during a cold start. Then I check if there’s a reason for the permanent deep sleep mode, namely a low battery voltage.

Get AndroidCrypto’s stories in your inbox

Join Medium for free to get updates from this writer.

In the next step, the power supply to the LoRa module is activated and the individual components are configured.

The following steps take place in the “loop()” section, although technically this loop is only executed once.

We activate the LoRa module to display incoming LoRa packets (although this isn’t necessary for our original project). Next, we read the values ​​from our SHT41 environmental sensor, as well as the battery voltage and remaining capacity.

In the next step, we combine these values, along with the wake-up reason, a send counter, and the low-voltage counter, into a uint8_t array; we send a total of 25 bytes. After sending, we update the values ​​on the ePaper display and make the onboard LED blink once, then twice more after a 5-second pause.

This pause is artificially inserted to extend the time our board remains awake. This time is solely for the purpose of simplifying the uploading of new versions during development. Without this pause, uploading a new version can be very tedious, as the processor doesn’t accept upload commands in deep sleep. To put the processor into download mode, press and hold the Boot button, press the Reset button once, and then release the Boot button. On a regular development board, there’s enough space, but with our small Super Mini board and the almost completely occupied breadboard pins, you’ll need small fingers or a stylus to be able to press the buttons.

Now comes the section where we prepare the processor for deep sleep: we activate the built-in RTC timer as the wake-up source, put the battery voltage meter into sleep mode, disconnect the LoRa module from power, and set all used GPIO pins to INPUT mode. We then put the processor into deep sleep mode using the “runDeepSleep()” command.

With all modules connected to the processor, I measured a deep sleep power consumption of 0.64 mA—not bad for a cheap development board.

E-paper displaying the measured values of the ESP32-H2 Super Mini LoRa UART module transmitter

On the Serial Monitor, you will find this output data as a 25-byte-long LoRa packet:

txBuffer (25): 04 03 00 00 00 00 80 86 B6 41 B4 0A 54 42 00 00 C6 C2 CD CC 84 40 62 00 FE 
Counter: 3 Temperature: 22.8 C Humidity: 53.0 %rH
Battery voltage: 4.15 v Capacity: 98 % UndervoltCounter: 0

A brief note regarding battery undervoltage detection: The MAX17043 module measures the battery voltage and sends it to ‘BATTERY_MANAGENT.h’. There, in addition to determining the remaining battery capacity, the voltage is also compared to the lower limit of ‘BATTERY_UNDERVOLTAGE_DETECTOR_THRESHOLD = 3.4’. If the voltage falls below this value, the ‘batteryUndervoltageDetectorCount’ increments by one (this value is also displayed at the top of the e-paper display (“UDC: 1”)). After the transmission process, the processor returns to deep sleep to perform the same measurements upon waking. After the fourth wake-up with an excessively low voltage, the ‘isUndervoltageDeepSleep’ flag is activated. Upon the next wake-up from deep sleep, the device immediately enters deep sleep again and remains there until the board is reset.

This measure protects the battery from excessive discharge, but a small quiescent current will still discharge the battery and potentially destroy it. To remedy this, you could, for example, connect another power switch between the battery and the processor to permanently cut off the power supply (or use batteries with built-in undervoltage protection).

Summary

We’ve now reached the end of my tutorial series and have a fully functional LoRa transmitter that reads an environmental sensor and transmits the data via a UART-interfaced LoRa module. For battery operation, the battery voltage is measured and transmitted along with the readings. To extend battery life, the ESP32-H2 processor enters deep sleep mode. The readings are displayed on an e-paper display, which can show the values ​​even during deep sleep. To further reduce power consumption during deep sleep, we use a power switch that interrupts the power supply to the LoRa module during this phase.

I’m aware that this was a relatively long tutorial, but I think the final result is quite impressive.

Source code of the app

You find the complete code of the app in my GitHub repository. Since this is a series of articles, all sketches in this series are compiled in one repository. In this repository you will find zip files with all relevant libraries used in this sketch, in case they are no longer available online.

Back to the overview tutorial “ESP32-H2 Super Mini — Small form factor, big impact (LoRa, ePaper, environment sensor, and battery powered and monitored)”

Happy coding !

--

--