Electronics

Line Follower Analog Grayscale Sensor Tracking Module

AED 9.45

1

Description

The grayscale sensor is an analog sensor. It can be used in combination with the Arduino sensor expansion board v5.0 to sense the different colors of the ground and generate corresponding signals. It can realize interactive works related to color, and can also be used as a sensor for the Line Follower car. Grayscale recognition robot. The power supply needs to be the same as the controller, usually 3.3V or 5V.

      Specifications

      • Working voltage: 3.3V or 5V
      • Working current: < 20mA
      • Operating temperature range: -10 ° C ~ +70 ° C
      • Detection resolution: 10%
      • Interface type: analog signal output
      • Size: 24mm x 21mm
      • Weight: 3G
      • Interface definition
      • OUT: signal output
      • VCC: Power Supply (VCC)
      • GND: Ground (GND)
      working principle
      The Grayscale Sensor uses the reflection of the white high-brightness light-emitting diode with a photoresist. the photoresistor receives the returned light, and the photoresistor is different according to the intensity of the light. and since the reflected light with the different surfaces varies, The resistance values are also different, then we use the Gray values in the Arduino code.
       
      Programming principle
      The grayscale sensor has three pins, which are the power supply positive Vcc, the power supply ground GND, and the signal terminal OUT. In actual use, the sensor can be directly connected to the analog interface of the Arduino controller, for example, the analog port A0, after the Arduino is powered on. The sensor white highlight LED lights up, the sensor button is placed to face the surface, the data is read by the AD conversion of the Arduino controller, and then the measured analog quantity is used with the Arduino code.
       
      Connection diagram
      The OUT port is connected to the analog input pin of the controller. Connect 5V and GND to the +5V and GND of the power supply, respectively. 
       

      Arduino code for Analog Grayscale Sensor Tracking Module

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