Smart_Grayscale_sensor_SKU_SEN0147 - jimaobian/DFRobotWiki GitHub Wiki

WiFi Bee V1.0 (SKU:SEN0147)

Introduction

This time we reinvented the line-tracking sensor. Beyond recognizing two specific colors or output through digital or analog only, the Smart Gray Sensor has integrated both digital and analog output features.

In digital mode, user can have two color data recorded through simple button operation, to achieve two-color detections with high and low outputs, and requires no more configuration after being set. In analog mode, the output value reacts precisely to the color grayscale detected.

Apart from being a stable and adaptative sensor in various environments, the Smart Grayscale Sensor also demonstrates a great potential in low-cost projects of color, grayscale and adjacence lights.

Specifications

  • Supply voltage: 5v
  • Interface Mode: Digital / Analog
  • Output:
    • Analog mode :0-5v output
    • Digital mode: TTL level output (0v or 5v) according to application needs
  • Digital switching signal feedback and dual analog gradation feedback
  • You can set the digital mode supports color detection
  • Dimensions: 37x10x15mm

Tools need

  • Smart Grayscale sensor V1.0
  • Arduino controller

Change the sensor between Analog and Digital

Just short click the button and the mode will be changed between analog and digital.

Analog mode

 Grayscale Sensor Connection Diagram in analog mode

In analog mode, the brighter the Sensor detects, the brighter LED will be. You can connect the sensor to analog pin to read the Grayscale from the sensor, just as the normal grayscale sensor.

Code Example:

int grayscalePin=0;
void setup()
{
 Serial.begin(9600);
 Serial.println("Smart Grayscale sensor:");
}
void loop()
{
  Serial.print("Grayscale:");
  Serial.println(analogRead(grayscalePin));
  delay(500);
}

Digital mode

In digital mode, you can set the logic of two different color by your own.

  1. Long click the button until the LED slow blinking (which means first color detecting ready).

  2. Let the grayscale sensor face to the first color (such as white paper)

  3. Meanwhile short click the button and the LED gets dark (which means first color detected).

  4. Short click the button and make the LED fast blink (which means second color detecting ready).

  5. Let the grayscale sensor face to the second color (such as black paper)

  6. Meanwhile short click the button and the LED gets dark (which means second color detected).

  7. The first color (such as white paper) will be Logical '1', and the LED becomes bright.

  8. The second color (such as black paper) will be Logical '0', and the LED becomes dark.

  9. This setting maintains even if the power is off, so for one purpose, one setting is enough.

LED gets dark when facing the black paper

LED gets bright when facing the white paper

Grayscale Sensor Connection Diagram in digital mode

Code Example:

int grayscalePin=8;
void setup()
{
 Serial.begin(9600);
 pinMode(grayscalePin,INPUT);
 Serial.println("Smart Grayscale sensor:");
}
void loop()
{
  Serial.print("Grayscale:");
  if(digitalRead(grayscalePin))
  {
    Serial.println("White detected");
  }
  else
  {
    Serial.println("Black detected");
  }

  delay(500);
}

Documents

  • [..... Datasheet]

image:nextredirectltr.pngGo shopping [...... smart Grayscale sensor_SKU:SER0147] category: Product_Manual category: SER_Series category: Sensors category: Source category: DFRobot