DFRobot_Grayscale_Sensor__SKU_DFR0022_-DFRobot

Introduction

The DFRobot Grayscale Sensor is an analog sensor. It is a special sensor with arduino expansion boards. The Gray-scale sensor interface uses PH 2.0 socket. The power supply needs the same controller, typically for 3.3V or 5V.

Specification

Note: the product is NOT waterproof and dustproof; the detection accuracy will be affected by the light brightness of the environment and light reflectance of the material the sensor detects.

Pin Definition

The definition of gray-scale sensor pin is

  1. Signal Output
  2. GND
  3. Power

Analog Sensor Pin Definition

Connection Diagram

Analog sensor connection diagram

Sample Code

void setup()
{
  Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop()
{
      int val;
      val=analogRead(0);   //connect grayscale sensor to Analog 0
      Serial.println(val,DEC);//print the value to serial
      delay(100);
}

More Documents

DFshopping_car1.png Get DFRobot Grayscale Sensor (SKU:DFR0022) from DFRobot Store or DFRobot Distributor.

Turn to the Top