Video Streaming Like Your Raspberry Pi Depended On It

The Raspberry Pi is an incredibly versatile computing platform, particularly when it comes to embedded applications. They’re used in all kinds of security and monitoring projects to take still shots over time, or record video footage for later review. It’s remarkably easy to do, and there’s a wide variety of tools available to get the job done.

However, if you need live video with as little latency as possible, things get more difficult. I was building a remotely controlled vehicle that uses the cellular data network for communication. Minimizing latency was key to making the vehicle easy to drive. Thus I set sail for the nearest search engine and begun researching my problem.

My first approach to the challenge was the venerable VLC Media Player. Initial experiments were sadly fraught with issues. Getting the software to recognize the webcam plugged into my Pi Zero took forever, and when I did get eventually get the stream up and running, it was far too laggy to be useful. Streaming over WiFi and waving my hands in front of the camera showed I had a delay of at least two or three seconds. While I could have possibly optimized it further, I decided to move on and try to find something a little more lightweight.

Continue reading “Video Streaming Like Your Raspberry Pi Depended On It”

Pedal-Pi, Simple Programmable Guitar Pedal

For several years, [Ray] and [Anna], the team behind ElectroSmash, have been smashing audio electronics and churning out some sweet DIY audio gear. This time around, they’ve built Pedal-Pi — a simple programmable guitar pedal based around the Raspberry-Pi Zero. It is aimed at hackers, programmers and musicians who want to experiment with sounds and learn about digital audio. A lot of effort has gone in to documenting the whole project. Circuit analysis, a detailed BoM, programming, assembly and background information on related topics are all covered on their Forum.

The hardware is split in to three parts. On the input, a MCP6002 rail-to-rail op-amp amplifies and filters the analog waveform and then a MCP3202 ADC digitizes it to a 12-bit signal. The Pi-Zero then does all of the DSP, creating effects such as distortion, fuzz, delay, echo and tremolo among others. The Pi-Zero generates a dual PWM signal, which is combined and filtered before being presented at the output. The design is all through hole and the handy assembly guide can be useful for novices during assembly.  The code examples include a large number of pedal effects, and if you are familiar with C, then there’s enough information available to help you write your own effects.

Even if you don’t plan on building one, technical background such as the Basics of Audio DSP in C for Raspberry Pi Zero, Using MCP3202 ADC with Raspberry Pi Zero and PWM Audio on Raspberry Pi Zero ought to make for interesting reading. Check out the video after the break detailing the build.

If you’d like to check out some of their earlier work, check out 1WAMP, an Open Hardware Guitar Amplifier and pedalSHIELD, an opensource Arduino Guitar Pedal.

Continue reading “Pedal-Pi, Simple Programmable Guitar Pedal”

Raspberry Pi AI Plays Piano

[Zack] watched a video of [Dan Tepfer] using a computer with a MIDI keyboard to do some automatic fills when playing. He decided he wanted to do better and set out to create an AI that would learn–in real time–how to insert style-appropriate tunes in the gap between the human performance.

If you want the code, you can find it on GitHub. However, the really interesting part is the log of his experiences, successes, and failures. If you want to see the result, check out the video below where he riffs for about 30 seconds and the AI starts taking over for the melody when the performer stops.

Continue reading “Raspberry Pi AI Plays Piano”

Teenage Engineering The Raspberry Pi

The Teenage Engineering OP-1 is a tiny, portable synthesizer loaded up with 4-track recording, a sampler, sequencers, and a quite good synthesis engine. It also fits in your pocket and looks like a calculator built in West Germany. As you would expect with a synth/sampler/sequencer, you can save sounds, tracks, and other creations to a computer. [Doug] thought if you can connect it to a laptop, you can also connect it to a Raspberry Pi. He created an all-in-one storage solution for the OP-1 using only a Pi and a small character LCD.

The process of connecting the Pi to the OP-1 is pretty simple. First, plug a USB cable into the OP-1 and the Pi. Then, place the OP-1 into Disk Mode, the synth’s method of transferring files between itself and a computer. The Pi then synchronizes, changes the color of its character display from red to green, and becomes a web server available over WiFi where all the files can be accessed.

This is the bare minimum tech required to get files into and off of the OP-1. All you need is a bit of power and a USB connection, and all the files on the OP-1 can be backed up, transferred, or replaced without any other futzing around. It’s perfect for the minimalist OP-1, and a great example of how handy a WiFi enabled Pi can be.

Thanks [Pator] for sending this one in.

RaspiReader, An Open Source Fingerprint Reader

In 2008, the then German interior minister, [Wolfgang Schäuble] had his fingerprint reproduced by members of the German Chaos Computer Club, or CCC, and published on a piece of plastic film distributed with their magazine. [Schäuble] was a keen proponent of mass gathering of biometric information by the state, and his widely circulated fingerprint lifted from a water glass served as an effective demonstration against the supposed infallibility of biometric information.

Diagram showing the fingerprint reader's operation.
Diagram showing the fingerprint reader’s operation.

It was reported at the time that the plastic [Schäuble] fingerprint could fool the commercial scanners of the day, including those used by the German passport agency, and the episode caused significant embarrassment to the politician. The idea of “spoofing” a fingerprint would completely undermine the plans for biometric data collection that were a significant policy feature for several European governments of the day.

It is interesting then to read a paper from Michigan State University, “RaspiReader: An Open Source Fingerprint Reader Facilitating Spoof Detection” (PDF downloadable from the linked page) by [Joshua J. Engelsma], [Kai Cao], and [Anil K. Jain] investigates the mechanism of an optical fingerprint reader and presents a design using the ever-popular Raspberry Pi that attempts to detect and defeat attempts at spoofing. For the uninitiated is serves as a fascinating primer on FTIR (Frustrated Total Internal Reflection) photography of fingerprints, and describes their technique combining it with a conventional image to detect spoofing. Best of all, the whole thing is open-source, meaning that you too can try building one yourself.

If [Cao] and [Jain] sound familiar, maybe it’s from their Samsung Galaxy fingerprint hack last year, so it’s neat to see them at work on the defense side. If you think that fingerprints make good passwords, you’ve got some background reading to do. If you just can’t get enough fingerprints, read [Al Williams]’ fundamentals of fingerprint scanning piece from earlier this year.

Via Hacker News.

Tough Pi-ano Can Take A Punch

There will be no delicate solos for [24 Hour Engineer’s] Tough Pi-ano. It was built to soak punishment from aggressive youngsters in musical therapy, specifically those on the autism spectrum and those with Down’s syndrome. The Tough Pi-ano will be bolted to a wall with heavy-duty shelf brackets so it can’t fall on anyone. The keyboard is covered in plastic and it doesn’t have any exposed metal so there will be no splinters.

[24 Hour Engineer] made a short video demonstration and if you listen closely, he has a pun in all but one sentence. We love that kind of easter egg in YouTube videos. Check it out after the break.

Inside the 48-key instrument are four Raspberry Pi Zeros where each Pi controls one octave. The redundancy ensures that a hardware failure only drops out a single octave and the kids can keep playing until replacement parts arrive. Each Pi has identical programming and a thumbwheel switch tells it which octave it will be emulating.

Programming was done with Python and Pygame and all the inputs are run to a homemade “hat” where the wires are soldered. Pygame’s sole responsibility is to monitor the GPIO and then play the appropriate note when a button is pressed, slapped, punched or sat upon.

Similar in name, the Touch Piano has no moving parts or perhaps you would rather use your Raspberry Pi in an upright piano.

Continue reading “Tough Pi-ano Can Take A Punch”

Nerf Gun Ammo Counter And Range Finder

The proliferation of breakout boards that the DIY electronics movement has allowed has been staggering. Buy a few different boards, wire them together to a microcontroller or credit-card computer (both on their own breakout board) and write a bit of code, and you can create some really interesting things. Take Reddit user [Lord_of_Bone]’s Nerf Gun ammo counter and range finder, for example, a great example of having a great idea and looking around for the ways to implement it.

For the range finder, [Lord_of_Bone] looked to an ultrasonic rangefinder. For the ammo counter, [Lord_of_Bone] chose a proximity sensor. To run everything, the Raspberry Pi Zero was used and the visuals were supplied by a Rainbow Hat. The range finder is self-explanatory. The proximity sensor is located at the end of the gun’s muzzle and when it detects a Nerf dart passing by it reduces the ammo count by one. Blu-tack is used to hold everything in place, but [Lord_of_Bone] plans to use Sugru when he’s past the prototype stage.

The one problem [Lord_of_Bone] has with the build is that there’s no way to tell how many Nerf bullets are in the magazine. Currently the wielder must push a button when reloading to reset the count to a preset amount. We’re sure that [Lord_of_Bone] would appreciate any suggestions the Hack-A-Day crowd could offer.

[Lord_of_Bone] gives a full bill of materials, Python code, a lot of pictures and step-by-step instructions so that you, too, can determine how far away your target is, and whether or not you have enough ammo to hit them. We have quite a few Nerf mods on the site, and [Lord_of_Bone] could take a look at this article about how to keep track of your Nerf ammo, and here’s a different method of determining if a Nerf dart has been fired (and measuring its speed.)

[via Reddit] Continue reading “Nerf Gun Ammo Counter And Range Finder”