perjantai 1. helmikuuta 2013

Arduino Piezo Sensor - LDT1-028K

This time i got Piezo sensor LDT1-028K which is some kind of paper slip which can detect touching or  twisting and as in description is said, vibration and impact. My setup is the slip and led. If the slip is touched the led should set on and if it's not touched the led should be off. The only problem is that the slip is throwing random numbers and I can't see any logic there... But anyway it's working somehow.


---------------------------------------------------------------------------------------------------------
Description: The LDT1-028K is a multi-purpose, piezoelectric sensor for detecting physical phenomena such as vibration or impact. The piezo film element is laminate to a sheet of polyester (Mylar), and produces a useable electrical signal output when forces are applied to the sensing area. The dual wire lead attached to the sensor allows a circuit or monitoring device to process the signal.


Features:

• Piezoelectric polymer

• Multi-purpose

• Vibration sensing

• Impact sensing

• Laminated

• Dual wire lead attached

• Minimum impedance: 1 MΩ

• Preferred impedance: 10 MΩ and higher

• Output voltage: 10mV-100V depending on force and circuit impedance

• Storage temperature: -40°C to +70°C [-40°F to 160°F]

• Operating temperature: 0°C to +70°C [32°F to 160°F]

---------------------------------------------------------------------------------------------------------


The actual code goes like this:

int sensorPin = A0; // sensor must be in analog input
int ledPin = 7; // led is connected to port 7
int sensorValue = 0; // here is defined the value for sensor

void setup() {
pinMode(ledPin, OUTPUT); // led is in output which means it sends information to outside world
Serial.begin(115200); // set reading to the fastest speed possible
}

void loop() {

sensorValue = analogRead(sensorPin); // here we read the numbers from sensor

  // from device monitor we can see values are between 0 - 1023

if (sensorValue < 500 && sensorValue > 50) // if value is smaller than 500 but bigger than 50
{
   digitalWrite(ledPin, HIGH); // led will be on
}

else
{
  digitalWrite(ledPin, LOW); // if the value is something else led is off
}


// sensorValue = 0; // not sure if the sensor value should be resetted somehow

// printing to the serial monitor
  Serial.print(sensorValue);
  Serial.print("\t");
  Serial.print(sensorValue);
  Serial.println();
}



Links to the sensor:

http://www.meas-spec.com/product/t_product.aspx?id=5435
http://www.seeedstudio.com/wiki/index.php?title=Piezo_Sensor_-_LDT1-028K_Lead_Attachments

Like this the serial monitor shows random numbers and there is no logic I think. Normally this sensor is used to measure jolts i heard. Anyway I got it to work somehow.

5 kommenttia:

  1. The values seem to be so random :| I got the same sensor and it seems to give random values. Did you get it to work correctly?

    VastaaPoista
    Vastaukset
    1. I gave up in the end. The values were so random and I just couldn't get it to work properly. As you can see in the video it doesn't work very well. :(

      Poista
  2. What type of sensor is this? is it active or passive . Does it need an external supply or it acts as active type without supply?

    VastaaPoista
    Vastaukset
    1. Sorry, I don't remember anymore. It needs power but not external power supply if I understood correctly.

      Poista
    2. You can see the minimum setup on my picture, all power comes from usb port of PC

      Poista