Color Recognition

Use Arduino Uno to drive the color recognition module to identify the three color values of the object.

Device connection

Hardware connection

Use Type-B data cable to connect Arduino Uno and computer.

Software connection

Open the "Arduino IDE" software and select the model and serial port number corresponding to the development board.

Color recognition module

The driver chip used by the color recognition module is ZC-CLS381.

image-20240607150703802

Function pinFunction
VCCPower supply interface: can be connected to 3.3V, 5V
SDAI2C data transmission interface
SCLI2C timing transmission interface
GNDGround interface

Digital tube installation

We use it with a car here. You can directly use the PH2.0 interface cable that comes with the color recognition module to connect the car expansion board.

image-20240607150846561

Code analysis

Here is only a brief introduction to the code content. For detailed code, please refer to the corresponding code file, which is provided in the download area!

Experimental results

After compiling the program successfully, upload the code to the Arduino Uno development board.

After the program is started, the color recognition module prints the three-color values of the current recognized object every 500 milliseconds. The object needs to be close to the color recognition module to be recognized more accurately.