Posts Tagged ‘mini-project’

Simple Optical Microphone/Pickup

February 3rd, 2010

This is another mini-project that began, like so many have, in a discussion with Scott over some beer. We wanted to build a new kind of speaker amplifier, which used mechanical closed-loop feedback to position the speaker cone exactly where the audio signal says it should be. We figured that, if done right, this could yield higher audio quality from cheaper speakers.

So, that idea is pretty crazy, but it seemed just barely plausible enough that I had been thinking about the component parts of such an amplifier. The most important seemed to be a sensor that could accurately supply feedback on the speaker cone position without loading the speaker or distorting the cone. The first method we considered was a capacitive pickup. Paint the back of the speaker cone with conductive paint, then position two copper plates behind the cone, just barely not touching when the speaker is at its maximum throw. This acts like two capacitors in series, and gives you a capacitance that varies along with the audio frequency, without any mechanical connection to the speaker cone.

We also considered magnetic feedback, using something like an LVDT, but where one coil is the voice coil itself. This would involve modulating some kind of high-frequency carrier into the speaker drive signal, then placing another fixed coil around or behind the voice coil to pick up that signal.

The next method, and I guess the simplest, is optical. This would work a lot like a fiber optic microphone or an optical guitar pickup. You can measure vibration by detecting changes in light intensity caused by changes in distance or angle of some reflective thing that’s vibrating.

Whereas the capacitive and LVDT ideas require a high-frequency modulated signal, that’s optional with the optical method. You can measure absolute intensity, or you can modulate your LED with a high-frequency carrier that can be detected on the receiving end. This modulation can help reject ambient light (including hum from fluorescent lights) but it isn’t required.

So, to see if this project has even a tiny chance of working, I thought I’d prototype the optical sensor by building an optical microphone. The end results were rather mediocre. I’m posting it here only because:

  • I was honestly surprised that it worked at all
  • It could be useful for other applications, like a drum or bass guitar pickup
  • Maybe one of my readers has hints on making it more sensitive and lower noise? :)

The Circuit

This is a really simple back-of-the-envelope sort of transimpedance amplifier, high-pass filter, and gain stage. Disclaimer: I hate doing math for analog circuits when it’s just a quick hobby project, so I did no math in designing this. Take it with a few shakes of salt. My breadboard was humming pretty badly due to incoming EMI, so I built it dead-bug style in a mini Altoids tin. If you build this, definitely use a suitable amount of shielding.

  • Power supply range is about 3-6v, but it seems to work best at 5-6v. (If you listen to the op-amp data sheet, max voltage is 5.5v.)
  • The op-amp should be a low-offset, rail-to-rail, high-bandwidth type. I used the OPA2350 because that’s what I had handy.
  • The IR LED I used is pretty generic. I’m operating it at fairly high current, because I wanted a strong light source. You might consider using multiple LEDs, though, to make it easier to position the pickup properly.
  • The photodiode should be a PIN diode with an IR filter. I used an SFH229.
  • Keep the leads short, especially power and photodiode.
  • They aren’t on the schematic, but remember some decoupling capacitors. (I used 0.1uF and 22uF)
  • I put a bit of black heat shrink tubing around the photodiode as a baffle. This seemed to help.
  • I used a stereo 1/8″ audio jack for ground, audio out, and power in. It would be neat to build one with a built-in battery, but this tin was a bit small for that, and the IR LED is kind of power hungry.
  • Make sure to ground the Altoids tin! These smaller tins are harder to solder to than the larger tins, but it can be done. Just use a hot setting if your iron has adjustable temperature, and be patient.

opticalmic-schematic

IMG_1081

Rubber Band Pickup

The first successful test I had of this pickup was with a rubber band. I’d like to try this with a guitar string, but I don’t play :)

It’s actually pretty forgiving about the positioning of the pickup relative to the rubber band, and it’s very sensitive even when the rubber band is a few inches away. This circuit can pick up very low-frequency vibrations well, so you hear very deep bass notes that you don’t normally notice in a rubber band pluck.

IMG_1085

Speaker Surface Pickup

This is the application I originally hoped the optical microphone would work for: picking up sound off the front or back surface of a loudspeaker cone. If I could do this really well, the closed-loop amplifier might have a chance. The results certainly weren’t hi-fi, but I guess I was still surprised it worked at all.

Unlike the rubber band, this test was extremely finicky. I had to position the pickup just right, and I used some Kapton tape to make the surface of the speaker more reflective to IR light. I also had trouble getting a good reflection off the curved surface of the cone, so I stretched a flat section of tape between the center dome and the middle of the cone. This gave good signal strength, but the tape itself also acted as a mechanical filter, giving kind of an odd frequency response to the whole system.

IMG_1078

And that is all.

Hopefully this will allow me to have some closure on a completely mediocre mini-project that was nonetheless interesting enough that I couldn’t just forget about it without sharing. :) If anyone reading is a real electrical engineer, I’d be interested in hearing about what I did wrong.

Gitaroo Man + DDR Pad

January 15th, 2010

As much as I like the long, complicated projects that involve weeks of soldering, gluing, coding, tweaking, re-tweaking and debugging, it’s really refreshing to occasionally do something cool with no more than an hour or two of work.

This mini-project was my boyfriend’s idea. It’s an experiment in cooperative two-player Gitaroo Man, played using a gamepad for attack/charge and DDR pad for defense.

For those who aren’t familiar with it, Gitaroo Man is a rhythm game where you do battle using music. You play music on your gitaroo to attack or to charge your health bar. To defend against the enemy’s attacks, you dodge by pressing buttons in time with icons that fly toward the center of the screen. We thought the dodging phase of the game might map well to a DDR pad.

Videos first, tech details below. My boyfriend is on the gamepad, and one of my friends defends with the DDR pad. Theoretically you can play this with one person, but we suck too much at the moment. When we filmed this, we hadn’t played Gitaroo Man in years.. so we definitely could have done better with some more practice :)

Resurrection

Bee Jam Blues, Master mode

Implementation Details

This turned out to be such a quick project because it was really just some special-purpose firmware for my old Unicone2 controller emulator project. The firmware combines inputs from the gamepad and DDR pad, maps the DDR arrows to the buttons used for blocking in Gitaroo Man, and it includes a one-shot timer which converts sustained pressure on a dance pad arrow into a brief tap of the corresponding controller button. This way, standing still on the DDR pad won’t affect your ability to use the controller buttons normally during the attack phase.

Overview of all hardware and software components:

gitaroo-ddr-blockdiagram

The Unicone2 hardware:

P8030081

Links:

“Luggable” power pack

June 9th, 2009

Paul and I are leaving on a cross-country train trip next week, for Jen and Shawn’s wedding in Colorado. I’m sure the view will be great, and I’m bringing a handful of books- but Paul and I are geeks and we need our electro-doodads. If only we had a way to run our Nintendo DS and PSP for the ~30 hours that the trip will take…

I sifted through my stockpile of junk, and came up with this:

IMG_0643

It’s kind of like a mega-size Minty Boost, or a heftier version of the Kensington power pack. The Minty Boost weighs in at about 6 Watt-hours, depending on the AA cells you use. The Kensington pack is rated at 7 Watt-hours, with a Lithium Ion battery. This brick occupies the middle-ground between the Minty Boost and a car jump-start battery, weighing in at 84 Watt-hours. It should run and charge a Nintendo DS for at least 30 hours.

It’s built almost entirely from junk that I had lying around the house: (Your house may vary.)

  • 12 Volt 7 AH Lead-calcium battery
  • Aluminum box, in my stockpile of project enclosures
  • Receptacle end from a cigarette lighter extension cable
  • DC-DC converter from an old Nokia phone charger (for a phone I no longer use). Swapped a resistor with a trimmer pot for 5V output.
  • USB sockets from a dead 4-port hub
  • Heavy duty wires and quick-disconnect plugs from a dead UPS
  • Odds and ends: Switch, mounting hardware, fuse holder, wire nuts, foam weather-stripping, JB-Weld epoxy, heat shrink tubing, LED, resistors

Parts I had to buy at the local Fry’s:

  • 10 Amp fuse (Pack of five for a few dollars)
  • 12V 1 Amp lead-acid battery charger ($20)
  • Cigarette lighter plug for the charger ($2)

Now here’s hoping that nobody thinks it’s a “hoax device”…

P.S. I’m still working on the Robot Odyssey DS port and in fact there are some interesting bits of UI working now- but I haven’t quite reached another blog-worthy milestone yet.

Lego Sky

December 1st, 2008

Over the weekend, I had a chance to finish up a project that I started (and immediately became distracted from) several weeks ago.

In our house, Paul and I have a game room. This is where the video games live, as well as other assorted geekery. We have Magic cards, D&D books, some manga.. it’s super nerdy :)

Best of all, Paul has a Lego city on display. We had been looking for an interesting way to add light to the city, so when I saw some RGB LED light strips for sale at Ikea, I knew I had to mod them. In their stock configuration, these light strips can do boring fully-saturated colors, and you switch between them with a boring push-button switch.

After ripping apart the Ikea light and rummaging through my junk drawers, I came up with this:

Touchpad DIODER in action

The Altoids tin has the modified driver circuit: It’s the original circuit board with the microcontroller removed, then a homemade Arduino clone to control it. The orange box is an old Cirque PS/2 touchpad, removed from its original case and covered in fabric.

The Arduino sketch (firmware) is a little C++ program that reads the touchpad and uses it to control Hue and Lightness in the HSL color space. The result is a pretty intuitive and unobtrusive control which makes it easy to both pick a color and desaturate it toward white or dim it toward black. You can easily get some really nice sunset and sky colors.

I measured the power consumption of the completed light at between 1 and 6 watts. With Bay Area electric rates, this means you’d pay about 7 cents a month to leave it plugged in with the lights fully off, twice that to constantly backlight your Lego city in a dim orange glow, and a maximum of 50 cents a month to run the light at full brightness continuously.





For many more pictures of the final installation and the build process, check out my Ikea DIODER set on Flickr.

Mmm, crispy.

September 19th, 2008

I hate power electronics.

This was my first attempt at fixing a broken Cuisinart cordless kettle.

The original symptoms: I notice the kettle occasionally turns itself off. If I turn it back on, it works again for a little while. This kept up for a day or so, then it refused to turn on at all. I open it up, and one pole of the dual-throw relay (really, a combination on/off switch and thermal switch) had melted its plastic supports. The contacts no longer touched, so the kettle got no power.

The first fix: That pole of the relay was shot, but luckily there was another identical mechanism on the other pole. I could replace the broken pole with some other type of safety cutoff device, and it would be good as new. Ideally I’d use a thermal fuse for this purpose. The local Fry’s didn’t have any, so I used two 7 amp pico-fuses in parallel. Not ideal, but better than nothing.

So.. my fuses did their job, and my new wiring was fine. When I measured the resistances during reassembly, everything seemed fine. The first few pots of water after this fix are uneventful. Then I notice the bottom of the kettle (just under where my new wiring was installed) started getting really hot. Like, 300 degrees. This was starting to melt the plastic a bit. I open it up, and my wiring harness is what you see above.

So, what happened? I failed to fix the reason why the relay failed in the first place. I was assuming that the relay just used shoddy plastic, and it overheated because it was so close to the heating element. I assumed it was a design flaw. But, the other (presumably identical) relay pole was totally fine. It turns out that the original failure was a loose crimp in the joint that appears rightmost in the photo. The crimp wasn’t quite tight, so the wire rattled around in there a little. This added about 1 ohm of resistance when it was in just the wrong position. A manufacturing flaw.

This kettle nominally runs at about 12 amps. At 12 A and 120 V, a 1 ohm resistor will dissipate 144 watts. Yow.

So, I just replaced that entire section of the wiring harness with two new fuses and two brand new crimps. First pot of water was a success, and I rewarded myself with some irish coffee. We’ll see how well it holds up. I might find myself ordering some slightly better quality crimps and some actual thermal fuses if this fix also has problems.

(Buy a new kettle? Nevar!)

Latest Altoids artwork

June 4th, 2007



Medium: Altoids tin, Keyspan USA-19HS (modified), PS2 Multitap (modified), 74HCT04 inverting buffer, discrete passive components, solder, wire, epoxy.

Artist’s inspiration: Dorky boyfriend that crafts Final Fantasy Tactics characters with the precision of a meticulous dungeonmaster :)

(Yes, it’s a USB Playstation memory card reader/writer. Firmware and source code for Mac OS and Linux is in Subversion. The software doesn’t yet support PS2 cards.)

Flightaware route histogram

January 19th, 2007

Flightaware + Fyre:

The above image is part of a histogram generated from Flightaware’s 24-hour time lapse. Click the link for the uncropped version. The original video is a Quicktime wrapper around individual PNG frames. I used mencoder to strip off the Quicktime wrapper, then a small Python script split the video streams into individual frames, decompressed them, and plotted a histogram of each red dot. The script generated a data file which was rendered using a patched version of Fyre 1.0 SVN.

The obsessive hacker returns

August 20th, 2005

I just finished my fourth week at VMware. It sure doesn’t seem like it’s been that long. Today my team did some go-kart racing followed by a big group lunch. Mmm, tasty Chinese food. Monday I got my first paycheck.. more money than I’ve ever had at once. It takes some getting used to.

When I find a project I like, I get determined to finish it. That would usually involve staying up for a day and a half at a time until it was complete, ignoring all else. Well, I’ve managed to adapt that old lifestyle to fit a full-time job, but I still haven’t been getting enough sleep. This week I decided to build a 4-disk hot-swappable USB disk enclosure, so I can start to use the data and disks I have left over from navi. I finished it tonight, and posted plenty of pictures. That’s a USB hub and a 120mm cooling fan in the back. Each disk has a separate USB to IDE board, and they’re all wired such that the USB adaptors power on when you lock a disk into the hot-swap enclosure. It’s working really nicely so far. There’s a standard type-B USB port on the back, as well as a disk-style power connector for an external wall wart or ATX supply.

Now that this project is finished and I can stop obsessing over it, maybe I can finish cleaning up my apartment, or even think about buying some furniture…

I also need to do another round of downtown exploration. Maybe tomorrow night… Aside from the usual VMware festivities with coworkers, I’ve been pretty devoid of social interaction for the last week or two. Tonight there was a small party welcoming new folks to this apartment complex- free drinks, hors d’oeuvres, and a raffle. I had a beer and some short conversations- not much to talk about with people I probably don’t have anything in common with. It’s so odd living around married couples and families with small children. I have to wonder where the younger people around here live, if they exist in Sunnyvale at all. They probably find much cheaper apartments than this one. I still look too young. The hostess of this little shindig asked me for some ID when I wanted a beer, and seemed downright shocked when I was old enough. I guess I still don’t have it as bad as Jen ;)

This is a cool hack.

I’ll procrastinate after I pick your browser up off the floor

July 15th, 2005

I’ve been making slow progress on packing today- got all my books boxed up, along with many of my less fragile electro-widgets and such. This type of behaviour leads to procrastination, naturally.

I’ve been running the Deer Park Alpha 2 release of Firefox for a couple days. It does seem to be faster at DHTML, though I don’t have any of the really heavy-duty Javascript I wrote for Destiny M&M handy for benchmarking purposes. The coolest features destined to end up in Firefox 1.1, from my point of view, are SVG support and the “canvas” element.

Canvas is a very misunderstood HTML extension. It’s a new element that Apple invented mostly to make it easier to implement Dashboard. That part of the story is a little silly, and results in a lot of SVG advocacy and a lot of potential users suggesting to Apple places where they might shove their nonstandard hacks.

Well, it turns out that Canvas is indeed a standard- or at least a standard draft. Furthermore, it’s been implemented by the Gecko team, and happily runs in Deer Park. If you read the API, you notice that Canvas and SVG are really solutions to two completely different problems. SVG is a very complicated and very featureful scene graph built on XML, whereas Canvas looks more like a minimal vector drawing and raster compositing library for JavaScript. Canvas uses a simple immediate-mode interface for rendering to a bitmap, which makes it ideal for games or special effects, or for client-side image manipulation applications.

Canvas is so cool I had to abuse it. A while back I tried to render the Peter de Jong map in Javascript, basically making a very slow and crippled but very portable version of Fyre. Anything scene-graph-like, such as your usual DHTML tactics, would be disgustingly slow and memory-intensive. I ended up using Pnglets, a Javascript library that encodes PNG images entirely client-side. This worked, but was only slightly less disgustingly slow.

Anyway, the result of porting this little demo to Canvas was pretty neat. It’s still no speed demon, but it’s very impressive compared to the Pnglets version. It’s fast enough to be somewhat interactive, and it has at least basic compositing of the variety that Fyre had before we discovered histogram rendering. If you have Deer Park, Firefox 1.1, or a recent version of Safari you should be able to run the demo yourself. Otherwise, there’s a slightly outdated screenshot.