

The US100 is a high-performance ultrasonic sensor designed for precise distance measurement and object detection. It operates by emitting ultrasonic waves and calculating the time taken for the echo to return, enabling accurate distance calculations. The US100 is versatile and can operate in both UART (serial) and PWM modes, making it suitable for a wide range of applications.








Below are the key technical details of the US100 ultrasonic sensor:
| Parameter | Value |
|---|---|
| Operating Voltage | 2.4V to 5.5V |
| Operating Current | ≤ 2mA |
| Measuring Range | 2cm to 450cm |
| Measuring Accuracy | ±0.3cm |
| Operating Modes | UART (serial) and PWM |
| Communication Protocol | UART: 9600 baud rate |
| Working Temperature | -20°C to 70°C |
| Dimensions | 45mm x 20mm x 15mm |
The US100 sensor has four pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply pin (2.4V to 5.5V) |
| 2 | Trig/TX | Trigger pin for PWM mode / TX pin for UART mode |
| 3 | Echo/RX | Echo pin for PWM mode / RX pin for UART mode |
| 4 | GND | Ground connection |
The US100 can operate in two modes: UART (serial communication) and PWM (pulse width modulation). Below are instructions for using the sensor in each mode.
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial us100(10, 11); // RX = 10, TX = 11
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
us100.begin(9600); // Initialize US100 communication
Serial.println("US100 Sensor Initialized");
}
void loop() {
us100.write(0x55); // Send measurement command to US100
delay(100); // Wait for the response
if (us100.available() >= 2) { // Check if data is available
int highByte = us100.read(); // Read high byte of distance
int lowByte = us100.read(); // Read low byte of distance
int distance = (highByte << 8) + lowByte; // Combine bytes into distance
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" mm");
}
delay(500); // Wait before next measurement
}
#define TRIG_PIN 9 // Define Trig pin
#define ECHO_PIN 8 // Define Echo pin
void setup() {
Serial.begin(9600); // Initialize Serial Monitor
pinMode(TRIG_PIN, OUTPUT); // Set Trig pin as output
pinMode(ECHO_PIN, INPUT); // Set Echo pin as input
Serial.println("US100 Sensor Initialized");
}
void loop() {
digitalWrite(TRIG_PIN, LOW); // Ensure Trig pin is LOW
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH); // Send 10µs HIGH pulse
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
// Measure the duration of the HIGH pulse on Echo pin
long duration = pulseIn(ECHO_PIN, HIGH);
// Calculate distance in cm (duration / 58 = distance in cm)
float distance = duration / 58.0;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(500); // Wait before next measurement
}
No response from the sensor in UART mode:
Incorrect distance readings in PWM mode:
Unstable or fluctuating readings:
Sensor not working at all:
Q: Can the US100 measure distances below 2cm?
A: No, the minimum measurable distance is 2cm. Objects closer than this may not be detected accurately.
Q: What is the maximum range of the US100?
A: The US100 can measure distances up to 450cm under ideal conditions.
Q: Can the US100 operate in both UART and PWM modes simultaneously?
A: No, the sensor operates in either UART or PWM mode, depending on how it is connected.
Q: Is the US100 waterproof?
A: No, the US100 is not waterproof. For outdoor or wet environments, consider using a waterproof ultrasonic sensor.
Q: Can the US100 be used with a 3.3V microcontroller?
A: Yes, the US100 operates within a voltage range of 2.4V to 5.5V, making it compatible with 3.3V systems.