Reading from a large number of inputs, like this piano keyboard, can be tedious. Even when multiplexing there’s a lot to keep track of. But if you choose the right microcontroller, you may have hardware assistance. Here’s an ATmega640 is using it’s external memory interface to read the key matrix.
You may remember the Open Music Labs article about reading from a shift register using just one pin of a microcontroller. This time around a shift register is still used, but instead of pulling in a long line of parallel inputs, the switches are multiplexed to reduce the number of I/O pins used to read them.
A 74HC573 is used to facilitate the multiplexing. We won’t go into how that part is accomplished; there’s a separate post that explains the process. What’s unique here is that the XMEM peripheral of the AVR microcontroller is used to grab the data. This is intended for external memory chips, but if you get the timing just right, it greatly simplifies reading in a matrix of up to 128 inputs.
Here’s an interesting article about reading data from shift registers using less than three pins. 74HC165 shift registers are a popular choice for adding inputs to a microcontroller. They have a parallel input register which can be read using the latch, then shifted into a microcontroller via the data and clock pins. For those counting, that’s the three pins normally associated with driving these devices.
This hack first does away with the latch pin. The addition of a carefully trimmed RC circuit (capacitor is charged by the clock pin, then the resistor lets that cap slowly discharge) means that the device will not latch until after the clock stops toggling. This technique drops the control down to just two pins (data and clock). You can still use hardware SPI to read the data using this method. It’s the same as using SPI to drive 595 shift registers except the microcontroller reads data instead of writing it.
But wait, there’s more! The diagram above actually shows a way of reading this shift register with just one pin. Notice that the clock and data pins are now connected to just one of the microcontroller pins. The data pin has an added resistor, which keeps the current low enough that it will not compete with the clock signal coming from the microcontroller. In between clock pulses, the microcontroller switches from output to input to read the data pin on each cycle. Give it a try, it’s a fun experiment!
Workshop 88 member [Jim] got his hands on a couple of SanDisk Sansa Clip+ MP3 recorder/players from Woot, and was anxious to see what he could do with them.
The first order of business was to install RockBox, an open source hardware package built for a wide range of MP3 players. He was impressed with how robust the firmware was, though he thought the Sansa’s built-in microphone could use a bit of upgrading. Acting on a tip from a fellow square dance enthusiast, he disassembled one to see how he might add an external audio input.
He pried the existing mic apart, and desoldered it from the motherboard, installing a small capacitor and resistor in its place. He extended some wires through the case, then powered up the unit to make sure it was still alive and well. Since things still looked good, [Jim] put some audio on the Sansa’s new inputs and sure enough it recorded the audio without a hitch.
He says that his initial guesses for the capacitor and resistor values were pretty decent, though with a bit of tweaking he should be able to get exactly the recording levels he was looking for. Not bad for a $20 audio recorder!
[Kalin] loved the picture from his new Samsung HMX-T10 camcorder, but the sound quality didn’t match up. Since it records video that can be directly imported to his editing suite of choice he didn’t want to just buy a different model, so he cracked it open and added an external mic input.
As with most consumer electronics these days, the hardest part of the hack is getting the thing apart and assembling it without any damage. [Kalin] had to get down to the bare circuit board to get to the audio input connections. He soldered up some shielded extension wire to an audio jack, then made some space in the case by cutting a bit of the plastic structure before finally gluing it in place. Details are a bit scarce, but it looks like he wired up the jack along with a couple of switches. We’d wager this still lets him use the stock microphone if he doesn’t feel like hauling around extra gear.
You can buy nice audio breakout equipment for your iPod if you don’t mind breaking the bank. This is partly because the demand is not incredibly high so commercial breakout hardware doesn’t benefit from volume discounts. But it’s also because Apple charges licensing fees for third-party accessories (often referred to as the “Apple Tax”). [Reed Ghazala] decided to side-step the whole situation by building his own accessory which he calls the iPad Audio Desk.
It all starts with a breakout board. The PodBreakout Mini provides an easy to solder interface for the iPad, and ensures that the repetitive act of plugging and unplugging the connection doesn’t break a solder connection. From there [Reed’s] enclosure finishing skills take over. The shape and curve of the aluminum sheet give the look befitting an expensive tablet device. Along the back you can see the jacks for line-in, line-out, video, mic/guitar, and headphones that make the dock useful. It wouldn’t be hard to make one… but it might be hard to make one look this great. See for yourself after the break.
Continue reading “Experimental music iPad dock”
Needing to test the display interface for a multitude of different sensors [Fileark] built himself this analog and digital input/output simulator. Along the bottom is a double row of trimpots that adjust analog voltages. Each voltage is measured by the Arduino inside and its value is displayed on the graphic LCD screen to confirm that the hardware you’re testing is making correct measurements. There’s also digital I/O in two different forms. To the upper left are momentary push buttons but the DIP switch bank below that allows the same connections to be toggled on and off. It’s not an automated test bed, but if you’ve got a lot of I/O, or a lot of hardware to test this will save you some real time.
Don’t miss the demonstration video after the break.
Continue reading “Mixed I/O testing module”
[Nali] is fixing up a 1966 Rambler Ambassador and decided to give the audio a bit of an upgrade. Instead of replacing the head unit he added a connector for audio input. The method he used is simple, inexpensive, and allows the original unit to continue functioning as a radio. He cut the feed wires going to the volume knob and patched in a headphone jack. The jack he used has an internal switch that is meant to switch off a pair of speakers when headphones are plugged in. The jack will allow the original signal from the radio tuner to pass through whenever there isn’t a connector plugged in. It seems like this is easier on older hardware than it is on modern equipment.
This isn’t where his entertainment enhancements stop. [Nali’s] working on a 7″ in-dash Linux machine so keep your eye on his thread to see what he comes up with.