Showing posts with label sparkfun. Show all posts
Showing posts with label sparkfun. Show all posts

28 May 2013

She has a heart

This is not quite everything I wanted to get accomplished this weekend, but I did make some solid progress. All the electric components are soldered and working! In the process, I realized that I know nothing about soldering. Best lesson? Keep your soldering iron tip clean!

It took me quite a while to get everything drawn out and even longer to get it all soldered and working, but it was a great learning experience and super fun.

This is the entire unit... arduino, i2c multiplexing shield, equalizer shield, bluetooth breakout board, 4 ADXL 345 accelerometers, and an electret microphone. Only things missing from the shot are the 450 LED pixel points, the 6v 12Ah sealed lead-acid battery, and another battery to run this unit (I'm going to run the lights and controller off of separate batteries).

LightWalker's guts.



This is the i2c multiplexing shield with TCA9548A i2C switch. It allows me to hook up the 4 accelerometers that all have the same i2c hardware address to a single i2c line. The board can handle up to 8 units with the same address, so maybe I should do a spider for next year?
The big trick here was that I hooked up my SCL and SDA lines to where they were printed on the board but failed to realize that the board didn't connect those to the arduino's analog 4 and 5 pins like my board needed. I think newer boards would work through the stackable headers and the SCL and SDA holes printed on the board. Once I realized I was working with an older setup and re-routed them, all was good.


bottom of the i2c multiplexing shield
top of the i2c multiplexing shield















Here's the equalizer shield. I'm only using one of the  MSGEQ7 chips on here for a single audio channel, so it's kind of overkill, but it does give me a nice stackable shield and pins to hook the microphone and bluetooth to.


equalizer shield w/
electret microphone














And, just for completeness, the arduino compatible shield from seeedstudio...

the seeedstudio arduino
compatible board I'm using


09 April 2013

bringing the beats

shot of the horribly messy
prototype hardware
Getting audio working on Lightwalker has been a huge pain. I played around with a few electret microphones (like this guy from sparkfun) and had some bad luck with getting it to do what I wanted. In fact, I couldn't get it to do anything worthwhile. I even went as far as switching to using my android phone as the microphone and sending volume commands to my arduino over bluetooth. Doing so requires you to calculate root mean square and count zero crossings and all sorts of audio processing that I haven't done before. Was really cool to play with and tweak. But, in the end, doing the calculations in software and sending over bluetooth turned out to be way too slow.

I ended up landing on using a spectrum shield from sparkun in conjunction with their electret micrphone breakout board. Thought the whole thing was shot when I got it. And then I realized their documentation is incorrect and you have to run the mic at 3.3v instead of 5v. Has been great since I switched it. I might end up switching to just using an MSGEQ7 instead of the entire shield, but this is fine for now.

Another challenge I ran into was trying to figure out how to make it deal with the quiet of deep playa and being on the edge of a major sound camp. Once again, moving averages to the rescue! By keeping a moving average, I can compare the current volume to the average and adjust what the peak is as I go. So, moving from a quiet environment to a loud one or vice-versa will allow the lights to react visually well in both settings.

Check out the video. The lights and music are a little more synchronized in real life, but you get a good idea.