2010年6月8日火曜日

Sensors 01 Piezo

Piezo vibration sensor

explanation of Piezo

http://arduino.cc/en/Tutorial/Knock

 Requirement

10k Ohm Resister(any valued resistor is fine but it is hard to get a signal if you use lower resistor and it is potential risk to break down analog input if you use too high resistor)

piezo

wires

Arduino




This exercise is very simple.

Circuit



I wrongly put a LED in a picture but it does not do anything.



Program

I made a very simple program to check

void setup()
{
  Serial.begin(9600);//setup serial speed
}
void loop()
{
  Serial.println(analogRead(0)); // gets data from analog pin 0 and send to computer
  delay(500); //not to send too much information
}


It actually the resistor is critical for this circuit.

I originally used 100k ohm resistor but the value of analog signal was so tiny.

Also the result is deeply depend on piezo itself. I tried three different piezo but they send back different amount of values.





0 件のコメント:

コメントを投稿