Template Information

Trang

Chủ đề

BSP (44) Device Drivers (43) WinCE (38) WINDOWS DRIVER (19) Linux Device Drivers (18) ARM (17) Android tools and tips (17) DRIVER FILES (16) Windows Device Driver (16) AUDIO DRIVER (12) 8051 (8) OMAP (7) PRINTER DRIVER FILES (7) C Programming (6) ASUS MOTHERBOARD (5) Interfacing (5) NETWORK ADAPTER (5) VIDEO DRIVER (5) CANON (3) Device Driver Downloads (3) MOBILE PHONE (3) Asus Driver (2) EPSON (2) Epson Printer Driver (2) HP LAPTOP DRIVER (2) LAPTOP DRIVER FILES (2) Logitech Driver (2) NETWORK ADAPTOR (2) OMAP 4430 (2) drivers download (2) ACER (1) ACER TABLET (1) ALL IN ONE DRIVER (1) Acer Aspire 5738 Drivers (1) Analog-to-Digital (1) Asus Drivers (1) Asus Motherboard Drivers (1) Chip Architecture (1) DELL (1) Dell D610 Drivers (1) Dell Drivers (1) Device Drivers Download (1) Device drivers interview questions (1) Display Driver (1) Drivers Download for Windows 7 (1) EEPROMs (1) Free Asus Motherboard Drivers (1) Free Drivers Download for Windows 7 (1) GRAPHIC DRIVER (1) HP Driver (1) Hardware (1) Intel Drivers (1) Intel P35 (1) Intel P35 chipset drivers (1) I²C (1) LAPTOP SERVICE MANUAL (1) LCD (1) Logitech Mouse Driver (1) Logitech webcam driver (1) MODEM DRIVER (1) Motherboard Drivers for Windows 7 (1) PARALLEL PORT (1) Pc Driver (1) RTOS (1) Real Time Clock (1) Sensors (1) USB CABLE DRIVER (1) WEBCAM DRIVER (1) WIRELESS ADAPTOR (1) Windows 7 Drivers (1) Windows Mobile (1) acer driver (1) acer driver downloads (1) acer laptop driver (1) chipset drivers (1) network card driver (1) network driver download (1) sdcc (1)

Bài viết ngẫu nhiên

Xem phim HD Online

Số lượt views

Hiển thị các bài đăng có nhãn Sensors. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn Sensors. Hiển thị tất cả bài đăng

Distance Measurement Sensor

Chủ Nhật, 9 tháng 10, 2011 / 09:15

GP2Y0A21YK is General Purpose Type Distance Measuring Sensors from Sharp. (see the product page). Sharp Infrared (IR) radiation Distance Measuring Sensor use Infrared signal to measure object distance from 10 to 80 cm with analog output.
Features
  1. Less influence on the color of reflective objects, reflectivity
  2. Line-up of distance output/distance judgement type

    Distance output type (analog voltage) : GP2Y0A21YK

    Detecting distance : 10 to 80cm

    Distance judgement type : GP2Y0D21YK

    Judgement distance : 24cm

    (Adjustable within the range of 10 to 80cm [Optionally available])
  3. External control circuit is unnecessary
  4. Low cost
Applications
  1. TVs
  2. Personal computers
  3. Cars
  4. Copiers
  5. Robots
The output of this sensor is analog therefore it need Analog to Digital Converter (ADC) to interface the 8051. I use ads7841 as ADC (see this article).
The graph of Analog voltage output versus distance to reflective object are shown in Fig.1. When I plot Analog voltage output versus inverse number distance, I found the linear relation shown in Fig.2.

Fig. 1 Analog voltage output (V) versus distance to reflective object (cm).


Fig. 2 Analog voltage output (V) versus inverse number distance (1/cm).
The linear equation is y = 20.99x + 0.19, where y is voltage output and x invert distance. Notice that the voltage output I can trust are about 0.4 to 2.8 V.
This is an example code how to interface the distance sensor to 8051. I use SDCC as C Compiler.
#include <8051.h>

#include "ads7841.h"
void main()

{

float x,y; // Distance and Analog voltage output


y = analog(0); // Read volt out if the sensor connect to channel 0 of ADS7841


y = 0.00122*y; // Convert BCD to DEC by multiply voltage by 5/4096



if ( (y > 0.4) && (y < 2.8) ) {

x = (y-0.19)/20.99; // Solve the linear equation

x = 1/x; // Inverse back get distance in cm.

}

}

Source:
test_irsensor.c
characteristic.txt (For plot with Spreadsheet)

Related Links

GP2Y0A21YK/GP2Y0D21YK Datasheet
Analog to Digital (ADS7841) Interfacing
Chủ Nhật, 9 tháng 10, 2011 09:15 Đọc tiếp >>