ESP32 with sensors

ESP32 with several sensors on a breadboard

A couple of months ago, I decided to get myself started with microcontrollers like the Arduino and the ESP32.

A first glance, these may look like low power Raspberry Pis, but they are actually very different and they serve a totally different purpose…

Rasberry Pi Arduino & ESP32
Price $50-$100 $5-$10 (when ordered from China)
Example usages - Computer for kids
- Media Center
- Retro Gaming
- Home Assistant
- Electronic toy
- 3D printer main board
- IoT Device
OS Runs a full fledged Linux Super thin OS (Realtime OS)
Programs Runs multiple programs, several in parallel Runs a single program, no multitasking
RAM Measured in Giga Bytes Measured in Kilo Bytes (Arduino) to Mega Bytes (ESP32)!!
Output Either attach a screen through HDMI or act as a server There is no HDMI. If you want a screen, you need to start with adding a physical controller for a screen…
Porgramming lanuage Anything you want, powerful enough for scripting languages like Python. Arduino is basically C++ only. ESP32 might use some lightweight versions of Python, but C++ is still better suited

In terms of computing power, an Arduino is basically comparable to an 8-bit computer from the 80ies (without video output) whereas an ESP32 is already more powerful than a 16-32 bit computer from the 90ies! So small, so cheap, yet more powerful than the Atari ST I used to have. Mind bending…

In my case, I as happy to dust off my C & C++ “skills”… It sort of felt like coming back to my roots… But I have to admit, it can get quite frustrating, once one is used to the comfort of Python!

I quickly outgrew the Arduino and its 2 kB of RAM (this really limits the number of variables, especially strings…) and I’m now using mostly ESP32 development boards… Many of these boards come without pins. So, if you want to use them on a breadboard (as on the photo above), you have to start by soldering on some pins…

ESP32 with unsoldered pins

ESP32 out of the bag, with unsoldered pins

So… I was also happy to dust off – this time literally!! – my electronics equipment… starting with my soldering iron ;)

First useful project

Fast forward a couple of weeks and I built my first useful prototypes, like the one with all the colors wires you see above. It may look a bit messy for now but it’s a marvel of technology for under $50!

Here’s what it does:

  • It measures CO2 in real time
  • It measures Particulate Matter (PM1, PM2.5, PM10) in real time
  • It measures VOCs (and other environmental factors like Temperature & Relative Humidity)
  • It computes some more in real time (like Absolute Humidity)
  • It sends its measurements over Ethernet to an MQTT Broker (which in turn forwards the data to Home Assistant)
  • It is powered over ethernet (PoE), so it needs only a single cable from power & data!
  • It also has a little OLED screen for good measure (pun not intended) but I see it mostly as a debugging tool.
  • I also have a “breathing” LED to show that the program is still running and did not crash (I had some bugs in the beginning ;)

By the way, let’s also list what it does NOT do:

  • It does NOT make noise
  • It does NOT emit WiFi nor Bluetooth

And what it does but should NOT do:

  • It has some bright blinking lights on Ethernet activity. I have to go desolder those but they are super small surface mount (SMD) components and I have not enough spare boards yet in case I destroy the board in the process.

Then I did some more…

I might make a video if I find the time ;)