(SKU:RB-02S078)Grayscale Sensor
From ALSRobot-Wki
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
- Working voltage :3.3V~5V
- Working current :<20mA
- Working temperature range:-10℃~+70℃
- Detecting resolution:10%
- Interface type: analog signal output
- size:30mm x 23mm
- weight :3g
Method of use
Pin definition
- S:Signal output
- +:(VCC)
- -:(GND)
Connection here
- S port receiving the analog input pins of the controller. 5 v &gnd received power of + 5 v &gnd respectively.
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.
Buy address:[1]