Raspberry Pi Real-Time HAT

New Part Day: Raspberry Pi HAT For IEEE1588 Precision Time Protocol

The new Real-Time HAT by InnoRoute adds IEEE1588 PTP support in hardware to a Raspberry Pi 4 nestled beneath. Based around a Xilinx Artix-7 FPGA and a handful of gigabit Ethernet PHY devices, the HAT acts as network-passthrough, adding accurate time-stamps to egress (outgoing) packets and stripping time-stamps from the ingress (incoming) side.

This hardware time-stamping involves re-writing Ethernet packets on-the-fly using specialised network hardware which the Raspberry Pi does not have. Yes, there are software-only 1588 stacks, but they can only get down to 10s of microsecond resolutions, unlike a hardware approach which can get down to 10s of nanoseconds.

1588 is used heavily for applications such as telecoms infrastructure, factory equipment control and anything requiring synchronisation of data-consuming or data-producing devices. CERN makes very heavy use of 1588 for its enormous arrays of sensors and control equipment, for all the LHC experiments. This is the WhiteRabbit System, presumably named after the time-obsessed white rabbit of Alice In Wonderland fame. So, if you have a large installation and a need for precisely controlling when stuff happens across it, this may be just the thing you’re looking for.

IEEE1588 PTP Synchronisation

The PTP client and master device ping a few messages back and forth between themselves, with the network time-stamper recording the precise moment a packet crosses the interface. These time-stamps are recorded with the local clock. This is important. From these measurements, the time-of-flight of the packet and offset of the local clock from the remote clock may be calculated and corrected for. In this way each client node (the hat) in the network will have the same idea of current time, and hence all network packets flowing through the whole network can be synchronised.

The beauty of the system is that the network switches, wiring and all that common infrastructure don’t need to speak 1588 nor have any other special features, they just need to pass along the packets, ideally with a consistent delay.

The Real-Time HAT configures its FPGA via SPI, straight from Raspberry Pi OS, with multiple applications possible, just by a change on the command line. It is possible to upload custom bitstreams, allowing the HAT to be used as a general purpose FPGA dev board should you wish to do so. It even stacks with the official PoE HAT, which makes it even more useful for hanging sensors on the end of a single wire.

Of course, if your needs are somewhat simpler and smaller in scale than a Swiss city, you could just hack a GPS clock source into a Raspberry Pi with a little soldering and call it a day.

SBITX: Hackable HF SDR For The Raspberry Pi

Cheap, easy to use SDR dongles are an immensely powerful tool for learning about radio technology. However, building your own SDR is not something too many hackers are confident to tackle. [Ashhar Farhan, VU2ESE] hopes to change this with the sBITX, a hackable HF SDR transceiver designed around the Raspberry Pi.

[Ashhar] introduced the project in talk at the virtual “Four Days In May” annual conference of the QRP Amateur Radio Club International. Watch the full talk in the video after the break. He first goes over the available open source SDR radios, and then delves into his design decisions for the sBITX. One of the primary goals of the project was to lower the barrier of entry. To do this, he chose the Raspberry Pi as base, and wrote C code that that anyone who has done a bit of Arduino programming should be able to understand and modify. The hardware is designed to be as simple as possible. On the receive side, a simple superheterodyne architecture is used to feed a 25 kHz wide slice of RF spectrum to an audio codec, which send the digitized audio to the Raspberry Pi. The signal is then demodulated in software using FFT. For transmit, the signal is generated in software, and then upconverted to the desired RF frequency. [Ashhar] also created a GUI for the 7″ Raspberry Pi screen.

At the moment the sBITX is still in the development stage, information is spread between the video after the break, it’s accompanying PDF, the GitHub repo, and a thread on the BITX20 group.

[Ashar Farhan] is well known in the ham radio community for low cost radio designs like the BITX, and it’s successor, the μBITX. He also created the Antuino, an Arduino based antenna tester. Continue reading “SBITX: Hackable HF SDR For The Raspberry Pi”

Raspberry Pi Crammed Into Old Film Camera

If you wanted an expensive film camera when you were a kid, you are in luck. Used film SLRs are super cheap now that everyone wants digital cameras. Of course, in reality, you want a digital camera, too. So do what [befinitiv] did. Make a film cartridge out of a Raspberry Pi that can convert your camera to digital. (Video, embedded below.)

In theory, this sounds like a genius idea. The practical aspect isn’t perfect, though. For one thing, the small image sensor used means that the camera is zoomed in quite a bit. Also, the shutter button isn’t integrated, so the shutter is open all the time. You may think that doesn’t matter, but don’t forget that the way an SLR works means if the shutter is open, there’s no viewfinder.

Continue reading “Raspberry Pi Crammed Into Old Film Camera”

New Video Series: Raspberry Pi Pico And RP2040 Deep Dive With Uri Shaked

In case you’ve been living under a rock that doesn’t have internet access, the Raspberry Pi Foundation got into the silicon sales and microcontroller game all at once this year with the Raspberry Pi Pico. It’s small, it’s capable, and it costs a measly $4. Surely you have one or two of them by now, right? But how much do you know about what it can do?

Or maybe you don’t have one yet, but it’s on your list. In either case, you can get started learning about them right away because [Uri Shaked]’s Raspberry Pi Pico and RP2040 Deep Dive course has recently been freed from the hallowed halls of HackadayU. He even built an emulator to go with it. [Uri] is a great instructor, and we’re sure that goes double if you ever need a salsa dance teacher, which he has also mastered.

This class was held for five weeks beginning in May 2021, with each session being roughly an hour long. The only prerequisite is a basic understanding of bitwise math, but there are resources for that on the class IO page linked above.

Each class is incredibly well-organized and informative. In the first class, [Uri] begins building a living document that includes the class agenda, links to all resources used and mentioned, code examples, and assembly instructions where applicable. It’s basically a syllabus plus a whole lot more. [Uri] also spends a lot of time in the incredibly thorough 649-page data sheet for the RP2040, and a little bit of time in the much shorter Getting Started guide. If you think the data sheet is inaccessible, you’ll likely change your tune by the end of the first class after you’ve seen [Uri] use and peruse it.

Continue reading “New Video Series: Raspberry Pi Pico And RP2040 Deep Dive With Uri Shaked”

Raspberry Pi Server Cluster In 1U Rack-Mount Case

[Paul Brown] wants to take advantage of off-site server colocation services. But the providers within [Paul]’s region typically place a limit of 1A @ 120V on each server. Rather than search out commercial low-power solutions, [Paul] embraced the hacker spirit and built his own server from five Raspberry Pi 4b single board computers.

The task involves a little bit more than just mounting five Pi4s in a chassis and calling it done. There is an Ethernet switch connecting all the modules to the network, and each Pi has a comparatively bulky SSD drive + enclosure attached. By far the most annoying part of the assembly is the power supply and distribution cabling, which is further complicated by remote controlled power switching relays (one of the computers is dedicated to power management and can shut the other four modules on and off).

Even if you’re not planning on building your own server, check out the thoroughly documented assembly process and parts list — we particularly liked the USB connector to screw terminal breakout connector that he’s using for power distribution. For all the detailed information, assembly instructions and photos, we think a top-level block diagram / interconnection drawing would be very helpful for anyone trying to understand or replicate this project.

There are a lot of connections in this box, and the final result has a messy look-and-feel. But in fairness to [Paul]’s craftsmanship, there aren’t many other ways to hook everything together given the Raspberry Pi form-factor. Maybe a large and costly PCB or using CM4 modules instead of Raspberry Pi boards could help with cable management? In the end, [Paul] reckons he shelled out about $800 for this unit. He compares this expense with some commercial options in his writeup, which shows there are some cheaper and more powerful solutions. But while it may be cheaper to buy, we understand that strong urge to roll your own.

We’ve written about many Pi cluster projects in the past, including this one which contains a whopping 750 Raspberry Pis. Have you ever used a colocation service, and if so, did you use a DIY or an off-the-shelf server?

Smart Mirror Talks To 3D Printers

As time goes by, it’s only getting easier to make a magic mirror. You know, a mirror connected to the internet that shows information like news, weather, or whatever you want, right there on top of your stunning visage. In [Forsyth Creations]’ case, that data includes 3D printer activity on the network — something that’s way more relevant to daily life than say, headlines about Kim Jong Un’s weight loss progress. The build video is embedded below.

Thanks to projects like [MichMich]’s MagicMirror, everything is done with modules, including really useful things such as OctoMirror that let you keep an eye on your 3D printer(s) using OctoPrint.

The electronics are pretty simple here — [Forsyth Creations] used the guts of an old monitor for the display and a Raspberry Pi to serve up the modules as a web page. The only tricky part is power, because the LCD is going to need so much more voltage than the Pi and the absolutely necessary LEDs around the edge, but a couple of buck converters do the trick.

After stripping the monitor of all of its unnecessary plastic, [Forsyth Creations] cut rear and front frames to support the electronics. That isn’t a piece of mirror glass, it’s actually one-way acrylic which is lighter and somewhat cheaper. [Forsyth Creations] designed and printed some corner support brackets that double as leveling screw holders to get the acrylic panel dialed in just right, and you can get these for yourself from GitHub. We think this would be a good early woodworking project or something for a long weekend. [Forsyth Creations] built this in three days on an apartment balcony using a minimum of tools.

We especially admire that once it was done, he hung it up with a French cleat. Those are so useful.

Continue reading “Smart Mirror Talks To 3D Printers”

Analog Camera Goes Digital

The digital camera revolution swept through the world in the early 2000s, and aside from some unique situations and a handful of artists still using film, almost everyone has switched over to digital since then. Unfortunately that means that there’s a lot of high quality film cameras in the world that are gathering dust, but with a few pieces of equipment it’s possible to convert them to digital and get some more use out of them.

[befinitiv]’s latest project handles this conversion by swapping in a Raspberry Pi Zero where the film cartridge would otherwise be inserted into the camera. The Pi is attached to a 3D-printed case which mimics the shape of the film, and also houses a Pi camera right in front of the location where the film would be exposed. By removing the Pi camera’s lens, this new setup is able to take advantage of the analog camera’s optics instead and is able to capture images of relatively decent quality.

There are some perks of using this setup as well, namely that video can be broadcast to this phone over a wireless connection to a computer via the Raspberry Pi. It’s a pretty interesting build with excellent results for a remarkably low price tag, and it would be pretty straightforward to interface the camera’s shutter and other control dials into the Raspberry Pi to further replicate the action of an old film camera. And, if you enjoy [befinitiv]’s projects of bringing old tech into the modern world, be sure to check out his 80s-era DOS laptop which is able to run a modern Linux installation.

Continue reading “Analog Camera Goes Digital”