MicroLisp: Lisp For Microcontrollers Now Has Lisp-Based ARM Assembler

In a way it feels somewhat silly to market a version of Lisp as targeting resource-constrained platforms, considering the systems it ran on back in the 1960s, but as time goes on, what would have given 1970s Big Iron a run for its money is now a sub-$5 microcontroller that you can run uLisp (MicroLisp) on. This particular project now even has an ARM assembler that is written in Lisp whose source code (GitHub) fits on a mere two A4-sized pages.

ULisp currently supports five platforms, being AVR-nano (ATmega328 and similar low-cost AVRs), AVR, ARM, ESP (8266 and 32), as well as RISC-V. The purpose of this assembler is to execute native ARM instructions when running on an ARM board, since uLisp itself runs a Lisp interpreter on the platform. When executed natively like this, a considerable speed-up of the task can be expected, as illustrated by a number of ARM assembler examples in the documentation.

Running a Fibonacci sequence that takes 24.6 seconds with the Lisp version on an Adafruit Metro M4 is reduced to a mere 61 ms when ARM assembly is used instead. This shouldn’t be too shocking, since this assembler essentially bypasses the Lisp runtime, coming closer to what would be the performance of firmware written in e.g. C. However, it also demonstrates that with this ARM assembler it is possible to have your Lisp and still get native performance when you want it, all using Lisp code.

Presence Sensor Locks Computer When You Step Away

Having a computer that locks its screen after a few minutes of inactivity is always a good idea from a security standpoint, especially in offices where there is a lot of foot traffic. Even the five- or ten-minute activity timers that are set on most workstations aren’t really perfect solutions. While ideally in these situations we’d all be locking our screens manually when we get up, that doesn’t always happen. The only way to guarantee that this problem is solved is to use something like this automatic workstation locker.

The project is based around the LD2410 presence sensor — a small 24 GHz radar module featuring onboard signal processing which simplifies the detection of objects and motion. [Enzo] paired one of these modules with a Seeed Studio XIAO nRF52840 development board to listen to the radar module and send the screen lock keyboard shortcut to the computer when it detects that the user has walked away from the machine. The only thing that [Enzo] wants to add is a blinking LED to let the user know when the device is about to timeout so that it doesn’t accidentally lock the machine when not needed.

One of the parts of this build that is a little bit glossed over is the fact that plenty of microcontroller platforms can send keystrokes to a computer even if they’re not themselves a USB keyboard. Even the Arduino Uno can do this, so by now this feature is fairly platform-agnostic. Still, you can use this to your advantage if you have the opposite problem from [Enzo] and need your computer to stay logged in no matter what.

Want Lower Power? Add More Cores!

[Jacob Beningo] over at Embedded.com recently posted his thoughts on how to do a low-power microcontroller design. On the surface, some of his advice seems a little counter-intuitive. Even he admits, “…I’m suggesting adding more cores! I must be crazy!” There are a few tips, but the part he’s talking about is that you can save power by using CPUs with multiple cores and optimizing for speed.

This seems strange since you think of additional cores and speed to consume more power. But the idea is that the faster you get your work done, the faster you can go to sleep. We’ve seen that in our own projects — faster work means more napping, and that’s good for power consumption.

Of course, it isn’t just that simple. Multiple cores don’t help you if you don’t use them. The overarching goal is to get done quickly so you can get back to sleep. You know, kind of like work. The other advice in the post is generally good, too. Measure your power consumption, respond to events, and — maybe slightly surprising — with modern CPUs, variations within the CPU family, according to [Jacob], isn’t very significant. Instead, he reports that the big changes are switching to the least-capable processor family.

Naturally, Hackaday readers are no strangers to low-power design. If you get your power consumption low enough, you can consider a low-tech battery or even a potato.

Adding Variometer Functionality To A GPS

Flying a glider, or similarly piloting a paraglider or hang glider, can all be pathways into aviation with a lower barrier of entry than powered flight. Sacrificing one’s engine does generate a few complexities, but can be rewarding as the pilot searches for various means of increasing altitude like ridge soaring or thermaling. You’ll need a special instrument called a variometer to know just how much altitude you’re gaining though, like this one which is built into commercially-available handheld GPS units.

These GPS units are normally intended for use on terra firma only, but [Oganisyan] has figured out a clever way to add this flight instrumentation to these units to help when operating a paraglider. An ATmega328 paired with a pressure sensor is added to the inside of the GPS units and communicates with an available serial interface within the units. To complete the modification, a patched firmware must be installed which adds the variometer function to the display. This upgrade is compatible with a handful of GPS units as well such as the BikePilot2+ or Falk Tiger.

For those who already own one of these GPS units, this could be a cost-effective way of obtaining a variometer, especially since commercially-available variometers tailored for this sort of application can cost around $200 to $500. It is an activity sensitive to cost, though, as it offers a much more affordable option for taking to the skies than any powered craft could, with an exception made for this powered paraglider which offers the ability for powered take off and flight extension using electric-powered props.

Thanks to [MartinO] for the tip!

The New Hotness

If there’s one good thing to be said about the chip shortage of 2020-2023 (and counting!) it’s that a number of us were forced out of our ruts, and pushed to explore parts that we never would have otherwise. Or maybe it’s just me.

Back in the old times, I used to be a die-hard Atmel AVR fan for small projects, and an STM32 fan for anything larger. And I’ll freely admit, I got stuck in my ways. The incredible abundance of dev boards in the $2 range also helped keep me lazy. I had my thing, and I was fine sticking with it, admittedly due to the low price of those little blue pills.

An IN-12B Nixie tube on a compact driver PCBAnd then came the drought, and like everyone else, my stockpile of microcontrollers started to dwindle. Replacements at $9 just weren’t an option, so I started looking around. And it’s with no small bit of shame that I’ll admit that I hadn’t been keeping up with the changes as much as I should have. Nowadays, it’s all ESP32s and RP2040s over here, and granted there’s a bit of a price bump, but the performance is there in abundance. But I can’t help feeling like I’m a few years back of the cutting edge.

So when I see work like what [CNLohr] and [Bitluni] are doing with the ultra-cheap CH32V003 microcontrollers, it makes me think that I need to start filling in gaps in my comfortable working-set of chips again. But how the heck am I supposed to keep up? And how do you? It took a global pandemic and silicon drought to force me out of my comfort zone last time. Can the simple allure of dirt-cheap chips get me out? We’ll see!

Holograms Display Time With ESP32

Holograms and holographic imagery are typically viewed within the frame of science fiction, with perhaps the most iconic examples being Princess Leia’s message to Obi-Wan in Star Wars, or the holodecks from Star Trek. In reality, holograms have been around for a surprising amount of time, with early holographic images being produced in the late 1940s. There are plenty of uses outside of imagery for modern holographic systems as well, and it’s a common enough technology that it’s possible to construct one using an ESP32 as well.

In this build, [Fiberpunk] demonstrates the construction and operation of a holographic clock. The image is three-dimensional and somewhat transparent and is driven by an ESP32 microcontroller. The display is based around a beamsplitter prism which, when viewed from the front, is almost completely invisible to the viewer. The ESP32 is housed in a casing beneath this prism, and [Fiberpunk] has two firmware versions available for the device. The first is the clock which displays an image as well as the time, and the second is more of a demonstration which can show more in-depth 3D videos using gcode models and also has motion sensing controls.

For anyone interested in holography, a platform like this is might make an excellent entry point to explore, and with the source for this build available becomes even easier. It’s almost certainly less expensive than these 3D printers that can turn out custom holographic images, and has the added benefit of being customizable and programmable as well.

Continue reading “Holograms Display Time With ESP32”

Pi Microcontroller Still Runs A Webserver

At first glance, the Raspberry Pi Pico might seem like a bit of a black sheep when compared to the other offerings from the Raspberry Pi Foundation. While most of the rest of their lineup can run Linux environments with full desktops, the Pico is largely limited to microcontroller duties in exchange for much smaller price tags and footprints. But that doesn’t mean it can’t be coerced into doing some of the things we might want a mainline Pi to do, like run a web server.

The project can run a static web page simply by providing the Pico with the project code available on the GitHub page and the HTML that you’d like the Pico to serve. It can be more than a static web page though, as it is also capable of running Python commands through the web interface as well. The server can pass commands from the web server and back as well, allowing for control of various projects though a browser interface. In theory this could be much simpler than building a physical user interface for a project instead by offloading all of this control onto the web server instead.

The project not only supports the RP2040-based Raspberry Pi Pico but can also be implemented on other WiFi-enabled microcontroller boards like the ESP8266 and ESP32. Having something like this on hand could greatly streamline smaller projects without having to reach for a more powerful (and more expensive) single-board computer like a Pi 3 or 4. We’ve seen some other builds on these boards capable of not only running HTML and CSS renderers, but supporting some image formats as well.

Continue reading “Pi Microcontroller Still Runs A Webserver”