Description:
*Infrared rangefinder : 10cm (~4") to 80cm (~30")
*Analog Interface
*Lead free, ROHS compliant
Specifications :
1、Measuring range : 10 to 80 cm
2、The maximum allowable Angle : > 40 °
3、The power supply voltage : 4.5 to 5.5 V
4、The average power consumption : 35 mA
5、Peak power consumption : about 200 mA
6、The frequency of updates/cycle : 25 Hz/40 ms
7、Analog output noise : < 200 mV
Arduino take six channel 10 ADC with itself, the GP2D12 sensor can directly connect with Arduino analog interface, and get feedback value of this sensor.
According to the official manual, it is known that the output of the GP2D12 is 0.4 V ~ 2.4 V analog signals, corresponding 10 ~ 80 cmkjtance, output is inversely proportional to distance, and nonlinear .
Code:
char GP2D12;
char a,b;
void setup()
{ Serial.begin(9600); //}
void loop()
{int val;GP2D12=read_gp2d12_range(0);a=GP2D12/10;b=GP2D12%10;val=a*10+b; if(val>10&&val<80)
{Serial.print(a,DEC);//Serial.print(b,DEC);//Serial.println("cm");// }
else Serial.println("over");//
delay(50);}float read_gp2d12_range(byte pin)
{int tmp; tmp = analogRead(pin);if (tmp < 3)return -1; return (6787.0 /((float)tmp - 3.0)) - 4.0;}
Package includes:
1pcs Chinduino SHARP IR Ranger Sensor GP2D12
Item Specifics | |
---|---|
Code : | char GP2D12 |
Quantity : | 1 pcs |
Compatible Model : | |
Compatible Brand : | For |
Note1 : | Please check the description & picture before Buying! |
Brand : | S-union |
MPN : | Does not apply |
UPC : | Does not apply |
1) We accept Paypal only.
2) Payment is required within 7 days of purchase.
3) An unpaid item dispute will be filed if payment has not been made within 7 days.
1) A Merchandise Authorization Number(RMA#) is required for all return packages. Packages without RMA # will not be handled.
Please refuse to sign for your package if it is damaged during shipment .
2) All NON-Seller Mistake returns for refund are subject to 20% re-stocking fee plus transaction fee. The cost of shipping and handling will not be refunded and buyer will be required to pay the return shipping fee. (e.g, you bought wrong version or wrong item because you did not match the item picture with the product code correctly).
3) Orders cannot be canceled once shipping has occurred. 85% of payment can be returned for an unshipped order, if you wish to cancel.
4) Buyers are responsible for part return shipping fees on return packages.
5) We reserve the right to refuse any returns for objective reasons.
6) Please check before you buy it, all mistaken orders will be charged 15% re-stocking fee.
7) If you have any problems, please call us or send us an eBay message, we will try our best to serve you. Thank you!
A) If you have any issues, please e-mail us immediately. We endeavour to answer all emails as quickly as possible, but due to high email volume it may take time for us to reply.
NOTE:
If any dissatisfaction about the item, resend or refund, do not open a case.
If you buy a wrong item, resend or refund(partial ), do not open a case.
If damaged during the shipping, resend or refund, do not open a case.
If you received a wrong item, resend or refund, do not open a case.
|
Description: Code: |
Item Specifics | |
---|---|
Code : | char GP2D12 |
Quantity : | 1 pcs |
Compatible Model : | |
Compatible Brand : | For |
Note1 : | Please check the description & picture before Buying! |
Brand : | S-union |
MPN : | Does not apply |
UPC : | Does not apply |
1) We accept Paypal only.
2) Payment is required within 7 days of purchase.
3) An unpaid item dispute will be filed if payment has not been made within 7 days.
1) A Merchandise Authorization Number(RMA#) is required for all return packages. Packages without RMA # will not be handled.
Please refuse to sign for your package if it is damaged during shipment .
2) All NON-Seller Mistake returns for refund are subject to 20% re-stocking fee plus transaction fee. The cost of shipping and handling will not be refunded and buyer will be required to pay the return shipping fee. (e.g, you bought wrong version or wrong item because you did not match the item picture with the product code correctly).
3) Orders cannot be canceled once shipping has occurred. 85% of payment can be returned for an unshipped order, if you wish to cancel.
4) Buyers are responsible for part return shipping fees on return packages.
5) We reserve the right to refuse any returns for objective reasons.
6) Please check before you buy it, all mistaken orders will be charged 15% re-stocking fee.
7) If you have any problems, please call us or send us an eBay message, we will try our best to serve you. Thank you!
A) If you have any issues, please e-mail us immediately. We endeavour to answer all emails as quickly as possible, but due to high email volume it may take time for us to reply.
NOTE:
If any dissatisfaction about the item, resend or refund, do not open a case.
If you buy a wrong item, resend or refund(partial ), do not open a case.
If damaged during the shipping, resend or refund, do not open a case.
If you received a wrong item, resend or refund, do not open a case.