SIMD-Accelerated Computer Vision On The ESP32-S3

One of the fun parts of the ESP32-S3 microcontroller is that it got upgraded to the newer Cadence Xtensa LX7 processor core, which turns out to have a range of SIMD instructions that can help to significantly speed up a range of tasks. [Shranav Palakurthi] recently used this to speed up the processing of video frames to detect corners using the FAST method. By moving some operations that benefit from SIMD over to an optimized version written in LX7 ASM, the algorithm’s throughput was increased by 220%, from 5.1 MP/s to 11.2 MP/s, albeit with some caveats.

The problem with the SIMD instructions in the LX7 other than them being very poorly documented – unless you sign an NDA with Cadence –  is that it misses many instructions that would be really useful. For [Shranav] the lack of support for direct misaligned reads and comparing of unsigned 8-bit numbers were hurdles, but could be worked around, with the results available on GitHub.

Much of the groundwork for this SIMD implementation was laid by [Larry Bank], who reverse-engineered the SIMD instructions from available documentation and code samples, finding that the ESP32-S3 misses quite a few common SIMD instructions, including various shifts and unaligned reads and writes. Still, it’s good enough for quite a few tasks, as long as you can make it work with the available instructions.

Showing a Raspberry Pi 4 board connected to an ESP32 devboard using jumper wires for the purposes of this project

ESP-Hosted Turns ESP32 Into Linux WiFi/BT Adapter

While we are used to USB WiFi adapters, embedded devices typically use SDIO WiFi cards, and for good reasons – they’re way more low-power, don’t take up a USB port, don’t require a power-sipping USB hub, and the SDIO interface is widely available. However, SDIO cards and modules tend to be obscure and proprietary beyond reason. Enter ESP-Hosted – Espressif’s firmware and driver combination for ESP32 (press release)(GitHub), making your ESP32 into a WiFi module for either your Linux computer (ESP-Hosted-NG) or MCU (ESP-Hosted-FG). In particular, ESP-Hosted-NG his turns your SPI- or SDIO-connected ESP32 (including -S2/S3/C2/C3/C6 into a WiFi card, quite speedy and natively supported by the Linux network stack, as opposed to something like an AT command mode.

We’ve seen this done with ESP8266 before – repurposing an ESP8089 driver from sources found online, making an ESP8266 into a $2 WiFi adapter for something like a Pi. The ESP-Hosted project is Espressif-supported, and it works on the entire ESP32 lineup, through an SDIO or even SPI interface! It supports 802.11b/g/n and even Bluetooth, up to BLE5, either over an extra UART channel or the same SDIO/SPI channel; you can even get BT audio over I2S. If you have an SPI/SDIO port free and an ESP32 module handy, this might just be the perfect WiFi card for your Linux project!

There are some limitations – for instance, you can’t do AP mode in the NG (Linux-compatible) version. Also, part of the firmware has blobs in it, but a lot of the firmware and all of the driver are modifiable in case you need your ESP32 to do even more than Espressif has coded in – this is not fully open-source firmware, but it’s definitely way more than the Broadcom’s proprietary onboard Raspberry Pi WiFi chip. There’s plenty of documentation, and even some fun features like raw transport layer access. Also, of note is that this project supports ESP32-C6, which means you can equip your project with a RISC-V-based WiFi adapter.

Title image from [zhichunlee].

An Easy Transparent Edge Lit Display

Displays are crucial to modern life; they are literally everywhere. But modern flat-panel LCDs and cheap 7-segment LED displays are, well, a bit boring. When we hackers want to display the progress of time, we want something more interesting, hence the plethora of projects using Nixie tubes and various incantations of edge-lit segmented units. Here is [upir] with their take on the simple edge-lit acrylic 7-segment design, with a great video explanation of all the steps involved.

Engraving the acrylic sheets by hand using 3D printed stencils

The idea behind this concept is not new. Older displays of this type used tiny tungsten filament bulbs and complex light paths to direct light to the front of the display. The modern version, however, uses edge-lit panels with a grid of small LEDs beneath each segment, which are concealed within a casing. This design relies on the principle of total internal reflection, created by the contrast in refractive indices of acrylic and air. Light entering the panel from below at an angle greater than 42 degrees from normal is entirely reflected inside the panel. Fortunately, tiny LEDs have a wide dispersion angle, so if they are positioned close enough to the edge, they can guide sufficient light into the panel. Once this setup is in place, the surface can be etched or engraved using a CNC machine or a laser cutter. A rough surface texture is vital for this process, as it disrupts some of the light paths, scattering and directing some of it sideways to the viewer. Finally, to create your display, design enough parallel-stacked sheets for each segment of the display—seven in this case, but you could add more, such as an eighth for a decimal point.

How you arrange your lighting is up to you, but [upir] uses an off-the-shelf ESP32-S3 addressable LED array. This design has a few shortcomings, but it is a great start—if a little overkill for a single digit! Using some straightforward Arduino code, one display row is set to white to guide light into a single-segment sheet. To form a complete digital, you illuminate the appropriate combination of sheets. To engrave the sheets, [upir] wanted to use a laser cutter but was put off by the cost. A CNC 3018 was considered, but the choice was bewildering, so they just went with a hand-engraving pick, using a couple of 3D printed stencils as a guide. A sheet holder and light masking arrangement were created in Fusion 360, which was extended into a box to enclose the LED array, which could then be 3D printed.

If you fancy an edge-lit clock (you know you do) check out this one. If wearables are more your thing, there’s also this one. Finally, etched acrylic isn’t anywhere near as good as glass, so if you’ve got a vinyl cutter to hand, this simple method is an option.

Continue reading “An Easy Transparent Edge Lit Display”

ESP32 Powers Single-PCB ZX Spectrum Emulator

When word first got out that the Chinese board houses were experimenting with full color silkscreens, many in our community thought it would be a boon for PCB art. Others believed it would be akin to cheating by removing the inherent limitations of the medium. That’s not a debate that will be solved today, but here we have an example of a project that’s not only making practical application of the technology, but one that arguably couldn’t exist in its current form without it: a single-PCB ZX Spectrum emulator developed by [atomic14].

There basics here are, well, they’re pretty basic. You’ve got an ESP32-S3, a TFT display, a micro SD slot, and the handful of passives necessary to tie them all together. What makes this project stand out is the keyboard, which has been integrated directly into the PCB thanks to the fourteen pins on the ESP32-S3 that can be used as touch sensor input channels. There are issues with detecting simultaneous keypresses, but overall it seems to work pretty well.

Continue reading “ESP32 Powers Single-PCB ZX Spectrum Emulator”

PCB Design Review: ESP32-S3 Round LCD Board

For our next installment, I have a lovely and daring PCB submitted by one of our readers, [Vas]. This is an ESP32-S3 board that also has an onboard round TFT display, very similar to the one we used on the Vectorscope badge. The badge is self-sufficient – it has an ESP32, it has a display, a programming connector, two different QWIIC ports you could surely use as GPIOs – what’s not to love?

This is a two-layer board, and I have to admit that I seriously enjoy such designs. Managing to put a whole lot of things into two layers is quite cool in my book, and I have great fun doing so whenever I get the opportunity. There’s nothing wrong with taking up more layers than needed – in fact, if you’re concerned about emitted/received noise or you have high-speed interfaces, four-layer is the way to go. But making complex boards with two layers is a nice challenge, and, it does tend to make these boards cheaper to manufacture as a very nice bonus.

Let’s improve upon it, and support [Vas]’s design. From what I can see looking at this board, we can help [Vas] a lot with ease of assembly, perhaps even help save a hefty amount of money if they go for third-party PCBA instead of sitting down with a stencil – which you could do with this board pretty easily, since all of the components on it, save for the display, are the ones you’d expect JLCPCB to stock.

Continue reading “PCB Design Review: ESP32-S3 Round LCD Board”

Single-Button Keyboard Has Multiple Uses

Well now why would I want a single-button keyboard, you might be asking yourself. We say it all depends on how you build the thing, and how you program it. Would you believe that the MagiClick by [Modular] is capable of showing live weather information or the date and time, acting as animated dice, or being a stopwatch and Pomodoro timer? Now you’re beginning to understand.

Before we get much further, yes, this bad boy has two additional buttons on the sides. But the spirit of the thing is in the single large switch in the middle. It’s hiding beneath the 0.85″ 128×128 display, which is protected from pressure and fingerprints by that Pop-o-Matic bubble over the top. While the big button is the main operator used to access the function options, the side buttons are used as auxiliaries to exit and return to the home screen.

MagiClick is based on the ESP32-S3 and is designed to run on CircuitPython. In addition to everything else packed into this thing, there are blinkenlights and a small speaker inside, plus a GPIO expansion header around back. Everything is available on GitHub if you want to build your own.

Not enough keys for you? Well, here’s one with two.

A credit card-sized PCB with two sensing pads and a small OLED display

Card/IO Is A Credit Card-Sized, Open Source ECG Monitor

Of all the electrical signals generated by the human body, those coming from the heart are probably the most familiar to the average person. And because it’s also quite simple to implement the required sensors, it makes sense that electrocardiogram (ECG) machines are a popular choice among introductory medical electronics projects. [Dániel Buga], for instance, designed a compact ECG system the size of a credit card, cleverly dubbed Card/IO, that clearly demonstrates how to implement a single-lead ECG.

Although obviously not a medical-grade instrument, it still contains all the basic components that make up a proper biosignal sensing system. First, there are the sensing pads, which sense the voltage difference between the user’s two thumbs and simultaneously cancel their common-mode voltage with a technique called Right Leg Driving (RLD). The differential signal then goes through a low-pass filter to remove high-frequency noise, after which it enters an ADS1291 ECG analog front-end chip.

The ADS1291 contains a delta-sigma analog-to-digital converter as well as an SPI bus to communicate with the main processor. [Dániel] chose an ESP32-S3, programmed in Rust, to interface with the SPI bus and drive a 1″ OLED display that shows the digitized ECG signal. It also runs the user interface, which is operated using the ECG sensing pads: if you touch them for less than five seconds, the device goes into menu mode and the two pads become buttons to scroll through the different options.

All source code, as well as KiCad files for the board, can be found on the project’s GitHub page. If you’re just getting started in the biosensing field, you might also want check out this slightly more advanced project that includes lots of relevant safety information.

Continue reading “Card/IO Is A Credit Card-Sized, Open Source ECG Monitor”