5 فایل پیوست
سنسور خمش - Flex Sensor 2.2 inch
سنسور خمش :
اساس کار این سنسور بدین صورت لست که با خم کردن آن مقاومت سنسور تغییر میکند.زمانی ک سنسور صاف است مقاومت آن در حدود 22KΩ تا 40 KΩاهم است .زمانی که سنسور خم شود به دلیل حرکت ذرات آزاد جوهر در ساختار سنسور مقاومت آن تا حدود 50k اهم افزایش می یابد.هنگامی که سنسور به شکل اولیه برمیگردد مقاومت آن به همان مقدار اولیه بر می گردد.طول این نسور 2.2 اینچ است.
فایل پیوست 1202
برای استفاده از این سنسور لازم است آن را در مدار مقسم ولتاژ قرار دهیم .این مدار بر اساس شکل زیر به یک مقاومت احتیاج دارد.رنج مقاومت در حدود 10K تا 100K می باشد.
فایل پیوست 1203
فایل پیوست 1204
نمونه کد Arduino:
کد:
void setup()
{
// initialize serial communications
Serial.begin(9600);
}
void loop()
{
int sensor, degrees;
// read the voltage from the voltage divider (sensor plus resistor)
sensor = analogRead(0);
// convert the voltage reading to inches
// the first two numbers are the sensor values for straight (768) and bent (853)
// the second two numbers are the degree readings we'll map that to (0 to 90 degrees)
degrees = map(sensor, 768, 853, 0, 90);
// note that the above numbers are ideal, your sensor's values will vary
// to improve the accuracy, run the program, note your sensor's analog values
// when it's straight and bent, and insert those values into the above function.
// print out the result
Serial.print("analog input: ");
Serial.print(sensor,DEC);
Serial.print(" degrees: ");
Serial.println(degrees,DEC);
// pause before taking the next reading
delay(100);
}
جهت سفارش کالا به این بخش مراجعه کنید.
مراجع:
www.sparkfun.com/tutorials/270
bildr