US-100 Ultrasonic Distance Sensor Module

55,00 DH 65,00 DH

Availability:

371 in stock

SKU: 0123-C Categories: ,

Description

US-100 Ultrasonic Distance Sensor Module

The US-100 measures distance using reflected ultrasonic waves. The source describes temperature compensation, pulse-width output and serial UART output. It states that the module can operate from 2.4–5.5 V and has an idle current below 2 mA.

Operating modes

Connect VCC and GND to a 2.4–5.5 V supply. Select the mode using the jumper on the back: with the jumper installed, the module returns binary serial data; with it removed, the module outputs a pulse whose width represents distance.

UART mode

Install the jumper. Connect Trig/TX to the microcontroller TX line and Echo/RX to RX. Configure serial communication for 9600 baud, 8 data bits, no parity and 1 stop bit (8-N-1). Send byte 0x55 and read two bytes, high byte first. Calculate distance in millimetres as first byte × 256 + second byte. For the source-listed temperature reading, send 0x50 and read one byte; calculate °C as byte − 45.

Pulse-width mode

Remove the jumper. Connect Trig/TX to a microcontroller output and Echo/RX to an input. Hold Trig/TX high for at least 50 µs, then set it low to trigger a measurement. Measure the high pulse width on Echo/RX. The source gives this calculation: millimetres = pulse width × 34 / 100 / 2.

Specifications stated by the source

  • Supply: 2.4–5.5 V; current: under 2 mA.
  • Operating frequency: 40 kHz; detection angle: under 15 degrees.
  • Measurement range: 2–450 cm; stated accuracy: 0.3 cm + 1%.
  • Output: trigger/echo pulse mode or UART at 9600 baud.
  • Dimensions: 45 × 20 mm; weight: 9 g.

Listed applications include robotic obstacle avoidance, presence detection, distance measurement and monitoring, and industrial object detection.

Arduino Uno pulse-mode example

Components: US-100, Arduino Uno, jumper wires and breadboard. The following source code uses trigger/echo pulse mode:

#define TRIG_PIN 2
#define ECHO_PIN 3
long duration;
int distance;

void setup() {
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
Serial.begin(9600);
}

void loop() {
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
duration = pulseIn(ECHO_PIN, HIGH);
distance = duration / 29 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(1000);
}

Basic code and wiring

  1. TRIG_PIN is configured as output and ECHO_PIN as input.
  2. A 10 µs pulse triggers the ultrasonic burst.
  3. pulseIn() measures the echo duration.
  4. The example calculates centimetres by dividing the duration by 29 and then by 2.
  • Trig to Arduino pin 2; Echo to pin 3.
  • VCC to 5V; GND to GND.

Arduino Uno example with I2C 1602 LCD

Components: US-100, Arduino Uno, I2C 1602 LCD, jumper wires and breadboard.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>


#define TRIG_PIN 2
#define ECHO_PIN 3
long duration;
int distance;


LiquidCrystal_I2C lcd(0x27, 16, 2);


void setup() {
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  lcd.begin();
  lcd.backlight();
  Serial.begin(9600);
}


void loop() {
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);
  duration = pulseIn(ECHO_PIN, HIGH);
  distance = duration / 29 / 2;
  lcd.setCursor(0, 0);
  lcd.print("Distance: ");
  lcd.print(distance);
  lcd.print(" cm");
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  delay(1000);
}

The example uses Wire and LiquidCrystal_I2C, measures distance in the main loop and displays the result on the LCD and serial monitor. Wire Trig to pin 2, Echo to pin 3, VCC to 5V and GND to GND; connect LCD SDA to A4 and SCL to A5 on Arduino Uno.

Install the LCD library

  1. Open Arduino IDE.
  2. Choose Sketch > Include Library > Manage Libraries.
  3. Search for “LiquidCrystal_I2C” and install the library by Frank de Brabander.

Comparison with HC-SR04 (figures from the source)

  • Supply: HC-SR04 listed at 5 V; US-100 at 2.4–5.5 V.
  • Current: HC-SR04 about 15 mA; US-100 under 2 mA.
  • Range: HC-SR04 2–400 cm; US-100 2–450 cm.
  • Outputs: HC-SR04 trigger/echo; US-100 trigger/echo or UART at 9600 baud, with distance returned in millimetres.
  • The source claims temperature compensation for US-100 and not for HC-SR04.

The source’s Arduino sketches demonstrate pulse mode, not the UART protocol. Check the jumper position, wiring and controller logic-voltage limits before use. Ultrasonic readings vary with target shape, surface, angle and environment; do not treat the stated range or accuracy as guaranteed for every target.

Thank you for your loyalty!

EN