Skip to content

Smart_Grayscale_sensor_SKU_SER0147

Angelo edited this page Sep 21, 2016 · 3 revisions

WiFi Bee V1.0 (SKU:TEL0067)

Introduction

Specifications

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

LED gets dark when facing the black paper

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 colour 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

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

Clone this wiki locally