Python Script Sends Each Speaker Its Own Sound File

When it comes to audio, the number of speakers you want is usually governed by the number of tracks or channels your signal has. One for mono, two for stereo, four for quadrophonic, five or more for surround sound and so on. But all of those speakers are essentially playing different tracks from a “single” audio signal. What if you wanted a single audio device to play eight different songs simultaneously, with each song being piped to its own speaker? That’s the job [Devon Bray] was tasked with by interdisciplinary artist [Sara Dittrich] for one of her “Giant Talking Ear” installation project. He built a device to play multiple sound files on multiple output devices using off the shelf hardware and software.

But maybe a hack like this could be useful in many applications other than just art installations. It could be used in an Escape room, where you may want the various audio streams to start in synchronicity at the same time, or as part of a DJ console, sending one stream to the speakers and another to the head phones, or a game where you have to run around a room full of speakers in the right sequence and speed to listen to a full sentence for clues.

His blog post lists links for the various pieces of hardware required, although all of it is pretty generic, and the github repository hosts the code. At the heart of the project is the Sounddevice library for python. The documentation for the library is sparse, so [Bray]’s instructions are handy. His code lets you “take a directory with .wav files named in numeric order and play them over USB sound devices attached to the host computer over and over forever, looping all files once the longest one finishes”. As a bonus, he shows how to load and play sound files automatically from an attached USB drive. This lets you swap out your playlist on the Raspberry Pi without having a use a keyboard/mouse, SSH or RDP.

Check the video after the break for a quick roundup of the project.

Continue reading “Python Script Sends Each Speaker Its Own Sound File”

Hack My House: Garage Door Cryptography Meets Raspberry Pi

Today’s story is one of victory and defeat, of mystery and adventure… It’s time to automate the garage door. Connecting the garage door to the internet was a must on my list of smart home features. Our opener has internet connection capabilities built-in. As you might guess, I’m very skeptical of connecting a device to the internet when I have no control over the software running on it.

The garage door is controlled by a button hung on the garage wall. There is only a pair of wires, so a simple relay should be all that is needed to simulate the button press from a Raspberry Pi. I wired a relay module to a GPIO on the Pi mounted in the garage ceiling, and wrote a quick and dirty test program in Python. Sure enough, the little relay was clicking happily– but the garage door wasn’t budging. Time to troubleshoot. Does the push button still work? *raises the garage door* yep. How about the relay now? *click…click* nope.

You may have figured out by now, but this garage door opener isn’t just a simple momentary contact push button. Yes, that’s a microcontroller, in a garage door button. This sort of scenario calls for forensic equipment more capable than a simple multimeter, and so I turned to Amazon for a USB oscilloscope that could do some limited signal analysis. A device with Linux support was a must, and Pico Technology fit the bill nicely.

Searching for a Secret We Don’t Actually Need

My 2 channel Picotech oscilloscope, the 2204A, finally arrived, and it was time to see what sort of alien technology was in this garage door opener. There are two leads to the button, a ground and a five volt line. When the button is pressed, the microcontroller sends data back over that line by pulling the 5 V line to ground. If this isn’t an implementation of Dallas 1-wire, it’s a very similar concept.

Continue reading “Hack My House: Garage Door Cryptography Meets Raspberry Pi”

Get Organized With This Raspberry Pi E-Ink Calendar

Like many hackers, we love e-ink. There’s something mesmerizing and decidedly futuristic about the way the images shift around and reconstitute themselves. Like something from Harry Potter, but that you can buy on Alibaba instead of from a shop in Diagon Alley. But as anyone who’s used the technology can tell you, the low refresh rate of an e-ink screen limits its potential applications. It works great for reading books, but beyond that its struggled to find its niche in a world of cheap LCDs.

But [Zonglin Li] has recently wrapped up a project which shows that e-ink has at least one more use case: personal calendars. You can get way with only updating the screen once a day so the refresh rate won’t matter, and the rest of the time it’s going to be static anyway so you might as well enjoy the energy savings of leaving the screen off. With a Raspberry Pi behind the scenes pulling data from the Internet, it can populate the calendar with everything from your personal schedule to when your favorite podcast drops.

In practice, [Zonglin] is actually updating the display every hour as he’s included the current weather conditions on the top left of the screen, but even still, this is a perfect application for the very unique properties of e-ink displays. The display is a 7.5 inch 640×384 model from Waveshare that retails for about $50 USD, so between the display, the Raspberry Pi, and something to put it all in (here, a picture frame) this is a pretty cheap build compared to some of the large format e-ink displays out there.

The software side is written in Python 3, and [Zonglin] has documented how others can easily plug in their own information so it can pull schedule data from Google Calendar and local conditions from Open Weather Map. The MIT licensed source code is also very well organized and commented, so this could serve as an excellent base if you’re looking to create a more comprehensive e-ink home information display.

If this seems a little too pedestrian for your tastes, you could always put together an e-ink movie player, a surprisingly functional Linux terminal, or a very slick ESP8266-based name tag. If you’ve got the better part of $1K USD and don’t know what to do with it, you could even get an e-ink license plate.

Play Chess Like Harry Potter

If you are a Harry Potter fan, you might remember that one of the movies showed an Isle of Lewis chess set whose pieces moved in response to a player’s voice commands. This feat has been oft replicated by hackers and [amoyag00] has a version that brings together a Raspberry Pi, Arduino, Android, and the Stockfish chess engine in case you want to play by yourself. You can see a video of the game, below.

Interestingly, the system uses Marlin — the 3D printing software — to handle motion using the Arduino. We suppose moving chess pieces over a path isn’t much different than moving a print head. It is certainly a novel use of GCode.

Continue reading “Play Chess Like Harry Potter”

Cheap Power Over Ethernet For The ESP32

While most projects we see with the ESP32 make use of its considerable wireless capabilities, the chip can be connected to the wired network easily enough should you have the desire to do so. [Steve] liked the idea of putting his ESP32s on the wired network, but found the need for a secondary power connection burdensome. So he took it upon himself to modify some cheap Power Over Ethernet (PoE) hardware and create a single-cable solution (Google Translate).

[Steve] bought a PoE module intended for security cameras and ran a close eye over the board to figure out what kind of hardware it was using to generate the nominal 12 V output. He identified an MP2494 step-down converter, and with the datasheet in hand found how the output voltage is configured by changing the values of resistors in the circuit. Swapping out the stock 21.5 kΩ resistor for a 57.1 kΩ one changed the output of the converter to the 5 V necessary for his electronics.

But of course that was only half of the problem solved; he still had to connect the Ethernet side of the PoE device to the Waveshare LAN8720 board that’s providing Ethernet for the ESP32. So he removed the RJ45 jack from the LAN8720 completely, and wired that directly to the connector on the PoE board. Helpfully, the PoE board had all the pins labeled on the bottom side so this wasn’t nearly as tricky to figure out as you might expect (if only it was always that easy).

We’ve previously covered the Waveshare LAN8720 board for anyone who’s interested in the ins and outs of getting their ESP32 talking Ethernet. If you’re wondering how you can put PoE to work for you, our very own [Jonathan Bennett] has been showing off his home Raspberry Pi infrastructure which makes extensive use of the new PoE hat.

Open Source Biological Gear For The Masses

At the risk of putting too fine a point on it, Hackaday exists because people are out there building and documenting open source gadgets. If the person who built a particular gizmo is willing to show the world how they did it, consider us interested. Since you’re reading this, we’ll assume you are as well. Over the years, this mentality has been spreading out from the relatively niche hacker community into the greater engineering world, and we couldn’t be happier.

Case in point, the Poseidon project created at the California Institute of Technology. Developed by students [Sina Booeshaghi], [Eduardo Beltrame], and [Dylan Bannon], along with researcher [Jase Gehring] and professor [Lior Pachter], Poseidon consists of an open source digital microscope and syringe pump which can be used for microfluidics experiments. The system is not only much cheaper than commercial offerings, but is free from the draconian modification and usage restrictions that such hardware often comes with.

Of course, one could argue that major labs have sufficient funding to purchase this kind of gear without having to take the DIY route. That’s true enough, but what benefit is there to limiting such equipment to only the established institutions? As in any other field, making the tools available to a wider array of individuals (from professionals to hobbyists alike) can only serve to accelerate progress and move the state of the art forward.

The Poseidon microscope consists of a Raspberry Pi, touch screen module, and commercially available digital microscope housed in a 3D printed stage. This device offers a large and clear view of the object under the microscope, and by itself makes an excellent educational tool. But when running the provided Python software, it doubles as a controller for the syringe pumps which make up the other half of the Poseidon system.

Almost entirely 3D printed, the pumps use commonly available components such as NEMA 17 stepper motors, linear bearings, and threaded rods to move the plunger on a syringe held in the integrated clamp. Controlled by an Arduino and CNC shield, these pumps are able to deliver extremely precise amounts of liquid which is critical for operations such as Single-cell RNA sequencing. All told a three pump system can be built for less than $400 USD, compared to the tens of thousands one might pay for commercially available alternatives.

The Poseidon project joins a relatively small, but very exciting, list of DIY biology projects that we’ve seen over the years. From the impressive open source CO2 incubator we saw a few years ago to the quick and dirty device for performing polymerase chain reaction experiments, there’s little doubt about it: biohacking is slowly becoming a reality.

Continue reading “Open Source Biological Gear For The Masses”

So You Bought A Raspberry Pi Compute Module. What Now?

The Raspberry Pi Compute Module hasn’t seen as much attention as it should have in our community, probably because the equivalents from the familiar consumer range can be so much cheaper. When a Raspberry Pi Zero is a similar size to a Compute Module and costs so much less, we can’t blame you for asking what would be the point of using the industrial version.

It’s interesting then to see an Instructables piece from [Manolis Agkopian] in which he takes the reader through the process of creating their own Compute Module project. Following hot on the heels of the recent launch of the latest in the range it’s come to us at an appropriate moment to take a fresh look at the fruity computer’s more obscure incarnation. He starts with a description of the Compute Module and its official development board, before taking us through setting up a module and putting an OS on it. Finally he shows us his board design, which he offers us as a jumping-off point for our own projects.

So given that it’s piqued your interest, why might you want to design a Compute Module project? The answer’s simple enough: the consumer boards only provide the subset of features the Pi foundation people deemed appropriate for their mission. A Compute Module project is the equivalent of designing a Raspberry Pi that does it your way, tailored exactly for your needs. If you want an example, look no further than this stereoscopic camera.

Via Hacker News.