MoreRSS

site iconHackadayModify

Hackaday serves up Fresh Hacks Every Day from around the Internet. Our playful posts are the gold-standard in entertainment for engineers and engineering enthusiasts.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of Hackaday

Do You Trust this AI for Your Surgery?

2025-07-15 04:00:00

If you are looking for the perfect instrument to start a biological horror show in our age of AI, you have come to the right place. Researchers at Johns Hopkins University have successfully used AI-guided robotics to perform surgical procedures. So maybe a bit less dystopian, but the possibilities are endless.

Pig parts are used as surrogate human gallbladders to demonstrate cholecystectomies. The skilled surgeon is replaced with a Da Vinci research kit, similarly used in human controlled surgeries.

Researchers used an architecture that uses live imaging and human corrections to input into a high-level language model, which feeds into the controlling low-level model. While there is the option to intervene with human input, the model is trained to and has demonstrated the ability to self-correct. This appears to work fairly well with nothing but minor errors, as shown in an age-restricted YouTube video. (NOTE: SURGICAL IMAGERY WATCH AT YOUR OWN RISK)

Flowchart showing the path of video to LLM to low level model to control robot

It’s noted that the robot performed slower than a traditional surgeon, trading time for precision. As always, when talking about anything medical, it’s not likely we will be seeing it on our own gallbladders anytime soon, but maybe within the next decade. If you want to read more on the specific advancements, check out the paper here.

Medical hacking isn’t always the most appealing for anyone with a weak stomach. For those of us with iron guts make sure to check out this precision tendon tester!

2025 One Hertz Challenge: Valvano Clock Makes the Seconds Count

2025-07-15 02:30:00

A man named [Jim Valvano] once said “There are 86,400 seconds in a day. It’s up to you to decide what to do with them.” — while we couldn’t tell you who [Jim Valvano] was without a google search*, his math checks out. The quote was sufficiently inspirational to inspire [danjovic] to create a clock count those seconds precisely.

It’s a simple project, both conceptually and electrically. All it does is keep time and count the seconds in the day– a button press switches between counting down, counting up, and HH:MM:SS. In every mode, though, the number displayed will change at one Hertz, which we appreciate as being in the spirit of the challenge. There are only four components:  an Arduino Nano, a DS3231 RTC module, a SSD1306 128×64 OLED module, and a momentary pushbutton. At the moment it appears this project is only on breadboard, which is a shame– we think it deserves to have a fancy enclosure and pride of place on the wall. Wouldn’t you be more productive if you could watch those 86,400 seconds ticking away in real time? We think it would be motivating.

Perhaps it will motivate you to create something for our One Hertz Challenge. Plenty of seconds to go until the deadline on August 19th, after all. If you’d rather while away the time reading, you can check out some of [danjovic]’s other projects, like this Cistertian-inspired clock, or this equally-inscruitable timekeeper that uses binary-coded octal.

2025 Hackaday One Hertz Challenge

 

*Following a google search, he was an American college basketball coach in the mid-20th century.

Robots Want the Jobs You Can’t Do

2025-07-15 01:00:11

There’s something ominous about robots taking over jobs that humans are suited to do. Maybe you don’t want a job turning a wrench or pushing a broom, but someone does. But then there are the jobs no one wants to do or physically can’t do. Robots fighting fires, disarming bombs, or cleaning up nuclear reactors is something most people will support. But can you climb through a water pipe from the inside? No? There are robots that are available from several commercial companies and others from university researchers from multiple continents.

If you think about it, it makes sense. For years, companies that deal with pipes would shoot large slugs, or “pigs”, through the pipeline to scrape them clean. Eventually, they festooned some pigs with sensors, and thus was born the smart pig. But now that it is possible to make tiny robots, why not send them inside the pipe to inspect and repair?

Why?

It makes sense that anything you can do from inside the pipe is probably going to be cheaper than digging up buried pipe and either repairing or replacing it. For example, 4 cm robots from the University of Sheffield can inspect pipes from inside, cooperate in swarms, and locate leaks that would be nearly impossible to find conventionally.

In fact, robots inside pipes aren’t a totally new idea. But in the past, the pipes had to be very large to fit the robot. This newer class of pipe inspecting and repairing robots can fit inside smaller pipes like you might find in a city’s water supply. For example, the Easy-Sight X5 (see the video below) fits in a 100 mm pipe, and it is big when compared to some of the newer competitors.

Not Just Inspection

The Carnegie Mellon robot is modular, so it can handle different kinds of jobs. A mobility module has two-inch wheels and can haul up to sixty pounds of payload. One of those payloads is an applicator for a special resin that can repair leaks.

The resin starts out with the consistency of soft-serve ice cream but quickly hardens as it shoots out of a spinning nozzle that creates a spring-like inner coating spiraling around the inside of the pipe.

The robot’s no speed demon. It can inspect about nine miles of pipe in eight hours. However, when repairing, the same time period is sufficient to fix 1.8 miles of pipe. Even big names like GE are working on similar technology that will spray epoxy to form a new pipe inside an old pipe.

DIY

Could you do this yourself? There’s no reason you couldn’t make an inspection robot. [Stargate Systems] did using a Raspberry Pi Zero, and you can check it out in the video below. Repair might be a bit more complex, but might be workable with a little ingenuity.

Dirty Jobs

Even if you and your submarine were shrunk down, you probably don’t want this job. There are probably dozens of jobs you can’t or don’t want to do. Will you build a robot to do it? Let us know in the comments or — better — built it and leave us a tip.

We wonder why these robots don’t look more like snakes.

Coroutines in C

2025-07-14 23:30:21

It is virtually a rite of passage for C programmers to realize that they can write their own cooperative multitasking system. C is low-level enough, and there are several ways to approach the problem, so, like Jedi light sabers, each one is a little bit different. [Christoph Wolcher] took his turn, and not only is his system an elegant hack, if that’s not an oxymoron, it is also extremely well documented.

Before you dig in, be warned. [Christoph] fully admits that you should use an RTOS. Or Rust. Besides, after he finished, he discovered the protothreads library, which does a similar task in a different way that is both more cool and more terrible all at the same time.

Once you dig in, though, you’ll see the system relies on state machines. Just to prove the point, he writes a basic implementation, which is fine, but hard to parse and modify. Then he shows a simple implementation using FreeRTOS, which is fine except for, you know, needing FreeRTOS.

Using a simple set of macros, it is possible to get something very similar to the RTOS version that runs independently, like the original version. Most of the long code snippets show you what code the macros generate. The real code is short and to the point.

Multiprocessing is a big topic. You can have processes, threads, fibers, and coroutines. Each has its pros and cons, and each has its place in your toolbox.

Hacking When It Counts: DIY Prosthetics and the Prison Camp Lathe

2025-07-14 22:00:06

There are a lot of benefits to writing for Hackaday, but hands down one of the best is getting paid to fall down fascinating rabbit holes. These often — but not always — delightful journeys generally start with chance comments by readers, conversations with fellow writers, or just the random largesse of The Algorithm. Once steered in the right direction, a few mouse clicks are all it takes for the properly prepared mind to lose a few hours chasing down an interesting tale.

I’d like to say that’s exactly how this article came to be, but to be honest, I have no idea where I first heard about the prison camp lathe. I only know that I had a link to a PDF of an article written in 1949, and that was enough to get me going. It was probably a thread I shouldn’t have tugged on, but I’m glad I did because it unraveled into a story not only of mechanical engineering chops winning the day under difficult circumstances, but also of how ingenuity and determination can come together to make the unbearable a little less trying, and how social engineering is an important a skill if you want to survive the unsurvivable.

Finding Reggie

For as interesting a story as this is, source material is hard to come by. Searches for “prison camp lathe” all seem to point back to a single document written by one “R. Bradley, A.M.I.C.E” in 1949, describing the building of the lathe. The story, which has been published multiple times in various forms over the ensuing eight decades, is a fascinating read that’s naturally heavy on engineering details, given the subject matter and target audience. But one suspects there’s a lot more to the story, especially from the few tantalizing details of the exploits surrounding the tool’s creation that R. Bradley floats.

Tracking down more information about Bradley’s wartime experiences proved difficult, but not impossible. Thankfully, the United Kingdom’s National Archives Department has an immense trove of information from World War II, including a catalog of the index cards used by the Japanese Empire to keep track of captured Allied personnel. The cards are little more than “name, rank, and serial number” affairs, but that was enough to track down a prisoner named Reginald Bradley:

Now, it’s true that Reginald Bradley is an extremely British name, and probably common enough that this wasn’t the only Reggie Bradley serving in the Far East theater in World War II. And while the date of capture, 15 February 1942, agrees with the date listed in the lathe article, it also happens to be the date of the Fall of Singapore, the end of a seven-day battle between Allied (mainly British) forces and the Japanese Imperial Army and Navy that resulted in the loss of the island city-state. About 80,000 Allied troops were captured that day, increasing the odds of confusing this Reginald Bradley with the R. Bradley who wrote the article.

The clincher, though, is Reginald Bradley’s listed occupation on the prisoner card: “Chartered Civil Engineer.” Even better is the information captured in the remarks field, which shows that this prisoner is an Associate Member of the Institution of Civil Engineers, which agrees with the “A.C.I.M.E” abbreviation in the article’s byline. Add to that the fact that the rank of Captain in the Royal Artillery listed on the card agrees with the author’s description of himself, and it seems we have our man. (Note: it’s easy to fall into the genealogical rabbit hole at this point, especially with an address and mother’s name to work with. Trust me, though; that way lies madness. It’s enough that the index card pictured above cost me £25 to retrieve from one of the National Archive’s “trusted partner” sites.)

The Royal Society of Social Engineers

The first big question about Captain Bradley is how he managed to survive his term as a prisoner of the Japanese Empire, which, as a non-signatory to the various international conventions and agreements on the treatment of prisoners of war, was famed for its poor treatment of POWs. Especially egregious was the treatment of prisoners assigned to build the Burma Death Railway, an infrastructure project that claimed 45 lives for every mile of track built. Given that his intake card clearly states his civil engineering credentials with a specialty in highways and bridges, one would think he was an obvious choice to be sent out into the jungle.

Rather than suffering that fate, Captain Bradley was sent to the infamous prison camp that had been established in Singapore’s Changi Prison complex. While not pleasant, it was infinitely preferable to the trials of the jungle, but how Bradley avoided that fate is unclear, as he doesn’t mention the topic at all in his article. He does, however, relate a couple of anecdotes that suggest that bridges and highways weren’t his only engineering specialty. Captain Bradley clearly had some social engineering chops too, which seem to have served him in good stead during his internment.

Within the first year of his term, he and his fellow officers had stolen so many tools from their Japanese captors that it was beginning to be a problem to safely stash their booty. They solved the problem by chatting up a Japanese guard under the ruse of wanting to learn a little Japanese. After having the guard demonstrate some simple pictograms like “dog” and “tree,” they made the leap to requesting the symbol for “workshop.” Miraculously, the guard fell for it and showed them the proper strokes, which they copied to a board and hung outside the officer’s hut between guard changes. The new guard assumed the switch from hut to shop was legitimate, and the prisoners could finally lay out all their tools openly and acquire more.

Another bit of social engineering that Captain Bradley managed, and probably what spared him from railway work, was his reputation as a learned man with a wide variety of interests. This captured the attention of a Japanese general, who engaged the captain in long discussions on astronomy. Captain Bradley appears to have cultivated this relationship carefully, enough so that he felt free to gripe to the general about the poor state of the now officially sanctioned workshop, which had been moved to the camp’s hospital block. A care package of fresh tools and supplies, including drill bits, hacksaw blades, and a supply of aluminum rivets, which would prove invaluable, soon arrived. These joined their pilfered tool collection along with a small set of machines that were in the original hospital shop, which included a hand-operated bench drill, a forge, some vises, and crucially, a small lathe. This would prove vital in the efforts to come, but meanwhile, the shop’s twelve prisoner-machinists were put to work making things for the hospital, mainly surgical instruments and, sadly, prosthetic limbs.

The Purdon Joint

Australian POWs at the Changi camp sporting camp-made artificial legs, some with the so-called “Purdon Joint.” This picture was taken after liberation, which explains the high spirits. Source: Australian War Memorial, public domain.

In his article, Captain Bradley devotes curiously little space to descriptions of these prosthetics, especially since he suggests that his “link-motion” design was innovative enough that prisoners who had lost legs to infection, a common outcome even for small wounds given the poor nutrition and even poorer sanitation in the camps, were able to walk well enough that a surgeon in the camp, a British colonel, noted that “It is impossible to tell that the walker is minus a natural leg.” The lack of detail on the knee’s design might also be due to modesty, since other descriptions of these prostheses credit the design of the knee joint to Warrant Officer Arthur Henry Mason Purdon, who was interned at Changi during this period.

A number of examples of the prosthetic legs manufactured at “The Artificial Limb Factory,” as the shop was now dubbed, still exist in museum collections today. The consensus design seems to accommodate below-the-knee amputees with a leather and canvas strap for the thigh, a hinge to transfer most of the load from the lower leg to the thigh around the potentially compromised knee, a calf with a stump socket sculpted from aluminum, and a multi-piece foot carved from wood. The aluminum was often salvaged from downed aircraft, hammered into shape and riveted together. When the gifted supply of aluminum rivets was depleted, Bradley says that new ones were made on the lathe using copper harvested from heavy electrical cables in the camp.

A camp-made artificial leg, possibly worn by Private Stephen Gleeson. He lost his leg while working on the Burma Death Railway and may have worn this one in camp. Source: Australian War Memorial

It Takes a Lathe to Make a Lathe

While the Limb Factory was by now a going concern that produced items necessary to prisoners and captors alike, life in a prison camp is rarely fair, and the threat of the entire shop being dismantled at any moment weighed heavily on Captain Bradley and his colleagues. That’s what spurred the creation of the lathe detailed in Bradley’s paper — a lathe that the Japanese wouldn’t know about, and that was small enough to hide quickly, or even stuff into a pack and take on a forced march.

The paper goes into great detail on the construction of the lathe, which started with the procurement of a scrap of 3″ by 3″ steel bar. Cold chisels and drills were used to shape the metal before surfacing it on one of the other lathes using a fly cutter. Slides were similarly chipped from 1/2″ thick plate, and when a suitable piece of stock for the headstock couldn’t be found, one was cast from scrap aluminum using a sand mold in a flask made from sheet steel harvested from a barracks locker.

The completed Bradley prison camp lathe, with accessories. The lathe could be partially disassembled and stuffed into a rucksack at a moment’s notice. Sadly, the post-war whereabouts of the lathe are unknown. Source: A Small Lathe Built in a Japanese Prison Camp, by R. Bradley, AMICE.

Between his other shop duties and the rigors of prison life, Captain Bradley continued his surreptitious work on the lathe, and despite interruptions from camp relocations, was able to complete it in about 600 hours spread over six months. He developed ingenious ways to power the lathe using old dynamos and truck batteries. The lathe was used for general maintenance work in the shop, such as making taps and dies to replace worn and broken ones from the original gift of tools bequeathed by the Japanese general.

With the end of the war approaching, the lathe was put to use making the mechanical parts needed for prison camp radios, some of which were ingeniously hidden in wooden beams of the barracks or even within the leg of a small table. The prisoners used these sets to listen for escape and evasion orders from Allied command, or to just get any news of when their imprisonment might be over.

That day would come soon after the atomic bombing of Hiroshima and Nagasaki and Japan’s subsequent surrender in August 1945. The Changi prison camp was liberated about two weeks later, with the survivors returning first to military and later to civilian life. Warrant Officer Purdon, who was already in his 40s when he enlisted, was awarded a Distinguished Combat Medal for his courage during the Battle of Singapore. As for Captain Bradley, his trail goes cold after the war, and there don’t seem to be any publicly available pictures of him. He was decorated by King George VI after the war, though, “for gallant and distinguished service while a prisoner of war,” as were most other POWs. The award was well-earned, of course, but an understatement in the extreme for someone who did so much to lighten the load of his comrades in arms.

Featured image: “Warrant Officer Arthur Henry Mason Purdon, Changi Prison Camp, Singapore. c. 1945“, Australian War Memorial.

A Budget Quasi-Direct-Drive Motor Inspired By MIT’s Mini Cheetah

2025-07-14 19:00:00

Two views of a motor are shown. On the left, a ring of copper-wire-wound stator arms is visible inside a ring of magnets. Inside this, a planetary gearbox is visible, with three mid-sized gears surrounding a small central gear. On the right, the same motor is shown, but with the internal components mostly covered by a black faceplate with brass inserts.

It’s an unfortunate fact that when a scientist at MIT describes an exciting new piece of hardware as “low-cost,” it might not mean the same thing as if a hobbyist had said it. [Caden Kraft] encountered this disparity when he was building a SCARA arm and needed good actuators. An actuator like those on MIT’s Mini Cheetah would have been ideal, but they cost about $300. Instead, [Caden] designed his own actuator, much cheaper but still with excellent performance.

The actuator [Caden] built is a quasi-direct-drive actuator, which combines a brushless DC motor with an integrated gearbox in a small, efficient package. [Caden] wanted all of the custom parts in the motor to be 3D printed, so a backing iron for the permanent magnets was out of the question. Instead, he arranged the magnets to form a Halbach array; according to his simulations, this gave almost identical performance to a motor with a backing iron. As a side benefit, this reduced the inertia of the rotor and let it reverse more easily.

To increase torque, [Caden] used a planetary gearbox with cycloidal gear profiles, which may be the stars of the show here. These reduced backlash, decreased stress concentration on the teeth, and were easier to 3D print. He found a Python program to generate planetary gearbox designs, but ended up creating a fork with the ability to export 3D files. The motor’s stator was commercially-bought and hand-wound, and the finished drive integrates a cheap embedded motor controller.

To test the actuator, [Caden] attached an arm and applied perpendicular force. The actuator only failed on the first test because it was drawing more current than his power supply could provide, so he tested again with an EV battery module. This time, it provided 29.4 Nm of torque, almost three times his initial goal, without suffering any damage. [Caden] only stopped the test because it was drawing 50 A, and he thought he was getting close to the hardware’s limit. Given that he was able to build the entire actuator for less than $80, we think he’s well exceeded his goals.

If you’re interested in the inspiration for this actuator, we’ve covered the Mini Cheetah before. We’ve also seen these drives used to build other quadrupedal robots.

Thanks to [Delilah] for the tip!