Audio Streaming on the Cheap With an RPi Zero

The minuscule size of the Raspberry Pi Zero makes it perfect for hacks where size is a factor. For example, a small, standalone device for getting streaming audio into your speakers. The RPi Zero doesn’t have an audio output on board, so PolyVection paired it up with their PlainDAC to build a minimal audio streaming device.

Their build uses a few lines from the GPIO header to drive an I2S digital to analog converter. The DAC is a PCM5142 from Texas Instruments that provides high quality sound output, and contains a built in programmable DSP.

The hardware fits into a 3D printed case, coming in at 68 mm by 48 mm. There’s no WiFi inside, but this can be added with an external USB device for wireless streaming. The DAC used is supported by the Linux kernel, so a simple configuration is all that’s needed to pipe audio out.

Once you have a device like this assembled, you can install a server like Music Player Daemon to remotely control the device and cue up internet radio channels.

A Sound and LED-tastic Tricycle Shopping Cart

What do you get when you take a massive number of LEDs and combine them with a shopping cart and a bicycle? An awesome rave-mobile created by [kramerr]. He’s even taking it one step further by making the electronics solar powered.

[Kramerr] controls the LEDs with multiple WS2803 LED drivers. Three PIC18F4550s control the WS2803s over SPI. He devised a neat way of exciting the LEDs from music by using a pair of graphic equalizer display filter chips, MSGEQ7s, to drive the PICs to create patterns. A USB input also allows the PICs to display song titles or other information.

leds and boards

The mechanical design is as impressive as the electronics. The rear half of a bicycle is welded to the frame of the shopping cart with the cart’s handle used for steering. The shopping cart’s rear wheels are replaced by small bicycle wheels.

But [Kramerr] wasn’t done. He built his own solar panel since he couldn’t find one to fit the size requirements. The panel consists of 26 cells connected in series to provide 1A at 13V on a sunny day. A solar charge controller keeps a standard 12v lead acid battery ready to power the tricycle cart.

And there is still more! There is a sound system driven by a Raspberry Pi. The Pi also drives the USB inputs when [Krameer] wants to display song titles or artists instead of the audio patterns.

There are at least four hacks in this project each worthy of applause. [Karmeer] deserves an ovation for doing all of them in one project. If you are looking for less bling and less pedaling may we direct you to this powered, riding shopping cart.

Some rave music and lights via video after the break.

Continue reading “A Sound and LED-tastic Tricycle Shopping Cart”

Swapping GPIO Pins on the Pi Zero for Audio

The new Raspberry Pi Zero is generating a lot of discussion, especially along the lines of “why didn’t they include…?” One specific complaint has been that audio is only available through the HDMI port. That’s not entirely true as pointed out by Lady Ada over at Adafruit.

Something to remember about the entire Pi family is the pins on the Broadcom processors are multipurpose. Does it increase the confusion or the capabilities? Take your pick. But the key benefit is that different pins can handle the same purpose. For audio the Greater Than Zero Pis (GTZPi) use PWM0_OUT and PWM1_OUT on the processor’s GPIO pins 40 and 45. On the GRZPis these feed a diode, resistor and capacitor network that ends at the audio output jack. They don’t appear on the GPIO connector so cannot be used on the Zero.

The multi-pin, multi-purpose capability of the Broadcom processor allows you to switch PWM0_OUT to GPIO 18 and PWM1_OUT to GPIO 13 or 19. Add the network from the Adafruit note, or check this schematic from the Raspberry Pi site – look at the lower right on the second page.


While you’re checking out the audio hack at Adafruit, read through the entirety of Introducing the Raspberry Pi Zero. Lady Ada provides a great description of the Zero and what is needed to start using it.

If you’re looking for Zero hacking ideas you might check the comments in our announcement about the Zero or article on the first hack we received. There is a lot of grist for the hacking mill in them.

Audio Effects on the Intel Edison

With the ability to run a full Linux operating system, the Intel Edison board has more than enough computing power for real-time digital audio processing. [Navin] used the Atom based module to build Effecter: a digital effects processor.

Effecter is written in C, and makes use of two libraries. The MRAA library from Intel provides an API for accessing the I/O ports on the Edison module. PortAudio is the library used for capturing and playing back audio samples.

F9GW4Y4IGQFYP23.MEDIUMTo allow for audio input and output, a sound card is needed. A cheap USB sound card takes care of this, since the Edison does not have built-in hardware for audio. The Edison itself is mounted on the Edison Arduino Breakout Board, and combined with a Grove shield from Seeed. Using the Grove system, a button, potentiometer, and LCD were added for control.

The code is available on Github, and is pretty easy to follow. PortAudio calls the audioCallback function in when it needs samples to play. This function takes samples from the input buffer, runs them through an effect’s function, and spits the resulting samples into the output buffer. All of the effect code can be found in the ‘effects’ folder.

You can check out a demo Effecter applying effects to a keyboard after the break. If you want to build your own, an Instructable gives all the steps.

Continue reading “Audio Effects on the Intel Edison”

Pea-Whistle Steganography

Do you see the patterns everywhere around you? No? Look closer. Still no? Look again. OK, maybe there’s nothing there.

[Oona Räisänen] hears signals and then takes them apart. And even when there’s nothing there, she’s thinking “what if they were?” Case in point: could one hypothetically transmit coded information in the trilling of a referee’s whistle at the start of a soccer match?

acme-spektriTo you, the rapid pitch changes made by the little ball that’s inside a ref’s whistle sounds like “trilling” or “warbling” or something. To [Oona], it sounds like frequency-shift key (FSK) modulation. Could you make a non-random trilling, then, that would sound like a normal whistle?

Her perl script says yes. It takes the data you want to send, encodes it up as 100 baud FSK, smoothes it out, adds some noise and additional harmonics, and wraps it up in an audio file. There’s even a couple of sync bytes at the front, and then a byte for packet size. Standard pea-whistle protocol (PWP), naturally. If you listen really closely to the samples, you can tell which contains data, but it’s a really good match. Cool!

[Oona] has graced our pages before, naturally. From this beautiful infographic tracing out a dial-up modem handshake to her work reversing her local bus stop information signs or decoding this strange sound emitted by a news helicopter, She’s full of curiosity and good ideas — a hacker’s hacker. Her talk on the bus stop work is inspirational.. She’s one of our secret heroes!

Tricking an Ancient Protocol To Play Tunes

A lot of technological milestones were reached in 2007. The first iPhone, for example, was released that January, and New Horizons passed Jupiter later on that year. But even with all of these amazing achievements, Volvo still wasn’t putting auxiliary inputs on the stereo systems in their cars. They did have antiquated ports in their head units though, and [Kalle] went about engineering this connector to accommodate an auxiliary input.

The connector in question is an 8-pin DIN in the back, which in the days of yore (almost eight years ago) would have been used for a CD changer. Since CDs are old news now, [Kalle] made use of this feature for the hack. The first hurdle was that the CD changer isn’t selectable from the menu unless the head unit confirms that there’s something there. [Kalle] used an Arduino Nano to fool the head unit by simulating the protocol that the CD changer would have used. From there, the left and right audio pins on the same connector were used to connect the auxiliary cable.

If you have a nearly-antique Volvo like [Kalle] that doesn’t have an aux input and you want to try something like this, the source code for the Arduino is available on the project page. Of course, if you don’t have a Volvo, there are many other ways to go about hacking an auxiliary input into various other devices, like an 80s boombox or the ribbon cable on a regular CD player. Things don’t always go smoothly, though, so there are a few nonstandard options as well.

Escape Cable Hell with an Audio I/O Multiplexer

If you ever find yourself swapping between a mix of audio inputs and outputs and get tired of plugging cables all the time, check out [winslomb]’s audio multiplexer with integrated amplifier. The device can take any one of four audio inputs, pass the signal through an amplifier, and send it to any one of four outputs.

The audio amplifier has a volume control, and the inputs and outputs can be selected via button presses. An Arduino Pro Mini takes care of switching the relays based on the button presses. On the input side, you can plug in devices like a phone, TV, digital audio player or a computer. The output can be fed to speakers, headsets or earphones.

At the center of the build lies a TI TPA152 75-mW stereo audio power amplifier. This audio op-amp is designed to drive 32 ohm loads, so performance might suffer when connecting it to lower impedance devices, but it seems to work fine for headphones and small computer speakers. The dual-gang potentiometer controls the volume, and the chip has a useful de-pop feature. The circuit is pretty much a copy of the reference shown in the data sheet. Switching between inputs or outputs is handled by a bank of TLP172A solid state relays with MOSFET outputs, and it’s all tied together with a micro-controller, allowing for WiFi or BLE functionality to be added on later.

[winslomb] laid out the design using Eagle and he made a couple of footprint mistakes for the large capacitors and the opto-relays. (As he says, always double-check part footprints!) In the end, he solder-bridged them on to the board, but they should probably be fixed for the next revision.

[winslomb] built the switch as his capstone project while on his way to getting a Masters in EE, and although the device did function as required, there is still room for improvement. The GitHub repository contains all the hardware and software sources. Check out the video below where he walks through a demo of the device in action. If you are looking for something simpler, here is a two input – one output audio switcher with USB control and on the other end of the spectrum, here’s an audio switch that connects to the Internet.

Continue reading “Escape Cable Hell with an Audio I/O Multiplexer”