Reference

Library

Communication Protocol Description

Protocol Format

  • START: start code, always 0xFF.
  • LEN: length, the total number of bytes from START to END.
  • ADDR: device address. Range: 0x60–0x63. 0x00 is the broadcast address and can be received by all devices.
  • CMD: command code or response code.
  • DATA: data field; refer to the instruction code description for details.
  • CHK: checksum, the sum of all bytes from START to DATA.
  • END: end code, always 0xED.

Example:
FF 08 60 01 20 03 8B ED
Here 8B is the checksum:
0xFF + 0x08 + 0x60 + 0x01 + 0x20 + 0x03 = 0x8B

Response Code

Correct Error Unknown Error Time-out Error Checksum Error Length Error Command Error Register Address Error Parameter Error Write Error
0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xE8 0xE9

Command Code

Write Register Read Register Data Message Request Message
0x01 0x02 0x11 0x12

The values listed above are the command codes. A corresponding response code will be returned to indicate whether the operation succeeded or failed.

Label Classification

Human Detection

None

Ball Detection

Label Objects
1 Orange Ping-pong ball
2 Green tennis

Color Detection

Label Color
1 Black(dark grey)
2 White(light grey)
3 Red
4 Yellow(orange)
5 Green
6 Cyan(blue-green)
7 Blue
8 Purple

Card Detection

Pattern Detection

Label Pattern
1 Tick
2 Cross
3 Circle
4 Square
5 Triangle

Traffic Sign Card

Label Traffic Sign
1 Go
2 Turn left
3 Turn right
4 Turn around
5 Stop

Number Card

Label Number
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
0 0

Output Mode and Address Selection

The sensor has two output modes: UART and I2C. Switch the output mode via DIP switch. (The DIP switch marked "Output" is for changing output mode.)

There are four addresses for the sensor to choose from 0x60-0x63. Address in the range is suitable for both output modes. Alter the address via DIP switch. (The DIP switch marked "Address" is for changing address.)

Select Output Mode

A 2-bits DIP switch is used to select signal output type, defined as the chart:

Bit 1 Wifi Switch Bit 2 Signal Output mode
0 Disable Wifi function * 0 UART
1 Enable Wifi function * 1 I2C
  1. Indicates that the function is not supported in the current version.
  2. Switch up for position 1, switch down for position 2.

Select Address

A 2-bits DIP switch is used to select device address, defined as the chart:

Bit 1 Bit 2 Address
0 0 0x60
0 1 0x61
1 0 0x62
1 1 0x63
  1. The MU sensor will respond to the 0x00 broadcast message sent from the host.
  2. Switch up for position 1, and switch down for position 2.

Was this article helpful?

TOP