Audio On Pi: Here Are Your Options

There are a ton of fun Raspberry Pi and Linux projects that require audio output – music players, talking robots, game consoles and arcades, intelligent assistants, mesh network walkie-talkies, and much more! There’s no shortage of Pi-based iPods out there, and my humble opinion is that we still could use more of them.

To help you in figuring out your projects, let’s talk about all the ways you can use to get audio out of a Pi or a similar SBC. Not all of them are immediately obvious and you ought to know the ropes before you implement one of them and get unpleasantly surprised by a problem you didn’t foresee. I can count at least five ways, and they don’t even include a GPIO-connected buzzer!

Let’s rank the different audio output methods, zoning in on things like their power consumption, and sort them by ease of implementation, and we’ll talk a bit about audio input options while we’re at it.

Continue reading “Audio On Pi: Here Are Your Options”

I2C For Hackers: The Basics

You only really need two data wires to transfer a ton of data. Standards like UART, USB2, I2C, SPI, PS/2, CAN, RS232, SWD (an interface to program MCUs), RS485, DMX, and many others, all are a testament to that. In particular, I2C is such a powerful standard, it’s nigh omnipresent – if you were to somehow develop an allergy to I2C, you would die.

Chances are, whatever device you’re using right now, there’s multiple I2C buses actively involved in you reading this article. Your phone’s touchscreen is likely to use I2C, so is your laptop touchpad, most display standards use I2C, and power management chips are connected over I2C more often than not, so you’re covered even if you’re reading this on a Raspberry Pi! Basically everything “smart” has an I2C port, and if it doesn’t, you can likely imitate it with just two GPIOs.

If you’re building a cool board with a MCU, you should likely plan for having an I2C interface exposed. With it, you can add an LCD screen with a respectable resolution or a LED matrix, or a GPS module, a full-sized keyboard or a touchpad, a gesture sensor, or a 9 degree of freedom IMU – Inertial Measurement Unit, like a accelerometer+compass+gyroscope combination. A small I2C chip can help you get more GPIOs for your MCU or CPU, or a multi-channel motor driver, or a thermal camera, or a heap of flash memory; if you’re adding some sort of cool chip onto your board, it likely has an I2C interface to let you fine-tune its fancy bits.

As usual, you might have heard of I2C, and we sure keep talking about it on Hackaday! There’s a good few long-form articles about it too, both general summaries and cool tech highlights; this article is here to fill into some gaps and make implicit knowledge explicit, making sure you’re not missing out on everything that I2C offers and requires you to know!

Continue reading “I2C For Hackers: The Basics”

Hack On Self: Sense Of Time

Every now and then, a commercial product aims to help you in your life journey, in a novel way, making your life better through its presence. Over the years, I’ve been disappointed by such products far more often than I have been reassured, seeing each one of them rendered unimaginative and purposeless sometimes even despite the creator’s best intentions. The pressures of a commercial market will choke you out without remorse, metal fingers firmly placed on your neck, tightening with every move that doesn’t promise profit, and letting money cloud your project’s vision. I believe that real answers can only come from within hacker communities, and as we explore, you might come to see it the same way.

This is the tip of the iceberg of a decade-long project that I hope to demonstrate in a year or two. I’d like to start talking about that project now, since it’s pretty extensive; the overall goal is about using computers to help with human condition, on a personal level. There’s a lot of talk about computers integrating into our lives – even more if you dare consult old sci-fi, much of my inspiration.

Tackling a gigantic problem often means cutting it down into smaller chunks, though, so here’s a small sub-problem I’ve been working on, for years now, on and off: Can you use computers to modify your sense of time?

Continue reading “Hack On Self: Sense Of Time”

Embedded Python: MicroPython Toolkits

Last time, I talked about how MicroPython is powerful and deserving of a place in your toolkit, and it made for a lively discussion. I’m glad to see that overall, MicroPython has indeed been getting the recognition it deserves – I’ve built a large number of wonderful projects with it, and so have people I’ve shown it to!

Sometimes I see newcomers dissatisfied with MicroPython, because the helper tools they initially pick don’t suit it well. For instance, they try and start out with a regular serial terminal application that doesn’t fit the MicroPython constraints, or a general IDE that requires a fair bit of clicking around every time you need to run your code. In particular, I’d make sure that you know your options no matter whether you prefer GUI or commandline – both have seriously nice tools for MicroPython use!

The main problem to be solved with MicroPython is that you have a single serial port that everything happens through – both file upload and also debugging. For ESP8266/32-based boards, it’s a physical serial port, and for chips like RP2040 and ESP32-S* where a hardware USB peripheral is available, it’s a virtual one – which makes things harder because the virtual port might get re-enumerated every now and then, possibly surprising your terminal application. If you want to upload a program of yours, you need to free up the serial port, and to see the program’s output, you will need to reopen that port immediately after – not a convenient thing to do if you’re using something like PuTTy.

So, using MicroPython-friendly software is a must for a comfortable hacking experience. What are your options? Continue reading “Embedded Python: MicroPython Toolkits”

The UMPC powered up, case-less showing the black PCB, with the display standing upwards and showing a blue colour scheme desktop with a CLI terminal open. To the right of it is one of the UMPCs that served as an inspiration for this project.

Bringing The UMPCs Back With A Pi Zero

Miss PDAs and UMPCs? You wouldn’t be the only one, and it’s a joy to see someone take the future into their own hands. [Icepat]’s dream is reviving UMPCs as a concept, and he’s bringing forth a pretty convincing hardware-backed argument in form of the Pocket Z project. For the hardware design, he’s hired two engineers, [Adam Nowak] and [Marcin Turek], and the 7-inch Pocket Z7 version is coming up quite nicely!

The Hackaday.io project shows an impressive gallery of inspiration devices front and center, and with these in mind, the first version of the 7-inch UMPC sets the bar high. With a 1024×600 parallel RGB (DPI) touchscreen display, an ATMega32U4-controlled keyboard, battery-ready power circuitry, and a socketed Pi Zero for brains, this device shows a promising future for the project, and we can’t wait to see how it progresses.

While it’s not a finished project just yet, this effort brings enough inspiration all around, from past device highlights to technical choices, and it’s worth visiting it just for the sentiment alone. Looking at our own posts, UMPCs are indeed resurfacing, after a decade-long hiatus – here’s a Sidekick-like UMPC with a Raspberry Pi, that even got an impressive upgrade a year later! As for PDAs, the Sharp memory LCD and Blackberry keyboard combination has birthed a good few projects recently, and, who can forget about the last decade’s introductions to the scene.

D+ and D- wires from a USB cable connected to GPIO pins on the Pi Pico, using a female header plugged onto the jumper wires

Need A USB Sniffer? Use Your Pico!

Ever wanted to sniff USB device communications? The usual path was buying an expensive metal box with USB connectors, using logic analyzers, or wiring devboards together and hacking some software to make them forward USB data.

Now, thanks to [ataradov]’s work, you can simply use a Pi Pico – you only need to tap the D+ and D- pins, wire them to RP2040’s GPIOs, and you can sniff communication between your computer and any low-speed (1.5 Mbps) or full-speed (12 Mbps) devices. On the RP2040 side, plug the Pico into your computer, open the virtual serial port created, and witness the USB packets streaming in – for the price of a Pico, you get an elegant USB sniffer, only a little soldering required.

[ataradov] also offers us a complete board design with a RP2040 and a USB hub on it, equipped with USB sockets that completely free us from the soldering requirement; it’s an open-source KiCad design, so you can simply order someĀ  sniffers made from your favourite fab! This project is a great learning tool, it’s as cheap and easy to make as humanly possible, and it has big potential for things like reverse-engineering old and new systems alike. Just couple this hack with another Pico doing USB device or host duty, maybe get up to date with USB reverse-engineering fundamentals, and you could make a Facedancer-like tool with ease.

Need to reach 480 Mbit/s? [ataradov] has a wonderful board for you as well, that we have covered last year – it’s well worth it if a device of yours can only do the highest speed USB2 can offer, and, it offers WireShark support. Want WireShark support and to use a Pico? Here’s a GitHub project by another hacker, [tana]. By now, merely having a Pi Pico gives you so many tools, it’s not even funny.

We thank [Julianna] for sharing this with us!

Steamdeck motherboard standing upright propped onto a USB-C dock it's wired up to, showing just how little you need to make the steamdeck board work.

Steam Deck, Or Single Board Computer?

With a number of repair-friendly companies entering the scene, we have gained motivation to dig deeper into devices they build, repurpose them in ways yet unseen, and uncover their secrets. One such secret was recently discovered by [Ayeitsyaboii] on Reddit – turns out, you can use the Steam Deck mainboard as a standalone CPU board for your device, no other parts required aside from cooling.

All you need is a USB-C dock with charging input and USB/video outputs, and you’re set – it doesn’t even need a battery plugged in. In essence, a Steam Deck motherboard is a small computer module with a Ryzen CPU and a hefty GPU! Add a battery if you want it to work in UPS mode, put an SSD or even an external GPU into the M.2 port, attach WiFi antennas for wireless connectivity – there’s a wide range of projects you can build.

Each such finding brings us closer to the future of purple neon lights, where hackers spend their evenings rearranging off-the-shelf devices into gadgets yet unseen. Of course, there’s companies that explicitly want us to hack their devices in such a manner – it’s a bet that Framework made to gain a strong foothold in the hacker community, for instance. This degree of openness is becoming a welcome trend, and it feels like we’re only starting to explore everything we can build – for now, if your Framework’s or SteamDeck’s screen breaks, you always have the option to build something cool with it.

[Via Dexerto]