Pages: [1]   Go Down
Author Topic: Record and Playback Analog Sound  (Read 1567 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hej

i was wondering if it is possible to record sound from a microphone ( piezo ) and play it back via a speaker ( also piezo ).

i managed to grab the input from a pre-amplified piezo sensor via a digital in pin and play it back through a digital out. as you can imagine it sound very rough.

has anyone ever done something like that more successfully?
maybe even via the analog input?

Code:
int inputPin = 2;
int outputPin = 3;

void setup() {
  pinMode(outputPin, OUTPUT);
  pinMode(inputPin, INPUT);
}

void loop() {
  digitalWrite(outputPin, digitalRead(inputPin));
}
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i learned something.

while it is obviously easy to grab analog input from the analog pins, it is not as trivial to actually output the same data through an analog pin. the arduino semantics are a bit confusing here, as the analog out really creates a signal via PVM.

to actually output analog values as voltage between 0 and 5 volts ( or any other range ) a digital analog converter ( DAC ) is necessary. i learned that the easiest way to build a DAC is with a so called Resistor Ladder ( http://en.wikipedia.org/wiki/Resistor_Ladder ). there are also ICs available.

has anyone any comments on that technique, or maybe even some useful advice or experience to share?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be curious to know if there are any DAC ICs out there that are suitable for accepting low bit rate audio from the Arduino, and having an integrated amp / mixer for outputing said audio directly to a low power output device such as a small speaker. Any thoughts on this? could also do some other interesting things that require a wave form such as... laser control? don't know about this one, mabye it just requires a non inverting signal.
Logged

Pages: [1]   Go Up
Jump to: