Machine Vision Automates Trainspotting With Unique Full-Length Portraits

As hobbies go, trainspotting is just as valid a choice as any — we don’t judge. But it does present certain logistical challenges, such as having to be in visual range of a train to be able to spot it. There’s also the fact that trains are very large objects, and they tend to move very fast. What’s a railfan to do?

If you’re also technically minded, you might try building an automatic trainspotting bot like [jo-m] has. It looks like the hardware end of “Trainbot” is pretty simple since it has been tested on both x86 and Raspberry Pi, and supports both video4linux and Pi cam. The magic is in the software, which is able to detect a train entering the frame, record images, and then stitch them together into one long image. The whole thing is coded in Go and has some interesting bits, like a custom image patch mapping package.

Trainbot gives an unusual view of a train, one that most of us accustomed to watching a train pass at a crossing have never seen. By stitching small chunks of the train as it passes, Trainbot is able to show the entire train in a single image, which would be impossible to do except for being very, very far away from the track. [jo-m] also built a web interface for Trainbot where you can check out the comings and goings yourself. Each passing train’s image is accompanied by data like its velocity and acceleration, length of the train, and time of passage. There’s also a GIF of the original source video, which is pretty cool.

Here in the States, we don’t have a lot of passenger trains to spot, but we do have some really long freight trains. It’d be interesting to see how this works with a train that’s over a mile long; that would be quite an image. Looks like someone at least has the hardware in place to give it a try.

A small speaker with an LCD showing chatbot responses

AI-Powered Speaker Is A Chatbot You Can Actually Chat With

AI-powered chatbots are pretty cool, but most still require you to type your question on a keyboard and read an answer from a screen. It doesn’t have to be like that, of course: with a few standard tools, you can turn a chatbot into a machine that literally chats, as [Hoani Bryson] did. He decided to make a standalone voice-operated ChatGPT client that you can actually sit next to and have a conversation with.

The base of the project is a USB speaker, to which [Hoani] added a Raspberry Pi, a Teensy, a two-line LCD and a big red button. When you press the button, the Pi listens to your speech and converts it to text using the OpenAI voice transcription feature. It then sends the resulting text to ChatGPT through its API and waits for its response, which it turns into sound again through the eSpeak speech synthesizer. The LCD, driven by the Teensy, shows the current status of the machine and also provides live subtitles while the machine is talking.

To spice up the AI box’s appearance, [Hoani] also added an LED ring which shows a spectrogram of the audio being generated. This small addition really makes the thing come alive, turning it into what looks like a classic Sci-Fi movie prop. Except that this one’s real, of course – we are actually living in the future, with human-like AI all around us.

All code, mostly written in Go, is freely available on [Hoani]’s GitHub page. It also includes a separate audio processing library called toot that [Hoani] wrote to help him interface with the micophone and do spectral analysis. Anyone with basic electronic skills can now build their own AI companion and talk to it – something that ham radio operators have been doing for a while.

Continue reading “AI-Powered Speaker Is A Chatbot You Can Actually Chat With”

A New Commodore C128 Cartridge

A new Commodore C128 cartridge in 2023?  That’s what [idun-projects] set out to do and, as you can see in the video below, did. I did the original C128 hardware design and worked with the amazing team that turned this home computer out in 1985. Honestly, I am amazed that any of them are still working 38 years later, let alone that someone is making new cartridges for it.

I also never thought I would hear about someone’s in-depth experience designing for the ‘128. The post takes us through [idun-project’s] decision to use the ‘128 and how modern expectations apply to all computers, even the old ones. Hot on the list was connectivity and reasonable storage (looking at you, floppy disks).

Continue reading “A New Commodore C128 Cartridge”

Pi Microcontroller Still Runs A Webserver

At first glance, the Raspberry Pi Pico might seem like a bit of a black sheep when compared to the other offerings from the Raspberry Pi Foundation. While most of the rest of their lineup can run Linux environments with full desktops, the Pico is largely limited to microcontroller duties in exchange for much smaller price tags and footprints. But that doesn’t mean it can’t be coerced into doing some of the things we might want a mainline Pi to do, like run a web server.

The project can run a static web page simply by providing the Pico with the project code available on the GitHub page and the HTML that you’d like the Pico to serve. It can be more than a static web page though, as it is also capable of running Python commands through the web interface as well. The server can pass commands from the web server and back as well, allowing for control of various projects though a browser interface. In theory this could be much simpler than building a physical user interface for a project instead by offloading all of this control onto the web server instead.

The project not only supports the RP2040-based Raspberry Pi Pico but can also be implemented on other WiFi-enabled microcontroller boards like the ESP8266 and ESP32. Having something like this on hand could greatly streamline smaller projects without having to reach for a more powerful (and more expensive) single-board computer like a Pi 3 or 4. We’ve seen some other builds on these boards capable of not only running HTML and CSS renderers, but supporting some image formats as well.

Continue reading “Pi Microcontroller Still Runs A Webserver”

A white, house-shaped clock with the words "TEMPUS NECTIT" written in faux Roman script in black on a strip of silver at the base of the "roof." a white power cord extends from the left of the enclosure, and the center of the clock is a 22 pin knitting machine wheel with one pin covered in silver metalic. A white plastic peg extends from the bottom right of the enclosure to hold the feedstock yarn.

Tempus Nectit, A DIY Knitting Clock With Instructions

We’re no strangers to unusual clocks here at Hackaday, and some of our favorites make time a little more tangible like [Kyle Rankin]’s knitting clock.

Inspired by our coverage of [Siren Elise Wilhelmsen]’s knitting clock, [Rankin] decided to build one of his own. Since details on the build from the original artist were sparse, he had to reverse engineer how the device worked. He identified that a knitting clock is essentially a knitting machine with a stepper motor replacing the hand crank.

Using a Raspberry Pi with an Adafruit motor hat connected to a stepper motor and a 3D printed motor adapter, [Rankin] was able to drive the knitting machine to do a complete round of knitting every twelve hours. By marking one of the knitting pegs as an hour hand, the clock works as a traditional clock in addition to its year-long knitting task. [Rankin] says he still has some fine tuning to work on, but that he’s happy to have had the chance to combine so many of his interests into a single project.

If you’re looking for more knitting hacks, check out this knitted keyboard instrument or a knitted circuit board.

Continue reading “Tempus Nectit, A DIY Knitting Clock With Instructions”

IOT Message Board Puts Fourteen-Segment Displays To Work

We’re not sure, but the number of recognizable alphanumeric characters that a seven-segment display can manage seems to have more to do with human pattern recognition than engineering. It takes some imagination, and perhaps a little squinting, to discern some characters, though. Arguably better is the fourteen-segment display, which has been pressed into service in this just-for-funsies IOT message board.

As [Steve] tells the story, this is one of those “boredom-buster” projects that start with a look through the junk bin to see what presents itself. In his case, some fourteen-segment common-cathode LEDs presented themselves, and the result was a simple but fun build. [Steve] used some clever methods to get the display stuffed onto two protoboards, including mounting the current-limiting resistors cordwood-style between the boards. A Raspberry Pi drives the display through a very neatly routed ribbon cable, and the whole thing lives in a tidy wooden box.

The IOT part of the build allows the display to show messages entered on [Steve]’s web page, with a webcam live stream to close the loop. Strangely, the display seems stuck on the “HI HACKADAY!” we entered as a test after [Steve] tipped us off, so we’re not sure if we busted it or what. Apologies if we did, [Steve]. And by the way, if your cats are named [Nibble] and [Pixel], well done!

No matter what you do with them, multi-segment displays are pretty cool. But if you think they’re something new, you’ve got another think coming.

A picture of the bottom of the Pi 4 PCB, showing the three points you need to use to tap into the Pi 4 I2C bus going to the PMIC

Dead Raspberry Pi Boards, PMICs, And New Hope

Since the Raspberry Pi 3B+ release, the Pi boards we all know and love gained one more weakpoint – the PMIC chip, responsible for generating all the power rails a Pi needs. Specifically, the new PMIC was way more vulnerable to shorting 5V and 3.3V power rails together – something that’s trivial to do on a Raspberry Pi, and would leave you with a bricked board. Just replacing the PMIC chip, the MxL7704, wouldn’t help since the Raspberry Pi version of this chip is customized – but now, on Raspberry Pi forums, [Nefarious19] has reportedly managed to replace it and revive their Pi.

First off, you get a replacement PMIC and reflow it – and that’s where, to our knowledge, people have stopped so far. The next step proposed by [Nefarious19] is writing proper values into the I2C registers of the PMIC. For that, you’d want a currently-alive Pi – useful as both I2C controller for writing the values in, and as a source of known-good values. That said, if you go with the values that have been posted online, just having something like a Pi Pico for the I2C part ought to be enough.

[Nefarious19] reports a revived Pi, and this is way more hopeful than the “PMIC failures are unfixable” conclusion we’ve reached before. The instructions are not quite clear – someone else in the thread reports an unsuccessful attempt doing the same, and it might be that there’s a crucial step missing in making the values persist. However, such an advancement is notable, and we trust our readers to take the lead.

A week ago, [Mangy_Dog] on Hackaday Discord brought up fixing Raspberry Pi boards – given that the Raspberry Pi shortages are still an issue, digging up your broken Pi and repairing it starts making sense budget-wise. It’s no longer the ages where you could buy broken Pi boards by the hundred, and we imagine our readers have been getting creative. What are your experiences with fixing Raspberry Pi boards?