Building A Heading Sensor Resistant To Magnetic Disturbances

Light aircraft often use a heading indicator as a way to know where they’re going. Retired instrumentation engineer [Don Welch] recreated a heading indicator of his own, using cheap off-the-shelf hardware to get the job done.

The heart of the build is a Teensy 4.0 microcontroller. It’s paired with a BNO085 inertial measurement unit (IMU), which combines a 3-axis gyro, 3-axis accelerometer, and 3-axis magnetometer into a single package. [Don] wanted to build a heading indicator that was immune to magnetic disturbances, so ignored the magnetometer readings entirely, using the rest of the IMU data instead.

Upon startup, the Teensy 4.0 initializes a small round TFT display, and draws the usual compass rose with North at the top of the display. Any motion after this will update the heading display accordingly, with [Don] noting the IMU has a fast update rate of 200 Hz for excellent motion tracking. The device does not self-calibrate to magnetic North; instead, an encoder can be used to calibrate the device to match a magnetic compass you have on hand. Or, you can just ensure it’s already facing North when you turn it on.

Thanks to the power of the Teensy 4.0 and the rapid updates of the BNO085, the display updates are nicely smooth and responsive. However, [Don] notes that it’s probably not quite an aircraft-spec build. We’ve featured some interesting investigations of just how much you can expect out of MEMS-based sensors like these before, too.

Continue reading “Building A Heading Sensor Resistant To Magnetic Disturbances”

AI Assistant Uses ESP32

Having an AI assistant is all the rage these days, but AI assistants usually don’t know about your automation setups and may have difficulty dealing with tasks asynchronously. Enter zclaw. It gives you the option to have a personal assistant on an ESP32 backed by Anthropic, OpenAI, or OpenRouter. The whole thing fits in 888KB, and while it doesn’t host the LLM, it does add key capabilities to monitor and control devices connected to the ESP32.

You communicate with the assistant via telegram. You can say things like “Remember the garage sensor is on GPIO 4.” Then later you might say: “In 20 minutes, check the garage sensor and if it is high, set GPIO 5 low.” It has an RTOS for scheduling tasks and is aware of the timezone and common periods. Memory persists across reboots, and you can pick different personas.

Continue reading “AI Assistant Uses ESP32”

Random Number Generator Uses Camera Noise

Random numbers are very important to us in this computer age, being used for all sorts of security and cryptographic tasks. [Theory to Thing] recently built a device to generate random numbers using nothing more complicated than simple camera noise.

The heart of the build is an ESP32 microcontroller, which [Theory to Thing] first paired with a temperature sensor as a source of randomness. However, it was quickly obvious that a thermocouple in a cup of tea wasn’t going to produce nice, jittery, noisy data that would make for good random numbers. Then, inspiration struck, when looking at vision from a camera with the lens cap on. Particularly at higher temperatures, speckles of noise were visible in the blackness—thermal noise, which was just what the doctor ordered.

Thus, the ESP32 was hooked up to an OV3660 camera, which was then covered up with a piece of black electrical tape. By looking at the least significant bits of the pixels in the image, it was possible to pick up noise when the camera should have been reporting all black pixels. [Theory to Thing] then had the ESP32 collate the noisy data and report it via a web app that offers up randomly-generated answers to yes-or-no questions.

[Theory to Thing] offers up a basic statistical exploration of bias in the system, and shows how it can be mitigated to some degree, but we’d love a deeper dive into the maths to truly quantify how good this system is when it comes to randomness. We’ve featured deep dives on the topic before.

Continue reading “Random Number Generator Uses Camera Noise”

A TV Transmitter From An STM32

Analog TV may have shuffled off its mortal coil years ago, but there are still plenty of old CRT TV sets around that could receive it. [Kris Slyka] has just such a device, and decided to feed it something from an STM32 microcontroller. An STM32G431, to be precise, and they’re doing it using the on-chip hardware rather than in software.

This unexpected feat is made possible by clever use of the internal oscillators and analog multiplexer. The video itself is generated using the MCU’s DAC, and fed into the on-board op-amp multiplexer which is switched at the VHF transmission frequency. This creates the required VHF TV transmission, but without audio. This component comes by abusing another peripheral, the internal RC oscillator for the USB. This is frequency modulated, and set to the required 5.5 MHz spacing from the vision carrier for the TV in question. It doesn’t (yet) generate the PAL color sub-carrier so for now it’s black and white only, but maybe someone will figure out a way.

We like unexpected out-of-spec uses of parts like these microcontrollers, and we especially like analog TV hereabouts. We marked its very final moments, back in 2021.

Pi Pico Learns Morse Code

When [101 Things] didn’t want to copy Morse code, he decided to build a Pi Pico system to read it for him. On the face of it, this doesn’t seem particularly hard, until you look at the practical considerations. With perfectly timed dots and dashes, it would be trivial. But in real life, you get an audio signal. It has been mangled and mixed with noise and interference as it travels through the air. Then there’s the human on the other end who will rarely send at a constant speed with no errors.

Once you consider that, this becomes quite the project, indeed. The decoder captures audio via the Pi’s analog-to-digital converter. Then it resamples the input, applies an FFT, and converts the output via a complex classification pipeline that includes, among other things, Bayesian decoding. Part of the pipeline makes simple typo corrections. You can see the device do its thing in the video below.

Continue reading “Pi Pico Learns Morse Code”

Fidget Clicker Becomes Miniature Game Console

Fidget toys are everywhere these days. A particularly popular type simply puts some keyboard switches on a plate to provide a certain type of clicky satisfaction. [wjddnjsdnd] took that concept a step further, building a keychain-sized fidget toy that actually has games on it.

The build is based around six key switches in a 2 x 3 array. The key switches are notable in this case for being magnetic shaft keys. Rather than using a mechanical switch to indicate a keypress, the keycap instead merely moves a magnet which triggers a signal in a hall effect sensor beneath the key. In this case, the build uses A3144 hall effect sensors, which are read by the Arduino Nano running the show. The Nano is also hooked up to a small SSD1306 OLED display over I2c, which it uses for displaying the game state. There’s also a TP4056 module to handle charging the attached 380 mAh lithium-ion battery which powers the pocket-sized device.

The Arduino Nano is not a powerful platform for gaming, but it can handle the basics. The Gamebox Clicker, as it’s called, features a Pong clone, a stairs game, and a recreation of Snake. Think early mobile phone games, and you’d be on the money.

It’s an interesting build, and one that would be a great way to get used to using magnetic key switches as well as small embedded displays. We’ve seen Arduino boards turned into microconsoles many times before, too. If you’d like to sound off about magnetic vs. mechanical key switches, jump into the comments, or otherwise let us know about your best electronic fidget projects on the tipsline. Happy hacking.

BreezyBox: A BusyBox-Like Shell And Virtual Terminal For ESP32

Much like how BusyBox crams many standard Unix commands and a shell into a single executable, so too does BreezyBox provide a similar experience for the ESP32 platform. [valdanylchuck] ‘s system even includes a demo implementation that uses the ESP32-S3 platform as part of the Waveshare 7″ display development board.

Although it invokes the BusyBox name, it’s not meant to be as stand-alone as it uses the standard features provided by the FreeRTOS-based ESP-IDF SDK. In addition to the features provided by ESP-IDF it adds things like a basic virtual terminal, current working directory (CWD) tracking and a gaggle of Unix-style commands, as well as an app installer.

The existing ELF binary loader for the ESP32 is used to run executables either from a local path or a remote one, a local HTTP server is provided and you even get ANSI color support. Some BreezyBox apps can be found here, with them often running on a POSIX-compatible system as well. This includes the xcc700 self-hosted C compiler.

You can get the MIT-licensed code either from the above GitHub project link or install it from the Espressif Component Registry if that’s more your thing.

Continue reading “BreezyBox: A BusyBox-Like Shell And Virtual Terminal For ESP32”