Go Down

### Topic: Music to vibration (Read 2116 times)previous topic - next topic

#### kakotes

##### Oct 21, 2011, 11:16 pm
Hello,

I'm new to Arduino and I am currently trying to make a device that turns music from an mp3 player into vibrations (using small vibrating motors, about 5 of them, one for each frequency range), according to the different frequency ranges and their intensities (kinda like a spectrum analyzer, but with fewer frequency ranges). I've already connected an mp3 player to the arduino using the following circuit to get a ~2.5 V DC offset:
+ 5V
|
<
> 10k
<
220 uF     |
mp3-------) |---------------- Arduino A0
|
<
> 10k
<
|
Gnd

My questions are:
1. On the 0-1023 input range, the values go from around 490 to 530. Should I amplify the signal before feeding it to the arduino? If so, what circuit do you recommend?
2. How would I implement an FFT algorithm to get the intensity of each frequency range? I already tried elmchan's fft library but I can't get it to work.
3. I'm thinking about using PWM to control the vibration motors. Is this a good idea?

#### winner10920

#1
##### Oct 22, 2011, 06:54 am
If you are not against adding an ic, look into msgeq7
I haven't gotten to play with one, still shipping but it is basically a spectrum analyzer that outputs a multiplexed voltage for 7 channels of frequency
I think it would simplify your project to have an ic do all the hard work, you would just poll it for data and read that
like say use just 5  channels control 5 vibrator circuits directly, if pwm does work then map the analog 0/1023 to 0/255 for a simple solution
im planning on using it for a light orchestra sort of deal for a car, having leds go off in the sub for low frequencys, mid to mod range speaker and highs to my tweeter lights, I will probably map it to getbthe brightnesss according
here's the sparkfun page
http://www.sparkfun.com/products/10024
They have it retired but I bought 5 brand new for 8.99 off ebay including shipping

#### kakotes

#2
##### Oct 22, 2011, 12:52 pm
That's a great ideia, hadn't thought of that. Just one more question: if i plug the msgeq7 output to arduino analog input, what kind of values would i be getting on the arduino and how would i use them to get the different frequency ranges?

#### kakotes

#3
##### Oct 22, 2011, 01:03 pm
I've found a site that explains pretty much everything ^^
http://skoba.no-ip.org/msgeq7/index.html

#### trigonometry

#4
##### Jun 13, 2013, 04:42 pm
Hello!
I am working on a similar project. The link on the last reply is broken... does anyone have a cache or know of where that information can be found?
Thanks

#### winner10920

#5
##### Jul 19, 2013, 03:24 am
if i helps here is some of my code from my projects, not commented perfectly but it should help you play around with it

#### rickso234

#6
##### Jul 19, 2013, 06:24 am
That link didn't work, but this (may be the same page) appears to work...
http://nuewire.com/info-archive/msgeq7-by-j-skoba/

#### jroorda

#7
##### Jul 20, 2013, 12:01 am
I suspect you may be going with the msgeq7, as it is a great fit for this application, but I hate to leave a good question unanswered.

To get a good amount of resolution using the analog inputs on the Arduino you definitely want to amplify the signal. I did a project like this last year and I just used a fairly normal op amp.  I can look up the exact model if you want.  It was special in that it could run from one supply +5V instead  of +5 and -5V and drive close to either rail.  I think I amplified by about 10 to 20 times and I biased the center of the signal up to 2.5V.  If you don't do this you will get lots of distortion as half of the wave is below 0 on the ADC not to mention the op amp.

From there I would use the FHT library to do a 5 bin FFT and from there all you need to do is control the motors.

Go Up