Digital “Toy” Camera, Made For Tilt-Shift And Other Analog-Like Experimenting

Like many others, [volzo] loves playing with photography in a playful and experimental way. Oddball lenses, vintage elements, and building from kits is what that world looks like. But that kind of stuff is really the domain of film cameras, or at least it was until [volzo] created his Digital Toy Camera design. The result? A self-built, lomography-friendly digital camera that allows for all kinds of weird and wonderful attachments and photo shenanigans.

3D-printed mounts and magnetic attachment makes swapping parts a breeze.

To make a DIY digital camera that allowed that kind of play, the first problem [volzo] had to solve was deciding on an image sensor. It turns out that sourcing image sensors as an individual is a pretty cumbersome process, and even if successful, one still needs to write a driver and create things from the ground up. So, the guts of [volzo]’s creations use the Raspberry Pi and camera sensor ecosystem and M12 lenses, a decision that allows him to focus on the rest of the camera.

3D printing, a bit of CNC machining, and some clever design yields a “toy” camera: simple, inexpensive, and enabling one to take a playful and experimental approach to photography. The design files are available on GitHub, and there are some neat elements to the design. Magnetic mounts allow for easy swapping of lens assemblies, and a M12 x 0.75 tap cuts perfect threads into 3D-printed pieces for M12 lenses.

Heat-set inserts also provide robust fastening that can hold up to disassembly and re-assembly (and don’t miss that our own [Joshua Vasquez] has shared how best to design for and use heat-set inserts.)

[volzo] has a fantastic video to accompany his project; give it a watch (embedded below, under the page break) and see if you don’t come away with some inspiration of your own.

Continue reading “Digital “Toy” Camera, Made For Tilt-Shift And Other Analog-Like Experimenting”

Stratum 1 Grandmaster Time Server On A Budget

[Jeff Geerling] has been following the various open source time projects for some time now, and is finally able to demonstrate a working and affordable solution for nanoseconds-accurate timekeeping in your local lab. The possibility of a low-cost time server came about with the introduction of the Raspberry Pi CM4 compute module back in Oct 2020, whose Broadcom network chip (BCM54210PE) supports PTP (Precision Time Protocol, IEEE-1588) 1PPS output and hardware-based time stamping. Despite the CM4 data sheet specifying PTP support, it wasn’t available in the kernel. An issue was raised in Feb last year, and Raspberry Pi kernel support was finally released this month.

[Jeff] demonstrates how easy it is to get two CM4 modules to synchronize to within a few tens of nanoseconds in the video below the break. That alone can be very useful on many projects. But if you want really stable and absolute time, you need a stratum 1 external source. These time servers, called grandmasters in PTP nomenclature, have traditionally been specialized pieces of kit costing tens of thousands of dollars, using precision oscillators for stability and RF signals from stratum 0 devices like navigation satellites or terrestrial broadcast stations to get absolute time. But as Lasse Johnsen, who worked on the kernel updates remarks in the video:

In 2022 these purpose-built grandmaster clocks from the traditional vendors are about as relevant as the appliance web servers like the Raq and Qube were back in 1998.

It is now possible to build your own low-cost stratum 1 time server in your lab from open source projects. Two examples shown in the video. The Open Time Server project’s Timecard uses a GNSS satellite receiver and a Microchip MAC-SA5X Rubidium oscillator. If that’s overkill for your projects or budget, the Time4Pi CM4 hat is about to be release for under $200. If accurate time keeping is your thing, the technology is now within reach of the average home lab. You can also add PTP to a non-CM4 Raspberry Pi — check out the Real-Time HAT that we covered last year.

Continue reading “Stratum 1 Grandmaster Time Server On A Budget”

Part of a picture showing all kinds of different CAN devices in a car

CAN Peripheral For RP2040, Courtesy Of PIO

[Kevin O’Connor] writes to us about his project, can2040adding CAN support to the RP2040. The RP2040 doesn’t have a CAN peripheral, but [Kevin] wrote code for the RP2040’s PIO engine that can receive and send CAN packets. Now we can all benefit from his work by using this openly available CAN driver. This library is written in C, so it’s a good fit for the lower-level hackers among us, and in all likelihood, it wouldn’t be hard to make a MicroPython wrapper around it.

The CAN bus needs a peripheral for the messages to be handled properly, and people have been using external chips for this purpose until now. These chips, [Kevin] tells us, have lately been unavailable due to the chip shortage, making this project more valuable. The documentation is extensive and accessible, and [Kevin] details how to best use this driver. With such a tool in hand, you can now turn your Pico into a CAN tinkering toolkit, or wire up some CAN devices for use in your own projects!

[Kevin] says this code is already being used in Klipper, a framework powering 3D printers and other machines like them. As for your own purposes, you can absolutely use such a CAN tool to hack on your car – here’s a treasure trove of car hacking documentation, by the way! Thanks to the PIO engine, there seems to be no end to the RP2040’s versatility – you can even drive HDMI monitor with this PIO-based DVI code.

Continue reading “CAN Peripheral For RP2040, Courtesy Of PIO”

A Mostly Fair Deal For All With A Raspberry Pi

To be a professional card dealer takes considerable skill, something that not everybody might even have the dexterity to acquire. Fortunately even for the most ham-fisted of dealers there’s a solution, in the form of the Dave-O-matic, [David Stern]’s automated card dealer using a Raspberry Pi 4 with a camera and pattern recognition.

It takes the form of a servo-controlled arm with a sucker on the end, which is able to pick up the cards and present them to the camera. They can then be recognized by value, and pre-determined hands can be dealt or alternatively a random hand. It seems that the predetermined hands aren’t an aid in poker cheating, but a part of the bridge player’s art. You can see it in action in the video below the break.

We like the project, but sadly at this point we must take [Dave] to task, because while tantalizing us with enough detail to get us interested he’s slammed the door in our faces by failing to show us the code. it would be nice to think that the clamor from disaffected Hackaday readers might spur him into throwing us a crumb or two.

It probably won’t surprise you to find that this isn’t the first Raspberry Pi to find itself dealing cards.

Continue reading “A Mostly Fair Deal For All With A Raspberry Pi”

Pico Makes Capable Logic Analyzer

A common enough microcontroller project is to create some form of logic analyzer. In theory, it should be pretty easy: grab some digital inputs, store them, and display them. But, of course, the devil is in the details. First, you want to grab data fast, but you also need to examine the trigger in real time — hard to do in software. You may also need input conditioning circuitry unless you are satisfied with the microcontroller’s input characteristics. Finally, you need a way to dump the data for analysis. [Gusmanb] has tackled all of these problems with a simple analyzer built around the Raspberry Pi Pico.

On the front and back ends, there is an optional board that does fast level conversion. If you don’t mind measuring 3.3 V inputs, you can forego the board. On the output side, there is custom software for displaying the results. What’s really interesting, though, is what is in between.

The simple PCB is completely optional.

The Pico grabs 24 bits of data at 100 MHz and provides edge and pattern triggers. This is impressive because you need to look at the data as you store it and that eats up a few instruction cycles if you try to do it in software, dropping your maximum clock rate. So how does this project manage it?

It uses the Pico’s PIO units are auxiliary dedicated processors that aren’t very powerful, but they are very fast and deterministic. Two PIO instructions are enough to handle the work for simple cases. However, there are two PIOs and each has four separate state machines. It still takes some work, but it is easier than trying to run a CPU at a few gigahertz to get the same effect. The fast trigger mode, in particular, abuses the PIO to get maximum speed and can even work up to 200 MHz with some limitations.

If you want to try it, you can use nothing more than a Pico and a jumper wire as long as you don’t need the level conversion. The project page mentions that custom software avoids using OpenBench software, which we get, but we might have gone for Sigrok drivers to prevent having to reinvent too many wheels. The author mentions that it was easier to roll your own code than conform to a driver protocol and we get that, too. Still, the software looks nice and even has an SPI protocol analyzer. It is all open source, so if you want other protocols before the author gets to them, you could always do it yourself.

If you do want a Pico and Sigrok, we’ve covered a project that does just that. Most of the logic analyzers we use these days we build into our FPGA designs.

Classic Amp Revived With A Pi

Guitar amplifiers have a hard life, and as anyone who’s run a venue can tell you, they often have significant electrical issues after a life on the road. [Dsagman] had a Vox amplifier with fried internals, and rather than repair the original he rebuilt it with a Raspberry Pi inside to provide a fully-loaded array of effects.

Though the subject is the Vox, it’s best to see this as more a tale of how to create a guitar effect array in a Pi than specifically put it in an amplifier. The Pi has an audio board and an MCP3008 ADC added to it, and using those two it takes its inputs from a series of potentiometers and process the audio passing through the audio board. In addition there are a series of LED indicators and an LED bar graph to keep the user in touch with what’s going on.

The whole lot is nicely integrated in the VOX case with all the potentiometers on an aluminium panel. He discusses amplifier choice, but as you might expect the final choice is a Class D module. All in all an amp many readers would probably go for.

As long-time readers will remember, guitar effects have made quite a few appearances around here. Continue reading “Classic Amp Revived With A Pi”

PlayStation 2 Gets A Seamless Media Center Makeover

We often see Raspberry Pi boards of various flavors stuck inside vintage computers and the like. [El Gato Guiri] has instead installed one inside a PlayStation 2 Slim, and rather artfully at that. The result is a tidy little media center device.

Pretty tidy, right? All those ports work! Okay, not the memory card slots. But everything else!

The PlayStation 2 was gutted, with a Raspberry Pi 3B installed inside. The original ports on the back, including the USB and Ethernet port, were then wired up to the Pi to make them fully functional. A slot was then cut into the back to allow the HDMI port to be hooked up. The front USB ports work, too, and the optical drive was removed to make way for a 2 TB Toshiba external drive. Adapters are used to make the controller ports work, as well. Finally, a Noctua fan was installed atop the Pi to make sure it never gets too hot.

Whether it’s for watching movies or playing emulated games with the PS2 controllers, the little media center build is sure to do well.

We’ve seen Raspberry Pis stuck in everything from laptops to monitors, as well as plenty of retro hardware too. When a piece of hardware is dead and gone, a Raspberry Pi can be a great way to breathe new life into an attractive old case!