Robin Kearey – Hackaday https://hackaday.com Fresh hacks every day Sun, 01 Oct 2023 06:46:54 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 156670177 ESP32 Keeps Track of Hot Tub’s Vital Signs https://hackaday.com/2023/10/01/esp32-keeps-track-of-hot-tubs-vital-signs/ https://hackaday.com/2023/10/01/esp32-keeps-track-of-hot-tubs-vital-signs/#comments Sun, 01 Oct 2023 14:00:12 +0000 https://hackaday.com/?p=624151 A hot tub with a smartphone in front showing real-time sensor dataLike 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 …read more]]> A hot tub with a smartphone in front showing real-time sensor data

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.

]]>
https://hackaday.com/2023/10/01/esp32-keeps-track-of-hot-tubs-vital-signs/feed/ 12 624151 Hot Tub Monitor A set of graphs showing a hot tub's pH and ORP over time, with a significant spike in both near the beginning
A 1970s Mask ROM MCU Spills Its Secrets https://hackaday.com/2023/09/30/a-1970s-mask-rom-mcu-spills-its-secrets/ https://hackaday.com/2023/09/30/a-1970s-mask-rom-mcu-spills-its-secrets/#comments Sat, 30 Sep 2023 20:00:12 +0000 https://hackaday.com/?p=624117 A purple PCB with a Raspberry Pi Pico and an MK3870 mask ROM microcontrollerIf 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 …read more]]> A purple PCB with a Raspberry Pi Pico and an MK3870 mask ROM microcontroller

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.

]]>
https://hackaday.com/2023/09/30/a-1970s-mask-rom-mcu-spills-its-secrets/feed/ 20 624117 MK3870 ROM Dumper
Hackaday Prize 2023: Automated Shuttle Launcher Enables Solo Badminton Practice https://hackaday.com/2023/09/29/hackaday-prize-2023-automated-shuttle-launcher-enables-solo-badminton-practice/ https://hackaday.com/2023/09/29/hackaday-prize-2023-automated-shuttle-launcher-enables-solo-badminton-practice/#comments Fri, 29 Sep 2023 23:00:46 +0000 https://hackaday.com/?p=624071 A badminton shuttle launcher loaded with shuttlesIf 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: …read more]]> A badminton shuttle launcher loaded with shuttles

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.

A mobile GUI for a badminton shuttle launcherGetting all the details right took a few iterations, as [Peter] describes in detail on his Hackaday.io page. The motors are powerful brushless DC ones normally used for drones, which can spin at up to 7000 rpm. They grip the shuttle’s head using two molded urethane wheels that are flexible enough to provide a good grip, but strong enough to last for a long time. All other parts of the machine are 3D printed for maximum flexibility and ease of manufacturing. Several servos enable the launcher to pan and tilt far enough to reach every corner of a standard badminton court.

An ESP32 is used to control all functions. [Peter] didn’t want the added complexity of having to maintain a mobile app, so he built the entire user interface into a local web page served up through the ESP32’s WiFi connection. The user can select a wide variety of training programs and also calibrate the launcher to account for variations in shuttle types or the size of their training area.

Safety was a factor [Peter] considered throughout the design. The launcher includes a proximity sensor that will stop the mechanism if a person is standing too close, and moving parts are covered as much as possible to make the machine safe to touch. All design files and code are available on [Peter]’s GitHub page, hopefully enabling more badminton fans to enhance their training programs. This machine might also come in handy to fine-tune another badminton robot that can return your serve.

]]>
https://hackaday.com/2023/09/29/hackaday-prize-2023-automated-shuttle-launcher-enables-solo-badminton-practice/feed/ 5 624071 Badminton shuttle launcher A mobile GUI for a badminton shuttle launcher
Tetris Clone Uses 1000 Lines of Code, and Nothing Else https://hackaday.com/2023/09/25/tetris-clone-uses-1000-lines-of-code-and-nothing-else/ https://hackaday.com/2023/09/25/tetris-clone-uses-1000-lines-of-code-and-nothing-else/#comments Tue, 26 Sep 2023 05:00:39 +0000 https://hackaday.com/?p=617376 A handheld computer made on a piece of prototyping board running a Tetris cloneIf 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, …read more]]> A handheld computer made on a piece of prototyping board running a Tetris clone

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.

]]>
https://hackaday.com/2023/09/25/tetris-clone-uses-1000-lines-of-code-and-nothing-else/feed/ 18 617376 Cattech 2000
Hackaday Prize 2023: A Software-Defined Radio With Real Knobs and Switches https://hackaday.com/2023/09/25/hackaday-prize-2023-a-software-defined-radio-with-real-knobs-and-switches/ https://hackaday.com/2023/09/25/hackaday-prize-2023-a-software-defined-radio-with-real-knobs-and-switches/#comments Mon, 25 Sep 2023 23:00:24 +0000 https://hackaday.com/?p=617320 A software-defined radio system in a 3D-printed case with a 7" display and an array of knobs and switchesWhen 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 …read more]]> A software-defined radio system in a 3D-printed case with a 7" display and an array of 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.

The heart of the system is a Raspberry Pi running GQRX, an open-source SDR program that supports many different RF modules. [Kaushlesh] used an Airspy HF+ Discovery, a compact receiver that can work the HF and VHF bands, but it’s easy to modify the SDR Dock to accept other types like those ubiquitous RTL dongles. A seven-inch LCD screen with integrated speakers forms the main output device, with everything powered by a 10,000 mAh lithium-polymer battery.

All of this is pretty neat already, but the real beauty of the SDR Dock is in its enclosure. It’s a 3D-printed case with a swivelling handle on the side, an antenna connector at the top and a convenient user interface at the front. There are pushbuttons to change device settings, rotary knobs for frequency tuning and volume control, and sliders to adjust things like gains and bandwidths. All of these are read out by an ESP32 which communicates with the Pi through I2C.

As an open-source design, everything is of course fully customizable, from the radio receiver type to the functions of those dials and switches. The simple, user-friendly design should also make it an ideal SDR system for absolute beginners. It’s not [Kaushlesh]’s first portable Pi-based SDR system, however: he’s also submitted a somewhat more hardcore version to this year’s Cyberdeck competition. For those completely new to the SDR game, [Josh]’s video at the 2020 Remoticon is a great introduction.

]]>
https://hackaday.com/2023/09/25/hackaday-prize-2023-a-software-defined-radio-with-real-knobs-and-switches/feed/ 16 617320 SDR Dock
Hackaday Prize 2023: Stretch Your Day With This 29-Hour Clock https://hackaday.com/2023/09/24/hackaday-prize-2023-stretch-your-day-with-this-29-hour-clock/ https://hackaday.com/2023/09/24/hackaday-prize-2023-stretch-your-day-with-this-29-hour-clock/#comments Sun, 24 Sep 2023 08:00:56 +0000 https://hackaday.com/?p=617147 A wooden digital clock with a metal knob on one endModern 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. …read more]]> A wooden digital clock with a metal knob on one end

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.

]]>
https://hackaday.com/2023/09/24/hackaday-prize-2023-stretch-your-day-with-this-29-hour-clock/feed/ 9 617147 29-Hour Clock
Electrostatic Generator Project Starts With Molten Sulfur https://hackaday.com/2023/09/23/electrostatic-generator-project-starts-with-molten-sulfur/ https://hackaday.com/2023/09/23/electrostatic-generator-project-starts-with-molten-sulfur/#comments Sat, 23 Sep 2023 23:00:56 +0000 https://hackaday.com/?p=617099 A modern recreation of von Guericke's electrostatic generatorAlthough 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 …read more]]> A modern recreation of von Guericke's electrostatic generator

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.

]]>
https://hackaday.com/2023/09/23/electrostatic-generator-project-starts-with-molten-sulfur/feed/ 38 617099 Von Guericke Generator A round-bottom flask containing sulfur being heated in an oil bath