(SKU:RB-02S078)Grayscale Sensor

From ALSRobot-Wki
Jump to: navigation, search
Hd0.jpg

Contents

Product overview

Gray level sensor is analog sensor with the Arduino sensor v5.0 extension board combined with use, can sense the ground or desktop different colours and produce the corresponding signal, which can realize interact with color related work, also can be a patrol patrol car sensor or the recognition of the robot soccer field gray. Power needs and controller, usually a 3.3 V or 5 V.

specification

  1. Working voltage :3.3V~5V
  2. Working current :<20mA
  3. Working temperature range:-10℃~+70℃
  4. Detecting resolution:10%
  5. Interface type: analog signal output
  6. size:30mm x 23mm
  7. weight :3g

Method of use

Pin definition

  • S:Signal output
  • +:(VCC)
  • -:(GND)
Hd1.jpg

Connection here

S port receiving the analog input pins of the controller. 5 v &gnd received power of + 5 v &gnd respectively.
Hd2.jpg

Application of routine

The gray level sensor in accordance with the procedures to access the Arduino UNO controller, observed under different gray values in a serial port, the value of the output.

sample code

void setup()
{
    Serial.begin(9600);     //打开串口,设置串口波特率为9600bps
}
void loop()
{
    int val;
    val=analogRead(0);      //将灰度传感器连接到模拟接口0
    Serial.print("Grayscale is ");//通过串口打印读取到的模拟值
    Serial.println(val,DEC);//通过串口打印读取到的模拟值
    delay(100);
}

Application effect

When you detect different gray values, the measured value of the feedback back at this time. As shown in the figure below, this figure is when gray sensor detected 85% of the grey value, serial feedback data diagram.
Hd3.jpg

Products related to recommend

Buy address:[1]

Personal tools
Namespaces

Variants
Actions
Navigation
Tools