Time-of-Flight Sensors: How Do They Work?

With the right conditions, this tiny sensor can measure 12 meters

If you need to measure a distance, it is tempting to reach for the ubiquitous ultrasonic module like an HC-SR04. These work well, and they are reasonably easy to use. However, they aren’t without their problems. So maybe try an IR time of flight sensor. These also work well, are reasonably easy to use, and have a different set of problems. I recently had a project where I needed such a sensor, and I picked up a TF-MiniS, which is a popular IR distance sensor. They aren’t very expensive, and they work serial or I2C. So how did it do?

The unit itself is tiny and has good specifications. You can fit the 42 x 15 x 16 mm module anywhere. It only weighs about five grams — as the manufacturer points out, less than two ping-pong balls. It needs 5 V but communicates using 3.3 V, so integration isn’t much of a problem.

At first glance, the range is impressive. You can read things as close as 10 cm and as far away as 12 m. I found this was a bit optimistic, though. Although the product sometimes gets the name of LiDAR, it doesn’t use a laser. It just uses an IR LED and some fancy optics.

Continue reading “Time-of-Flight Sensors: How Do They Work?”

You Can Now Play DOOM In Microsoft Word, But You Probably Shouldn’t

DOOM used to primarily run on x86 PCs. It later got ported to a bunch of consoles with middling success, and then everything under the sun, from random embedded systems to PDFs. Now, thanks to [Wojciech Graj], you can even play it in Microsoft Word.

To run DOOM inside Microsoft Word, you must enable VBA macros, and ignore security warnings, to boot. You’ll need a modern version of Word, and it will only work on Windows on an x64 CPU. As you might imagine, too, the *.DOCM file is not exactly lightweight. It comes in at 6.6 MB, no surprise given it contains an entire FPS. It carries inside it a library called doomgeneric_docm.dll and the whole doom1.wad data file. Once the file is opened, a macro then extracts all the game data and executes it.

If you think that Microsoft Word doesn’t really have a way of displaying live game graphics, you’d be correct. Instead, that DLL is creating a bitmap image of the game state for every frame, which is then displayed inside Word itself. It uses the GetAsyncKeyState function to grab inputs from the arrow keys, number keys, and CTRL and space so the player can move around. It certainly sounds convoluted, but it actually runs pretty smoothly given all the fuss.

While this obviously works, you shouldn’t get in the habit of executing random code in your word processor. It’s just not proper, you see, like elbows on the dinner table! And, you know. It’s insecure. So don’t do that.

Continue reading “You Can Now Play DOOM In Microsoft Word, But You Probably Shouldn’t”

Innovative Clock Uses Printed Caustic Lens

Hackers and makers have built just about every kind of clock under the sun. Digital, analog, seven-segment, mechanical seven-segment, binary, ternary, hexadecimal… you name it. It’s been done. You really have to try to find something that shocks us… something we haven’t seen before. [Moritz v. Sivers] has done just that. 

Wild. Just wild.

Meet the Caustic Clock. It’s based on the innovative Hollow Clock from [shiura]. It displays time with an hour hand and a minute hand, and that’s all so conventional. But what really caught our eye was the manner in which its dial works. It uses caustics to display the clock dial on a wall as light shines through it.

If you’ve ever seen sunlight reflect through a glass, or the dancing patterns in an outdoor swimming pool, you’ve seen caustics at play. Caustics are the bright patterns we see projected through a transparent object, and if you shape that object properly, you can control them. In this case, [Moritz] used some GitHub code from [Matt Ferraro] to create a caustic projection clockface, and 3D printed it using an SLA printer.

The rest of the clock is straightforward enough—there’s some WS2812 LEDs involved, an Arduino Nano, and even an RP2040. But the real magic is in the light show and how it’s all achieved. We love learning about optics, and this is a beautiful effect well worth studying yourself.

Continue reading “Innovative Clock Uses Printed Caustic Lens”

Bone Filament, For Printing Practice Bones

Of course there is bone-simulation filament on the market. What’s fun about this Reddit thread is all of the semi-macabre concerns of surgeons who are worried about its properties matching the real thing to make practice rigs for difficult surgeries. We were initially creeped out by the idea, but now that we think about it, it’s entirely reassuring that surgeons have the best tools available for them to prepare, so why not 3D prints of the actual patient’s bones?

[PectusSurgeon] says that the important characteristics were that it doesn’t melt under the bone saw and is mechanically similar, but also that it looks right under x-ray, for fluorscopic surgery training. But at $100 per spool, you would be forgiven for looking around for substitutes. [ghostofwinter88] chimes in saying that their lab used a high-wood-content PLA, but couldn’t say much more, and then got into a discussion of how different bones feel under the saw, before concluding that they eventually chose resin.

Of course, Reddit being Reddit, the best part of the thread is the bad jokes. “Plastic surgery” and “my insurance wouldn’t cover gyroid infill” and so on. We won’t spoil it all for you, so enjoy.

When we first read “printing bones”, we didn’t know if they were discussing making replacement bones, or printing using actual bones in the mix. (Of course we’ve covered both before. This is Hackaday.)

Thanks [JohnU] for the tip!

Robotics Class Is Open

If you are like us, you probably just spin up your own code for a lot of simple projects. But that’s wasteful if you are trying to do anything serious. Take a robot, for example. Are you using ROS (Robot Operating System)? If not — or even if you are — check out [Janne Karttunene] and the University of Eastern Finland’s open-source course Robotics and ROS 2 Essentials.

The material is on GitHub. Rather than paraphrase, here’s the description from the course itself:

This course is designed to give you hands-on experience with the basics of robotics using ROS 2 and Gazebo simulation. The exercises focus on the Andino robot from Ekumen and are structured to gradually introduce you to ROS 2 and Docker.

No prior experience with ROS 2 or Docker is needed, and since everything runs through Docker, you won’t need to install ROS 2 on your system beforehand. Along the way, you’ll learn essential concepts like autonomous navigation and mapping for mobile robots. All the practical coding exercises are done in Python.

Topics include SLAM, autonomous navigation, odometry, and path planning. It looks like it will be a valuable resource for anyone interested in robotics or anything else you might do with ROS.

If you want a quick introduction to ROS, we can help. We’ve seen a number of cool ROS projects over the years.

Hackaday Links Column Banner

Hackaday Links: January 19, 2025

This week, we witnessed a couple of space oopsies as both Starship and New Glenn suffered in-flight mishaps on the same day. SpaceX’s Starship was the more spectacular, with the upper stage of the seventh test flight of the full stack experiencing a “rapid unscheduled disassembly” thanks to a fire developing in the aft section of the stage somewhere over the Turks and Caicos islands, about eight and a half minutes after takeoff from Boca Chica. The good news is that the RUD happened after first-stage separation, and that the Super Heavy booster was not only able to safely return to the pad but also made another successful “chopsticks” landing on the tower. Sorry, that’s just never going to get old.

On the Bezos side of the billionaire rocket club, the maiden flight of Blue Origin’s New Glenn ended with the opposite problem. The upper stage reached orbit, but the reusable booster didn’t make it back to the landing barge parked off the Bahamas. What exactly happened isn’t clear yet, but judging by the telemetry the booster was coming in mighty fast, which may indicate that the engines didn’t restart fully and the thing just broke up when it got into the denser part of the atmosphere.

Continue reading “Hackaday Links: January 19, 2025”

Dillo Turns 25, And Releases A New Version

The chances are overwhelming, that you are reading this article on a web browser powered by some form of the Blink or WebKit browser engines as used by Google, Apple, and many open source projects, or perhaps the Gecko engine as used by Firefox. At the top end of the web browser world there are now depressingly few maintained browser engines — we think to the detriment of web standards evolution.

Moving away from the big players though, there are several small browser projects which eschew bells and whistles for speed and compactness, and we’re pleased to see that one of the perennial players has released a new version as it passes its quarter century.

Dillo describes itself as ” a fast and small graphical web browser”, and it provides a basic window on the web with a tiny download and the ability to run on very low-end hardware. Without JavaScript and other luxuries it sometimes doesn’t render a site as you’d see it in Chrome or Firefox, but we’re guessing many users would relish some escape from the web’s cycle-sucking garbage. The new version 3.2.0 brings bug fixes, as well as math formula rendering, and navigation improvements.

The special thing about Dillo is that this is a project which came back from the dead. We reported last year how a developer resurrected it after a previous release back in 2015, and it seems that for now at least it has a healthy future. So put it on your retro PC, your original Raspberry Pi, or your Atari if you have one, and try it on your modern desktop if you need reminding just how fast web browsing can be.

This isn’t the only interesting browser project on the block, we’re also keeping an eye on Ladybird, which is aiming for those big players rather than simplicity like Dillo.

Thanks [Feinfinger] for the tip.