Sparklines For Your ESP32 Projects

On a typical microcontroller project we may only have access to a relatively tiny screen. Information display can be a challenge, but it’s one that may be made easier by [0xPIT]’s ESParklines library for Espressif processors using the Arduino framework.

A sparkline is a simple line graph without annotations (like axes or units) intended to fit within the flow of text. They’re largely associated today with the statistician Edward Tufte, and if you’ve not encountered them or Tufte before then we suggest you’ll enjoy educating yourself.

It’s a simple enough library and it comes with example code. Usefully it maintains a data buffer all of its own allowing simple updating, and as well as the examples there is a YouTube video we’ve put below the fold showing graphs evolving as more information is added to them. We’re curious about one thing though, it’s billed as an ESP library, for either the ESP8266 or the ESP32, but we can’t find any ESP-specific code in there and neither could our friendly ESP-guru. Have we missed something? The comments are below if you can shed any light.

Continue reading “Sparklines For Your ESP32 Projects”

Adding WiFi To Black Magic For Wireless GDB Action

[Thoquz] wrote to us about an interesting GitHub project by [Valmantas Palikša] involving the porting of the Black Magic firmware to ESP8266. For those who are unaware, Black Magic Probe is firmware along with a range of official and third-party boards that targets the debugging of Cortex-M and Cortex-A MCUs and SoCs.

With this blackmagic-espidf project, one can use any ESP8266 board that has at least 2 MB of Flash program storage, though 1 MB should be possible if OTA updated are disabled. After flashing the firmware to the ESP8266 board, the GDB server can be reached on TCP port 2022 and UDP 2023, with a serial port available via TCP/23, UDP2323, or via the physical TX0/RX0 pins on the ESP8266.

The target board to be debugged  is hooked up by default to GPIO0 (SWDIO) and GPIO2 (SWCLK) for Serial Wire Debugging, though JTAG is also said to be supported. If set up properly, next one should be able to pop into a fresh remote GDB session:

gdb connection

If you don’t want the WiFi, you can buy a wired one, or just roll your own from any STM32 board that you’ve got kicking around.

Fusion For STM32: Development Board With Debugging And Programming Via WiFi

Clearly profiling itself as the Lamborghini or Ferrari of the STM32 development board world, MikroElektronika’s current (8th) revision of their Fusion development board was released last year with support for not only flashing but also debugging the attached STM32 MCU via the onboard WiFi module. The Serbian company’s pricing for the bare board without MCU modules or any other peripherals appears to be around 300 USD/Euro. Additional MCU boards cost between $28 – $60 each.

As the official product page explains, the board is combined with the CodeGrip software to manage the board either via USB-C (driver-free) – which also allows one to configure the WiFi option – and via WiFi. Peripheral boards are added via the 5 onboard MikroBUS expansion slots, either with existing boards, or custom MikroBUS boards. The power supply is also onboard, powered via USB, a barrel jack connector, or an external battery.

The use of WiFi to connect to the board would allow for it to be easily managed and debugged when it’s in a less convenient location than one’s desk, which would seem like a major boon.

Obviously it’s not a cheap board, and the MCU cards each cost about as much as a Nucleo or Discovery board from ST would cost, making it hard to justify purchasing it for anything but a professional environment. However, the tantalizing thing here is probably that so much of the design details are available, from the expansion bus to the pin-out and schematic of the MCU cards (STM32F767ZG version).

The MCU cards use the Hirose FX10A-168S-SV and FX10A-168P-SV(71) connectors, all readily available. This opens the possibility of developing compatible MCU cards. An MCU card template project can for example be found here.

The Easiest Way To Put Your Doorbell On The Internet

Thanks to low-cost WiFi enabled microcontrollers such as the ESP8266 and ESP32, it’s never been a better time to roll your own smart home system. But that doesn’t mean it isn’t daunting for new players. If you’re looking for an easy first project, putting your old school doorbell on the Internet of Things is a great start, but even here there’s some debate about how to proceed.

Most people stumble when they get to the point where they have to connect their low-voltage microcontroller up to the relatively beefy transformer that drives a standard doorbell. We’ve seen a number of clever methods to make this connection safely, but this tip from [AnotherMaker] is probably the easiest and safest way you’re likely to come across.

His solution only requires an inductive current sensor, which can be had for less than $1 from the usual overseas suppliers. One leg of the doorbell circuit is passed through the center of this sensor, and the sensor itself is connected up to your microcontroller of choice (here, and ESP32). The rest is software, which [AnotherMaker] explains in the video after the break. With the addition of a little debounce code, your microcontroller can reliably determine when somebody is out there jabbing the bell button; what you do with this information after that is up to you.

If you’re worried this method is too easy you could always try it with an optocoupler, or maybe convert the low-voltage AC to something your microcontroller can handle.

Continue reading “The Easiest Way To Put Your Doorbell On The Internet”

Simple Sprite Routines Ease Handheld Gaming DIY

Making your own handheld games is made much easier with [David Johnson-Davies’] simple sprite routines for the Adafruit PyBadge and PyGamer boards. Sprites can be thought of as small, fixed-size graphical objects that are drawn, erased, moved, and checked for collision with other screen elements.

xorSprite() plots an 8×8 sprite, moveSprite() moves a given sprite by one pixel without any flicker, and hitSprite() checks a sprite for collision with any screen elements in a given color. That is all it takes to implement a simple game, and [David] makes them easy to use, even providing a demo program in the form of the rolling ball maze shown here.

These routines work out-of-the-box with the PyBadge and PyGamer, but should be easy to adapt to any TFT display based on the ST7735 controller. The PyGamer is the board shown here, but you can see the PyBadge as it was used to create an MQTT-enabled conference badge.

If you really want to take a trip down the rabbit hole of sprite-based gaming graphics, you simply can’t miss hearing about the system [Sprite_TM] built into the FPGA Game Boy badge.

Stealing RAM For A Microcontroller From A TFT Display

PC users with long memories will recall the days when the one-megabyte barrier was  a significant problem, and the various tricks of extended and expanded memory used to mitigate it. One of them was to install a driver that mapped surplus graphics card memory as system memory when the display was in DOS text mode, and it was this that was brought to mind when we read about [Frank D]’s microcontroller implementation of Conway’s Game Of Life.

The components were those he had to hand; an STM32F030F4P6 and an RM68130 176 × 220 TFT board. The STM is not the most powerful of chips, with only 16 kB of Flash and 4 kB of RAM. The display has enough on-board memory to support 18 bits of colour information, but when it is running in eight-colour mode it only uses three of them. The 15 bits that remain are thus available to be used for other purposes, and though the arcane format in which they are read required some understanding they could be used to provide a very useful extra 38720 bytes of RAM for the microcontroller just as once happened with those DOS PC graphics cards of old. Interestingly, the same technique should work with other similar displays.

Though this isn’t a new technique by any means we can’t recall seeing it used in a microcontroller project such as this one before. We’ve brought you many Games of Life though, as well as marking John Conway’s passing earlier this year.

Continue reading “Stealing RAM For A Microcontroller From A TFT Display”

A Sweet Little Insulin Reminder Light

So much of what we do relies on a certain societal structure that has been absent for a few months now. When the days run together, it’s hard to remember to do the things that must happen daily. You think you did something, and maybe you’re right, but it’s quite possible you’re thinking of yesterday.

[Flameeyes] has diabetes and must use an insulin pen every morning without fail, no matter what’s happening outside his door. This was pretty much a non-issue in the before-time, but quickly became a serious problem as the routine-free weeks wore on. With no room for false positives, he needed a solution that doesn’t trigger until the deed is done.

Now when [Flameeyes] puts the pen away, he also triggers a Flic smart button mounted nearby. The Flic shares its status with a Feather M4 Express through a web app, and the Feather in turn changes the RGB LED inside of Pikachu’s base from red to yellow for the day. Pikachu sits in plain sight by the kettle, so there’s no guessing whether [Flameeyes] took his insulin.

Insulin is a critical commodity with a lot of DIY interest, which is probably starting to spike about now. Our own [Dan Maloney] wrote a great piece on the subject that brings up an insulin hack from around 80 years ago.