Using Existing Firmware

Flashing An ESP32 With Off-The-Shelf Firmware

In this first step my goal is a proof of concept: getting a fully functional CO2 meter with minimum effort.

Selecting Firmware & Hardware

CO2 Gadget offers five firmware versions targeting different microcontroller boards.

Selecting Firmware Version

I opted for the generic esp32dev_OLED firmware which runs on a standard ESP32 development board and comes with support for a standard 128x64 pixel OLED display:

  • Generic Board: I explicitly avoided the TTGO firmware versions that target a specific microcontroller board with built-in display. The goal was to work as much as possible with cheap standard components.
  • Using Display: Even though I don’t plan to use a tiny OLED display in the final device, for testing it is crucial to have a built-in display. It makes it much easier to see whether or not everything works as designed.

Checking GPIO Pins

Here are the pins that the selected firmware is using:

GPIO Feature
21/22 I2C
15/0 Up/Down Button
32 Orange LED
33 Red LED
2 Buzzer
26 NeoPixel LED

I then compared these pins with the ESP32 DevKitC V4 microcontroller breakout board that I intended to use.

Since I2C can be assigned to basically any pin on ESP32, it was important to check whether the pins used by the firmware were actually exposed at all on the breakout board. Which was the case.

Interesting boards like the ESP32-S2 Mini or the ESP32-C3 SuperMini do not expose all of the pins needed, so when a pre-compiled firmware is to be used, this significantly reduces the hardware choices.

Figuring Out Circuitry

CO2 Gadget is amazing but also somewhat disorganized: a wealth of information is presented, but not necessarily in the order in which an external person would approach such a project.

The firmware pin list already suggests the circuitry. More detailed information is available as part of a separate project that focuses more on the hardware part. It points to a (Spanish) YouTube video. Thanks to auto translate, it is simple to follow.


Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.

Here is how your comments are stored

Whenever you leave a comment, a new github issue is created on your behalf.

  • All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.

  • There is no third-party provider, no disrupting ads, and everything remains transparent inside github.

Github Users Yes, Spammers No

To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant the permission to submit issues on your behalf.

If you don’t have a github account yet, go get yourself one - it’s free and simple.

If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.


For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.

  Show on Github    Submit Issue

(content created Jun 04, 2024)