0

Your Shopping Cart is empty.

  • SHARP IR Ranger Sensor GP2Y0A21YK0F-(GP2D12 upgrade version_
    • i i
    • images/l/111_1.jpg images/l/111_1.jpg
    • images/l/111_2.jpg images/l/111_2.jpg
SHARP IR Ranger Sensor GP2Y0A21YK0F-(GP2D12 upgrade version_
INFO

SKU:700-001-0256

Shipping Weight:19g

Free Shipping!

$16.50
Qty:
VS
VOTES

Vote for specials.

0 votes

maker-moments

GP2Y0A21YK0F has more stable function and lower power consumption.


1 Detecting distance : 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

8 Less influence on the color of reflective objects, reflectivity

9 Line-up of distance output/distance judgement type :

Distance output type (analog voltage) : GP2Y0A21YK

Distance judgement type : GP2Y0D21YK

Judgement distance : 24cm

(Adjustable within the range of 10 to 80cm [Optionally available])

10 External control circuit is unnecessary

11 Low cost


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;
}

 

 

 

For more information of this product, please visit theWiki PAGE

login or register to add your words.