This Teeny-Weeny Dev Board Makes Working with the ESP32 Easy Peasy!

Mike Rankin releases his incredibly well-designed ESP32 IOT — a color screen-enabled, sensor-packed, coin cell-powered development board!

Tom Fleet
3 years agoInternet of Things / HW101

There is a fine balance to be struck when designing a decent development board.

Beyond the core circuit that supports the specific microcontroller that you are looking to gain familiarity with at that moment in time, there are often differing opinions as to what should make the cut for placement on the PCB.

The purists among us will tell you that there is little point in sporting anything other than some unpopulated headers — one for the programming the device, and one or two more to cover the I/O — you supply the pins header, OK?

But what's the harm in a having a few peripherals on the PCB, to play and prototype with? While placing a few extra parts — any parts — is going to incur extra cost, one that is usually to be born by the end user, thankfully these days, a few extra peripherals to play with might not actually break the bank, and can potentially add much more value to the final product than the actual cost of said parts!

We're glad to see that once again, Mike Rankin is back on our screens, with his latest ESP32, coin cell-based development board, packed to the brim with features designed to showcase what an ESP32-powered circuit can do, not only while maintaining a small physical footprint, but also while sipping along on a more than modest power budget. I never thought I'd see too many ESP32 projects powered by a coincell!

ESP32-PICO-D4 - The clue is in the name!

This latest release from Rankin builds on the already diminutive form factor of the popular ESP32-PICO-D4, from Espressif Systems.

The PICO-D4 is a bit more than just an ESP32, however. But what's special about it compared to the standard ESP32 parts? Well, there's more to getting an ESP32 up and running than just laying out the MCU alone.

You usually need some flash for program code storage. There'll be a need for a crystal oscillator, to provide a stable time base for the Wi-Fi / BLE functions. And then there is the fun of having to lay out the RF path of the circuit, taking into account any matching needed there.

Or, you could pick the PICO-D4, which somehow manages to cram everything we've just mentioned in the above paragraph into a single, 7mm x 7mm QFN package. That's an impressive feat of engineering, and can lead to some significant board real estate savings.

The Pixelblaze, shown below, is a beautiful example of what sort of reduction in size is possible when using the PICO-D4, with the D4 variant shown on the left, in comparison to a larger module form factor.

With the ESP32 circuitry reduced to less than a square centimeter, Rankin is free to pack out every other square cm on the board with oodles of peripherals to play with! Let's take a quick look at what's in store for us.

Picture Perfect Pixels

Perhaps the most predominant part placed on the front face of the PCB is the largest one — the 80 x 160 pixel RGB TFT LCD. This panel of pixels is capable of displaying brilliant bitmaps, glorious GIFs, or pixel perfect plots of graphed data, sampled from the on-board sensor suite!

With very similar displays available from our friends at Adafruit, we can look to their product pages to get a vivid impression of the sort of color depth we can expect from this display, and frankly, they look beautiful!

With so many pixels (13,440 to be precise!), in RGB color, even 16-bit format, where an RGB color value is represented in 16-bits of data — five bits for red, six bits for green, and another five bits for blue — a full-color, full-screen image still works out at just over 215kB of data!

With so many bits to chuck about, we're happy to see that this screen implements a SPI interface for talking to an external controller. With on-board SPI buses routinely hitting speeds in the tens of MHz, even on our hobbyist creations, using SPI here means that the ESP32 will have no trouble slinging signals at the speeds required for seamless, smooth animations — as is clearly evident from the GIF you saw back at the start of this article.

Ever wanted a keychain that can show you the latest memes and GIFs, skimmed fresh from the pages of Imgur, et al? Now you can do just that! Your meme game has never looked so strong!

Keeping your distance...

These days, social distancing is the name of the game — "please keep at least 1m from yourself wherever possible..." — or where not possible, just give others as wide a berth as possible, right?

It can get pretty tiring having to cart around a calibrated prodding stick, measured to length to match the recommended isolation distance — there must be an easier, simpler way to keep tabs on your ever eroding personals space these days...

Turns out there is a much easier way — with the very fancy range of Time-of-Flight sensors from STMicroelectronics, which includes the more-than-capable VL53L0X laser rangefinder.

Making use of a whole range of acronyms, these parts utilize VCSELs and SPADs to effectively measure the time taken for photons emitted from the device to reflect off an object located within the sensors field of view, and travel back to the sensor with the round trip time and speed of light being used to calculate the distance to the object.

What only a decade ago would have required a small optics table, is now crammed into a single, optically integrated LGA package, some 4.5mm x 2.5mm wide, and merely a single mm tall. With the entire system abstracted to an I2C interface, you can obtain mm-precision distance data with only a few simple register reads. Incredible really!

With an absolute range of 2m, I'd suggest that such distance is enough to reasonably effect an alert, should anything crop up within the sensors field of view.

WHO keeps opening this window?!

Although working from home is all the rage these days, the rage of some of the old office habits keeps on going — not least the age-old argument of whether the window should be open or closed. You know how it is, your "co-worker" is cold blooded, but also immune to the smell of the fish they had for lunch...

Thankfully, you can get a little bit of backup for your side of the argument — maybe by citing the temperature or relative humidity readings that this board is able to measure — thanks to the inclusion of a HDC1080 solid-state Temp/ (%) Rh sensor, from Texas Instruments!

With a range of 0-100% RH (±2% typ.) and a very respectable accuracy of ±0.2 °C across the entire temperature measurement range of -40 °C to +125 °C, this tiny 3mm ^2, 6 — pinned WSON packaged I2C device is more than capable of keeping tabs on both indoor and outdoor environmental conditions — perfect for settling that argument over the heating, once you decide on the correct position of that window!

Busting some moves...

Motion-based interfaces are pretty much second nature to users these days, with things like shake-to-clear, or auto-orientation of a display happening without much consideration on the part of the user.

These interfaces are often formed around data sampled from an accelerometer, and additionally, supplemented by readings from a gyroscope — the combination of acceleration and rate of angular change comprises the two measurements needed to derive the pitch, roll and yaw of a device.

More often than not, these two measurement devices are often co-packaged as a single unit, sometime also with an integrated MCU, that will take care of fusing the two sensor readings into the pitch, roll and yaw readings that are desired by the user.

While the LIS3DH from STMicroelectronics that Rankin has chosen for his board is the former of this category of integrated devices — in that it doesn't feature the embedded processor for on-board sensor fusion — that's of little concern when the main board is based around the powerhouse that is the ESP32. A 32-bit core clocked at 240MHz will make very short work of those calculations!

The Usual USB Converter IC

While there isn't yet, at the time of writing, a PICO-D4 variant of the latest ESP32, the S2 — with its native on-board USB interface getting USB communications with the PICO-D4 — is just a matter of adding the CP2014N USB-Serial converter IC from Silicon Labs.

With most of the pads marked as "No Connect," this super-simple schematic implementation is found on nearly every ESP32 development board we've seen to date.

This part has gained popularity with the ESP32 crowd, owing to its ability to use its DTR and RTS RS232 handshaking signal lines to sequence the ESP32 I/O during a reset. This enables it to automatically reset the ESP32 device into bootloader mode before continuing with programming operations — removing the need to push and poke the BOOT/MODE pins every time you make a code change.

Indeed, this potentially even allows you to forgo the tactile switches that would otherwise be required on the board — saving BoM cost and perhaps more importantly, the significant physical footprint of a human operable switch.

Touch it, bring it, pay it, watch it, turn it, leave it, stop, format it.

I don't think found a more apt lyric for an article heading to date!

Short of contactless payment, this board can do most all else of those, and perhaps we should make sure we don't gloss over the opening action of "touch it."

Looking at the row of ESP32 I/O along the bottom of the schematic symbol, we can see that on pins 16, 18, 21 & 22, there are some suggestively named net labels...

Tracing through the rest of the single page schematic, we find that these nets terminate in a rather simple copper pad.

While it may not look like much from the perspective of a schematic view, the pads connected to these four nets are the human-facing end of some capacitive sense touch pads, dotted along the bottom edge of the board.

You can make out the touch sensing pads as the rounded rectangles named TOUCH_1 through TOUCH_4. That's all that's needed for the ESP32 to implement touch sensing — a bit of copper, wired to a capable I/O pin. You can't get a much cheaper HMI element than one requiring only a bit of copper pour on your PCB!

It's also a relief to see that it doesn't appear that any special layout or tracking is required for this system to function. I've laid out touch sense arrays in the past that used dedicated IC parts, and from what I recall, the application guidelines were not anywhere near as forgiving as the layout used here.

Power path management and Li-Po pack protection

When designing a device that has multiple power sources (USB, DC barrel jack, or even battery), it can sometimes get tricky keeping track of what supply rails you have present. Beyond safely figuring out how to prioritize which one takes preference in supplying the circuit power, care and attention must also be made to protect the various power sources against accidental shorts, or other over/under voltage events — you don't want to feed your PC's USB port with 12V when you plug in an external PSU, do you?

While there are dedicated parts that will deal with this selection process — often referred to as power path prioritization, similar protection can be accomplished with a well laid out circuit, and a skillfully placed P-FET.

With the P-FET placed in the schematic above, we can see that when the gate is fed with VUSB, the device will be blocked from passing current between the drain and the source, effectively isolating the battery from the input to the HT7833 voltage regulator.

This doesn't stop the battery from being charged by the SL4054 Lithium Ion battery charger, which can be seen placed underneath the HT7833 in the schematic view above. Take note of D1, which serves to stop the battery supply trying to feed the devices requiring 5V — namely the battery charger itself!

With the power path priorities sorted by a single P-FET, system regulation and even charging of the battery all taken care of, there is only one IC left to draw attention to in this segment of the circuit, and that is the DW01A — an over/under voltage protection device, that serves to isolate the lithium polymer cell itself, in the unlikely event the charger fails, and dumps 5V into the pack, or more likely, to stop the 3.3V LDO draining the pack far below the typical safe cut-off voltage of some 2.7-2.8V typ. (allowing for an acceptable safety margin).

While we typically don't see these ICs very much, they are still commonly used — generally residing instead inside the Li-Po packs themselves. However, not every pack will be fitted with such a safety device, and there is no harm or deficit in operation from using two of them - one on the cell and one on the board - Indeed, that's worth the cost for not running the risk of a polymer pack going "pop!"

Wrapping it up...

As always, Rankin shows us how a build pack should be supplied, with complete design sources, fabrication prints, a BoM, and much much more all freely supplied on the project's GitHub repo here.

For those who would rather lay down the dollars, and have a fully assembled board delivered straight to their door, Rankin has a number of fully populated board available for purchase on his Tindie page!

We can also recommend following Rankin on Twitter, where he is always up to something interesting with the ESP32, or more recently, breaking in the versatile nRF52 range of BLE capable MCU, from Nordic.

A footnote on filetypes

While Rankin is a big fan of Altium (as I'm sure many of us would be, if it were priced more in-line with other competitive EDA solutions...), that can pose a problem for modifying and editing the design sources. Unless you have an Altium sales rep who will spot you a month-long evaluation license...

However, the pace at which KiCAD and the development efforts associated with it, is developing is frankly phenomenal.

A single Google search shows that there are already projects working to further bolster the functionality of the free EDA suite, including the very polished Altium -> KiCAD converter service, hosted online, or as a standalone utility.

(We would suggest that if you have the ability to, it would be a good idea to run this tool offline / self hosted. This sort of service looks like it could cripple most hosting packages, if used relentlessly!)

Altium project zip file goes in one end, and almost immediately, you are presented with an output zip file archive, with a complete KiCAD translation. Impressive, and very handy!

Tom Fleet
Hi, I'm Tom! I create content for Hackster News, allowing us to showcase your latest and greatest projects for the world to see!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles