A Christmas-themed LEGO train engine and coal car

ESPHome Powers Festive Lego Train Set

While the basic concept of LEGO bricks might have changed little since the mid-20th century, some components such as motors and sensors are still affected by technological progress and end up obsolete and unsupported. [Travis] ran into this problem when he was building a festive train setup and realized he didn’t have the speed controller to match his train engine. Without that part, the engine would only run at full speed and derail as soon as it hit a curve. The official speed controller had been discontinued and was hard to find, so [Travis] had to resort to building his own.

The basic components needed were an H-bridge driver to operate the motor and an ESP8266 to generate PWM signals. In order to keep the bricky appearance of the train engine intact, [Travis] hollowed out a few cheap imitation LEGO bricks to house the electronics. He also cut out slots for JST connectors, which are far more convenient to work with than LEGO’s brick-style connectors.

Two imitation LEGO bricks with electronics insideThe ESP8266 runs ESPHome, which enables [Travis] to control the entire setup using Home Assistant. The train is programmed to run a few laps at the top of the hour and play choo-choo sounds from a mini MP3 player hidden in the coal car. That car also holds a standard AA battery holder to power the system, which makes it easy to swap the batteries without having to partially disassemble the train.

There are various ways to control LEGO creations using standard computer platforms: we’ve seen the ESP32 powering a LEGO tank, for instance. If you need a bit more computing power, there’s even an official LEGO Raspberry Pi HAT.

Continue reading “ESPHome Powers Festive Lego Train Set”

Picture of NanoStat in 3D-printed enclosure with LiPo battery and US quarter for scale.

An ESP32-Based Potentiostat

Ever wanted to make your own wireless chemical sensor? Researchers from the University of California, Irvine (UC Irvine) have got you covered with their ESP32-based potentiostat.

We’ve talked about potentiostats here on Hackaday before. Potentiostats are instruments that analyze the electrical properties of an electroactive chemical cell. Think oxidation and reduction reactions (redox) from your chemistry course, if you can remember that far back. Potentiostats can be used in several different modes/configurations, but the general idea is for these instruments to induce redox reactions within a given electroactive chemical cell and then measure the resulting current produced by the reaction. By measuring the current, researchers can determine the concentration of a known substance within a sample or even determine the identity of an unknown substance, to name a few potential applications.

These instruments have become mainstays in research labs around the world and have incredible utility in the consumer space. Glucometers, devices used to measure blood glucose levels, are an example of technologies that have made their way into everyday life due to the advances made in electrochemistry and potentiostat research over the last few decades. Given their incredible utility to scientific research and medical technologies, a great deal of effort has gone into democratizing potentiostats, making them more available to the general public for educational and hobbyist purposes. Of course, any medical applications must go through rigorous testing and approvals by each country’s appropriate governing bodies. So we’re talking more non-medical purposes here.

The first popular open-source, DIY potentiostat was the CheapStat, which we’ve covered here on Hackaday before. Since then, developing newer and more advanced open-source potentiostats has become a popular endeavor within the scientific community. The researchers from UC Irvine wanted to put their own special spin on the open-source potentiostat craze and they did so with their inclusion of the ESP32 as their main processor. This obviously opens up them up do a whole host (see what we did there) of wireless capabilities that others before them have not explored.

With the ESP32, they developed a nice web-based GUI that makes controlling and collecting data from the potentiostat very seamless and user-friendly. You can imagine the great possibilities here. Teacher-led classroom demonstrations where the instructor can easily access each student’s device over the cloud to help troubleshoot or explain results. Developing soil monitoring sensors that can be deployed all around a farm to remotely collect data on feed, soil composition, and plant health. The possibilities here sure are promising.

We hope you’ll dive into their paper as it’s well worth a read. Happy hacking, Hackaday.

Lo-Fi Fun: Beer Can Microphones

Sometimes, you just need an easy win, right? This is one of those projects. A couple months back, I was looking at my guitars and guitar accessories and thought, it is finally time to do something with the neck I’ve had lying around for years. In trying to decide a suitable body for the slapdash guitar I was about to build, I found myself at a tractor supply store for LEGO-related reasons. (Where else are you going to get a bunch of egg cartons without eating a bunch of eggs?) I  noticed that they happened to also stock ammo boxes. Bam! It’s sturdy, it opens easily, and it’s (very) roughly guitar body shaped. I happily picked one up and started scheming on the way home.

Having never built a cigar box guitar before and being of a certain vintage, I’m inclined to turn to books instead of the Internet, so I stocked up from the library. Among my early choices was Making Poor Man’s Guitars by Shane Speal, who is widely considered to be the guru on the subject. In flipping through the book, I noticed the beer can microphone project and was immediately taken by the aesthetic of some cool old 70s beer can with a 1/4″ instrument jack on the bottom, just asking for some dirty blues to be belted into it. I had to build one. Or twelve.

Continue reading “Lo-Fi Fun: Beer Can Microphones”

A 3D-printed case for the ZX Spectrum with a mechanical keyboard

The ZX Spectrum Finally Gets A Proper Keyboard

The Sinclair ZX Spectrum is fondly remembered by many for being their first introduction into the wonderful world of computing. Its advanced capabilities coupled with a spectacularly low price made it one of the great home computers of the 1980s, at least in the UK and nearby countries. What was less spectacular about the Spectrum was its awful keyboard: although a step up from the flat membrane keyboards of earlier Sinclair computers, the Spectrum’s tiny rubbery keys made typing anything more than a few characters a bit of a chore.

If you’re planning to do any serious programming on your Spectrum, you might therefore want to check out [Lee Smith]’s latest project in which he redesigns the Spectrum’s case to include a proper mechanical keyboard. [Lee] got this idea when he was looking for ways to fix a few Spectrums with broken or missing cases, and stumbled upon several projects that aim to recreate classic Sinclair machines using modern components. He took a keyboard PCB meant for the ZX Max 128 project, populated it with some high-quality switches, and added a modified set of keycaps from the ManuFerHi N-Go.

A new ZX Spectrum case, opened to show the keyboard connecting to the mainboard
The new keyboard plugs into the original connectors and doesn’t require any board-level modifications.

Together, those parts formed a modern, comfortable keyboard that still had the proper labelling on all keys. This is rather essential on the Spectrum, since each key is also used to generate symbols and BASIC keywords: for instance, the “K” key also functions as LIST, +, LEN and SCREEN$.

With the keyboard design settled, [Lee] set to work on the rest of the case: he designed and 3D-printed a sleek enclosure that takes the new keyboard as well as an original Spectrum mainboard. The resulting system is called the ZX Mechtrum, and looks fabulous with its matte black exterior and the obligatory four-coloured rainbow. A replaceable rear panel also allows several board-level modifications, like composite video or VGA output, to be neatly incorporated into the design.

We wrote an extensive retrospect on the Spectrum on its 40th anniversary earlier this year. If, somehow, you actually like the Spectrum’s original rubbery keyboard, then you can also modify the whole thing to work with modern computers.

Continue reading “The ZX Spectrum Finally Gets A Proper Keyboard”

All About USB-C: Illegal Adapters

Let’s be clear – it’s not enough to have USB-C to USB-C cables. There’s a lot of cables that we might want to acquire for our day-to-day use, perhaps, for a transition period while we still own some amount of devices not adorned with a USB-C connector. However, the USB-C specification only accounts for a limited amount of kinds of cables, explicitly or implicitly excluding a range of cables that you might want to buy or make.

It’s my firm belief that, as a hacker, you should be able to buy any USB-C contraption that you could ever need. Hackers don’t need restrictions driven by marketing – they need understanding of how a piece of tech can or cannot be used, based on how it operates internally. I would like you to provide with such understanding, so that you can make informed decisions.

On the other hand, USB-C is designed to be used by less-than-skilled people, even if it often fails at that. (Cable labelling, anyone?) Clear definitions of what complies to a standard can help enforce it. Here’s the notorious story of a USB-C cable that killed a Chromebook, and launched a career of explaining USB-C specifics online for [Benson Leung]. There’s many such failure stories, in fact. Today, we’ll go through USB-C contraptions which might or might not fail you, depending on how you use them. Continue reading “All About USB-C: Illegal Adapters”

A collage of three images. On top is the main PCB of the headphones, with a charger IC and the main MCU. On the bottom left, it shows ACOK and EN signals going to pullup resistors near the MCU. On bottom right, it shows the charger chip with its pinout overlaying it, highlighting the pads to be probed and later cut.

One Hacker’s Battle To Slightly Improve A Sadistic Sony Headset

One thing you won’t read in reviews of pricey Sony WH-1000XM3 headphones – if you choose them, you’re going to find yourself in a one-sided abusive relationship. A button press or low-battery notification makes the headphones scream at you, ignoring the actual sound volume of what you’re currently listening to. Once they’re discharged, they suddenly emit loud noises, lecture you about how the battery is low, then shut down. Oh, and you can’t use them as they’re charging – if your voicecall lasts longer than expected, you might find yourself being shouted at and forced to fumble around with wires, silently pleading for call participants to wait while you change over to a different headset.

On-PCB footprint for the IC, with two pads carefully cut in half as mentioned in the article[MisterHW] decided to dig in and figure out how to work around at least some of the shortcomings. Naturally, the “no charge while using” limit looked like low-hanging fruit, and a hefty usability improvement too – plus, he suspected the charge cutoff to be masking noise issues already abundant on these headphones. Some painful disassembly later, he was inspecting the charger IC , the MP2625, responsible for power management. Its signals were connected to the MCU using via-in-pad – and some pads had to be cut in half to disconnect the vias.

However, the laborious pad cutting and subsequent careful soldering didn’t turn out to be fruitful. Even with external control of the output inhibition pins, the shutoff still continued – something affected the circuit, whether it was VBUS detection, some other unnoticed via-connected pins on the charger, or sensing on D+/D-. About to run out of life force for this mod, [MisterHW] added a Qi charging circuit, powering a TP4056 wired in parallel with the MP2625. The mod, dubbed HW-1000XM3, made these headphones all that more reliable and less annoying – charger and MCU none the wiser.

Now, all that’s needed to charge these headphones is to slap a magnetic charger coil onto them, and it doesn’t interfere with voicecalls as much as the screaming and forced shutoffs do. Hopefully, Sony eventually learns to test their headphones by having humans use them – it’s far from the only gripes with this lineup, after all. We also hope that the voice notifications will be conquered eventually – this summer, we’ve seen a hacker firmware mod a Bluetooth speaker to make the sounds more pleasant. If your headphones are based on a relatively popular module, repurposing them might be even easier than that!

A DIY self-balancing robot

3D-Printed Self-Balancing Robot Brings Control Theory To Life

Stabilizing an inverted pendulum is a classic problem in control theory, and if you’ve ever taken a control systems class you might remember seeing pages full of differential equations and bode diagrams just to describe its basic operation. Although this might make such a system seem terribly complicated, actually implementing all of that theory doesn’t have to be difficult at all, as [Limenitis Reducta] demonstrates in his latest project. All you need is a 3D printer, some basic electronic skills and knowledge of Python.

The components needed are a body, two wheels, motors to drive those wheels and some electronics. [Limenitis] demonstrates the design process in the video below (in Turkish, with English subtitles available) in which he draws the entire system in Fusion 360 and then proceeds to manufacture it. The body and wheels are 3D-printed, with rubber bands providing some traction to the wheels which would otherwise have difficulty on slippery surfaces.

A PCB driving two stepper motors
The PCB has just a few components, with most of the complexity handled by plug-in modules.

Two stepper motors drive the wheels, controlled by a DRV8825 motor driver, while an MPU-9250 accelerometer and gyroscope unit measures the angle and acceleration of the system. The loop is closed by a Raspberry Pi Pico that implements a PID controller: another control theory classic, in which the proportional, integral and derivative parameters are tuned to adapt the control loop to the physical system in question. External inputs can be provided through a Bluetooth connection, which makes it possible to control the robot from a PC or smartphone and guide it around your living room.

All design files and software are available on [Limenitis]’s GitHub page, and make for an excellent starting point if you want to put some of that control theory into practice. Self-balancing robots are a favourite among robotics hackers, so there’s no shortage of examples if you need some more inspiration before making your own: you can build them from off-the-shelf parts, from bits of wood, or even from a solderless breadboard.

Continue reading “3D-Printed Self-Balancing Robot Brings Control Theory To Life”