A hot tub with a smartphone in front showing real-time sensor data

ESP32 Keeps Track Of Hot Tub’s Vital Signs

Like swimming pools, hot tubs need regular monitoring to ensure their water stays clean and clear. An average person might take a water quality reading once or twice a week using test strips, but such a low sampling rate obviously won’t do for a hacker. [Stephen Carey] has therefore built a hot tub monitor that checks the water quality every minute and reports it on a neat mobile dashboard.

[Stephen]’s system uses commercially available sensors that track pH levels and Oxidation-Reduction Potential (ORP), both basic measurements that indicate water quality. A second set of sensors keeps track of the temperature of the water and the outside air, which should help in finding insulation failures and keeping energy use under control.

A set of graphs showing a hot tub's pH and ORP over time, with a significant spike in both near the beginningAn ESP32 reads the sensors and sends out the data through WiFi. [Stephen] programmed the ESP32 in MicroPython, using an MQTT driver to connect it to Home Assistant. By looking at the graphs generated, you can tell when someone entered the tub from a step change in pH and ORP. It’s even possible to generate alerts when any of the values drift outside their acceptable range – we can already imagine an alarm going off when someone enters without having showered first.

The system also has a calibration mode to check the sensors against a well-defined buffer solution. As with many chemical sensors, the pH and ORP probes gradually lose their active material and need to be replaced after about a year. Good ones aren’t cheap, but [Stephen] has found pretty decent low-cost alternatives on AliExpress that should be fine for a home setup.

If you also want your tub or pool to be actively managed, you’ll need a more complex system, perhaps even one that can also dispense chemicals. If your hot tub is heated by a wood fire, however, all you need is a way to alert the person tending the fire.

A purple PCB with a Raspberry Pi Pico and an MK3870 mask ROM microcontroller

A 1970s Mask ROM MCU Spills Its Secrets

If you buy any kind of electronic gadget today, chances are it’s powered by a microcontroller with a program stored in its internal flash ROM. That program’s code is often jealously guarded by the manufacturer, who will try their best to make sure you can’t just read back the chip’s contents by using lock bits or some sort of encryption. Things were more laid back in the 1970s and ’80s, when code was stored unencrypted in standard EPROM chips, or, for high-volume applications, in mask ROMs integrated in microcontrollers. Reading back the code of such micros was still very difficult because chips simply didn’t have a way of dumping their contents. [Andrew Menadue] ran into this issue when trying to repair an old HP calculator printer, and had to apply a clever hack to dump the contents of its Mostek MK3870 chip.

The main trick [Andrew] used was one discovered by [Sean Riddle] and explained on his website. It makes use of the fact that the MK3870 has a TEST pin that can be used to disable the mask ROM and load alternative program code directly into the micro’s processing core. By setting up a LOAD instruction pointing at a ROM location and briefly disabling test mode while that instruction is executed, the ROM’s contents can be read out by the externally loaded program.

Simple as this hack may seem, actually implementing it was tricky enough because of the strict timing requirements between signals on the clock pins, the data bus, and the TEST pin. [Andrew] got it to work on his Raspberry Pi Pico setup most of the time, but somehow the micro still returned a plainly wrong value every few hundred bytes. Not willing to spend too much time debugging this issue, [Andrew] applied a rather crude hack to his code: instead of reading each byte once, it runs the read cycle 200 times, and only returns a result when all 200 runs return the same value. Dumping the entire 4 kB of ROM now takes several minutes, but this isn’t much of an issue since [Andrew] only has one chip to read out.

If you do have a bucketload of MK3870 chips that you need to dump, you might want to try and optimize the code on [Andrew]’s GitHub page. It’s a lucky coincidence that the ‘3870 has the exploitable TEST feature; often, the only way to get inside mask ROM code is by decapping the chip and optically reading the bits one by one. Mask ROMs are great for very long term data storage, however.

Continue reading “A 1970s Mask ROM MCU Spills Its Secrets”

A badminton shuttle launcher loaded with shuttles

Hackaday Prize 2023: Automated Shuttle Launcher Enables Solo Badminton Practice

If you want to get better at your favorite sport, there’s really no substitute to putting in more training hours. For solo activities like running or cycling that’s simple enough: the only limit to your training time is your own endurance. But if you’re into games that require a partner, their availability is another limiting factor. So what’s a badminton enthusiast like [Peter Sinclair] to do, when they don’t have a club nearby? Build a badminton training robot, of course.

Automatic shuttlecock launchers are available commercially, but [Peter] found them very expensive and difficult to use. So he set himself a target to design a 3D-printable, low-cost, safe machine that would still be of real use in badminton training. After studying an apparently defunct open-source shuttle launcher called Baddy, he came up with the basic design: a vertical shuttle magazine, a loading mechanism to extract one shuttle at a time and position it for launch, and two wheels spinning at high speed to launch the shuttle forward. Video after the break. Continue reading “Hackaday Prize 2023: Automated Shuttle Launcher Enables Solo Badminton Practice”

A handheld computer made on a piece of prototyping board running a Tetris clone

Tetris Clone Uses 1000 Lines Of Code, And Nothing Else

If you’re programming on a modern computer, you typically make use of lots of work done by other people. There’s operating systems to abstract away the complexities of modern hardware, standard libraries to implement common tasks, and tons of third-party libraries that prevent you from having to reinvent the wheel all the time: you’re definitely not the first one trying to draw graphics onto a screen or store data in a file.

But if it’s the wheels you’re most interested in, then there’s nothing wrong with inventing new ones now and then. [Michal Zalewski], for instance, has made a beautiful Tetris clone in just 1000 lines of C, without using anyone else’s code.

The purpose of this exercise is to show that it’s possible to make a game with graphics comparable to modern, complex computing systems, without relying on operating systems or third-party libraries. The hardware consists of not much more than an ARM Cortex-M7 MCU, a 240×320 LCD screen and a few buttons soldered onto a piece of prototyping board, all powered by a set of AAA batteries.

The software is similarly spartan: just pure C code running directly on the CPU core. Graphic elements, some generated by AI and others hand-drawn, are stored in memory as plain bitmaps. They are manipulated by 150 lines of code that shuffles sprites around the display at a speed high enough to generate smooth motion. Game mechanics take up about 250 lines, while sound consists of simple square-wave chiptunes written in just 50 lines of code.

[Michal]’s code is very well documented, and his blog post gives even more details about all the problems he had to solve. One example is the length of keypresses: when do you interpret a keypress as a single “press”, and when does it become “press and hold”? Apparently, waiting 250 ms after the first press and 100 ms after subsequent ones does the trick. [Michal] is a bit of an expert on bare-bones game programming by now: he has previously pushed several 8-bit micros to their very limits. Third-party libraries can make your programming life a lot easier, but it’s good to reflect on the dangers of relying too much on other people’s code.

Continue reading Tetris Clone Uses 1000 Lines Of Code, And Nothing Else”

A software-defined radio system in a 3D-printed case with a 7" display and an array of knobs and switches

Hackaday Prize 2023: A Software-Defined Radio With Real Knobs And Switches

When cheap digital TV dongles enabled radio enthusiasts to set up software defined radio (SDR) systems at almost zero cost, it caused a revolution in the amateur radio world: now anyone could tune in to any frequency, with any modulation type, by just pointing and clicking in a computer program. While this undoubtably made exploring the radio waves much more accessible, we can imagine that some people miss the feeling of manipulating physical buttons on a radio while hunting for that one faint signal in a sea of noise. If you’re one of those people, you’re in luck: [Kaushlesh C.] has built a portable, self-contained SDR system with real knobs and switches, called SDR Dock 1.0. Continue reading “Hackaday Prize 2023: A Software-Defined Radio With Real Knobs And Switches”

A wooden digital clock with a metal knob on one end

Hackaday Prize 2023: Stretch Your Day With This 29-Hour Clock

Modern life can be stressful. Many of us struggle to balance work, family, exercise, and an ever-growing list of hacking projects, all of which claim our attention during the day. If you sometimes feel that those 24 hours just don’t cut it, you might be in luck: [HIGEDARUMA] has built a clock that can stretch your day by up to five hours.

Sadly, [HIGEDARUMA] hasn’t invented time travel (yet). What his clock does instead is slow down its own pace in the evening to push back the midnight hour. When it finally does reach 12:00 a.m., the clock’s pace is accelerated to ensure it’s back in sync with the rest of the world by six in the morning. It might seem silly, but there is a certain logic to it: [HIGEDARUMA] explains that evenings felt much longer when he was a child and that he would like to try and experience that again. Our sense of time may change over our lifetime, even if the actual passage of time doesn’t.

Timescales aside, the 29-hour clock is a neat piece of work from a hardware point of view. The case is made from 4 mm laser-cut MDF with wood-grain foil on the outside. Inside, there’s an ESP32 to run the show, along with an RTC module and three four-digit seven-segment LED displays. A chunky “volume” knob on the front lets you choose how much you’d like your day to be stretched.

We’ve seen clocks with non-linear dials before, as well as extremely linear ones, but this might be the first one with a non-constant pace. It makes us wonder what the passage of time feels like for those frozen in ice for 46,000 years.

Continue reading “Hackaday Prize 2023: Stretch Your Day With This 29-Hour Clock”

A modern recreation of von Guericke's electrostatic generator

Electrostatic Generator Project Starts With Molten Sulfur

Although the basic concept of electrostatic attraction has been known since ancient times, it was only in the 17th century that scientists began to systematically investigate electrostatics. One of the first to explore this new field was Otto von Guericke, who constructed an electrostatic generator to help with his experiments. [Markus Bindhammer] has reconstructed this machine, which formed the basis for later work by the likes of Wimshurst and Van de Graaff. [Markus] kept his machine in an almost period-correct fashion.

Von Guericke’s machine consists of a sulfur ball mounted on a spindle that allows it to be rotated and rubbed against a piece of cloth. By doing so, the ball gains a charge that can be used to attract small pieces of material. [Markus] built a neat wooden frame with faux-antique carved legs and installed a handle, a spindle, and a belt-drive system to rotate whatever’s mounted on the spindle at high speed.

A round-bottom flask containing sulfur being heated in an oil bathAll of this is beautifully documented in [Markus]’s video, but by far the most interesting part of his project is the process of manufacturing the sulfur ball. If you’ve always wanted one, here’s how to make one: first, melt some pieces of pure sulfur in a round-bottom flask using an oil bath. Then, turn on your vacuum pump to remove any air or water vapor trapped inside the liquid. Once the liquid is nice and clear, let it cool down and solidify very slowly; the sulfur ball can then be released from its container by breaking the glass with a hammer.

While it sounds simple, we can imagine it took a bit of experimenting to get all those steps just right. The end result is a simple but useful machine to demonstrate basic electrostatics, which [Markus] is planning to use in science lectures. There are lots of interesting experiments you can do with static electricity, including building a basic motor.

Continue reading “Electrostatic Generator Project Starts With Molten Sulfur”