APM Ultrasonic Distance Measuring Sensor (20 - 720cm) - GY-US42

  • RM60.00

  • Product Code: GY-US42
  • Availability: In Stock

 

It is a GY-US42 ultrasonic sensor module.The module can be adapted to different working environments and directly connected to the microcontroller.A USB to TTL module connection is required when connecting to a computer.IIC mode can directly connect with APM,Pixhawk,and other flight controllers.
 
Applications
  • Smart robot
  • Teaching laboratory equipment
  • Production line product testing
  • Quadrocopter
  • Human body measurement
  • Intelligent car
 
Features
  • Built-in precise algorithms
  • Ultrasonic non-contact measurement
  • Test distance up to 720cm
  • It supports IIC, serial, and PWM communication formats.
  • Small power consumption,small size and easy installation.

Specifications
  • Working Voltage: 3V ~ 5V DC
  • Working Current: 9mA
  • Resolution: 1cm
  • Response Frequency: 15Hz
  • Measuring Range: 20cm ~ 720cm
  • Work Temperature: -20℃~65℃
  • Storage Temperature: -40℃~85℃
  • Work Humidity: 5%~95%RH
  • Size: 35 x 23 x 28mm

Pins

  • VCC
  • GND
  • CR,serial port USART_RX/IIC_SCL/Trig
  • DT,serial port USART_TX/IIC_SDA/Echo
  • INT,measurement status
  • PS,serial port/IIC/pulse mode conversion (default=IIC mode)
    • PS pin hardware selection module working mode
    • PS is left unconnected (default):IIC mode,Pin3(CR)=SCL,Pin4(DT)=SDA,Pin5 is INT status pin
    • PS to VCC(PS=H):Serial UART mode,Pin3 (CR)=RX,Pin4 (DT)=TX,TTL level
    • Connect PS to GND (PS=L):Pulse PWM mode,Pin3 (CR)=Trig trigger pin,Pin4 (DT)=Echo echo pin

 

Communication Protocol and Operation Steps:

5.1. Serial communication parameters: 9600,N,8,1/115200,N,8,1(default baud rate is 9600bps)

5.2. Module output format: Each frame contains 8-13 bytes (hexadecimal):

  • Byte0:0x5A,frame header flag
  • Byte1:0x5A,frame header flag
  • Byte2:0x45,this frame data type(represents that this frame data is distance data)
  • Byte3:0x02,the amount of data
  • Byte4:0x00~0xFF,the first 8 bits of data
  • Byte5:0x00~0xFF,lower 8 bits before the data
  • Byte6:0x00~0xFF,checksum (the previous data is accumulated and only the lower 8 bits are left)

5.3. Distance length calculation method:

  • Distance=(Byte3<<8)|Byte4 (cm)

5.4. Serial command command:

  • Command format: 0xA5+command+command+sum checksum
  • Sum checksum=sum of the first three data, take the lower 8 bits

5.5 .Output mode setting instruction:

  • 0xA5+0x55+0x15+0x0F:Query IIC address
  • 0xA5+0x56+0x01+0xFC:Query output distance data
  • 0xA5+0x56+0x02+0xFD:Continuous output distance data, about 10hz (default)

5.6. IIC address setting instruction:

  • 0xA5+0x57+addr+sum:addr is the IIC 8-bit address, the lowest bit must be 0

5.7. Baud rate configuration:

  • 0xA5+0x58+0xAE+0XAB:9600 (default)
  • 0xA5+0x58+0xAF+0XAC:115200

5.8. Save/restore configuration:

  • 0xA5+0x5A+0x01+0X00:Save output configuration,IIC address, baud rate configuration
  • 0xA5+0x5A+0x02+0X01:Restore factory settings, restore IIC address, baud rate

5.9. Operation steps in serial mode:

  • Use USB to TTL module or MCU to connect with GY-US42 module
  • TX-RX,RX-TX, the wiring method is cross connection.
  • The GY-US42 module defaults to automatic output. The TX pin sends data. You can get data directly on the serial port. For the format, refer to the communication protocol.
  • For other operations, you can refer to the protocol to send corresponding instructions.

 

Write a review

Note: HTML is not translated!
    Bad           Good

 

Related Products

Tags: Ultrasonic