Audio

Facebook Twitter

Photo 1022. Audio input and waveform analysis. Well, basically you want to feed the sound output into one of the Arduino's analog input pins; once you've done that, you can use the analogRead() function to get a voltage level (corresponding to the waveform's voltage reading) as a value 0-1023 into an integer variable.

Audio input and waveform analysis

Once you have it stored in the variable, then the tricky part (but code does exist out there for this - somewhere) would be to feed the values (as a small array of integers, I would imagine) into a FFT algorithm/function, in order to process the waveform sampled into whatever number of frequency bands you desire; from there you can use those levels to drive whatever other code you need. Now, the audio input will be tricky - you are probably gonna want to measure it; it should be around 1V peak-to-peak for regular line-level outputs, but it can vary. +V offsetaudio |source ----||-----+-----------> to Arduino Analog Pin bypass cap The offset should be 1-2 volts. Hope this helps! PWM fan noise. Change schematics? PWM is not recommended by the fan manufacturer Sunon on the grounds of reliability.

PWM fan noise. Change schematics?

Also with PWM there is not much in the way of speed control as a fan does not have much of a load and PWM works best for a motor when it is under load. Adding a capacitor is in effect smoothing the PWM and giving you more of a DC signal. A fan working with a current of 160mA is no problem to drive with a FET in the liner mode.

However, the heat you have to dissipate increases as the fan power goes up. The circuit I posted earlier works well with these small computer fans and the speed control is good down to about 30% PWM cycle, this represents a voltage of 2.8v on the fan. Sound Detection Circuit - Following Handclaps. Int leftmicPin = 0;int rightmicPin = 1;int centermicPin = 2; int values[3]; // this holds readings from the three micsint loudest[3]; // this holds indexes to the above values, after sorting, the loudest will be first (i.e. loudest[0]); char *Positions[3] = {"Left", "Center", "Right"}; // string used to display the calculated position void setup() { Serial.begin(9600); } void readValues(){ // function to load the value array with sensor data and initialise the loudest array so it can later be sorted for(int i=0; i < 3; i++){ values[i] = analogRead(i); loudest[i] = i; // this stores the index to the above values, ready for sorting } debugPrintValues() ; debugPrintLoudest(); // this is the order before sorting void sortValues(){ // this function is supposed to order indexes in the loudest array with the loudest first, it doesn't, do you see why?

Sound Detection Circuit - Following Handclaps

Void processLoudest(int index){ Serial.print("the sound is coming from the "); Serial.println(Positions[index]); } Interfaces Físicas 2. After making the Blow sensor and seeing how easy it might be to replace the piezo circuit with an electret microphone using the simple amplifier of the Nerdkits for their "Piezoelectric sound meter" project.

Interfaces Físicas 2

We decided to document an example that can capture sound with the electret microhone, read it in Arduino and send that data to Processing to finally make a text dance to the rhythm of the music. If we follow the circuit of Figure 1 the only change is to replace the Piezo Buzzer with an electret microphone, we also had to adjust the potentiometer circuit so that Vout is 2.5 volts to achieve a maximum dynamic range. As such, the visualization was better when data was sent to Processing. Downloads: Arduino program: (First autocalibrates microphone, you must be quiet, then sends only the positive values of the sound wave) Processing Program: Look at the video !

Figura 1. Interfaces Físicas 2. We designed these sensors for an interactive installation in which a user has to blow on a point projected on a wall.

Interfaces Físicas 2

When the system detects that a user has blown on the point, it will activate different projections and interactions surrounding the person. The sensor was supposed to be as minimally intrusive as possible because the projection was done over the same wall and we didn´t want any visual bumps over the projection, like a microphone would do. We decided to use a piezo as a vibration sensor taking in account its thickness, on our first attempts to read the signal we connected it directly to one of our analog inputs of theArduino. But when blowing on the piezo, the signal was not enough to pass the threshold. When searching some information about amplifiers on the web we found a simple one-transistor amplifier used by the cool guys at Nerdkits for their "Piezoelectric sound meter" project. Downloads: Circuit from NerdKits.