Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Grove ultrasonic sensor seeed: Examples, Pinouts, and Specs

Image of Grove ultrasonic sensor seeed
Cirkit Designer LogoDesign with Grove ultrasonic sensor seeed in Cirkit Designer

Introduction

The Grove Ultrasonic Sensor from Seeed is a versatile distance-measuring device that operates using ultrasonic waves. It emits a high-frequency sound wave and calculates the time it takes for the echo to return, enabling precise distance measurements. This sensor is widely used in applications such as robotics, obstacle detection, proximity sensing, and automation systems. Its plug-and-play design, compatible with the Grove ecosystem, makes it an excellent choice for both beginners and advanced users.

Explore Projects Built with Grove ultrasonic sensor seeed

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Mega 2560 Bluetooth-Controlled Ultrasonic Distance Measurement
Image of circuitcycle: A project utilizing Grove ultrasonic sensor seeed in a practical application
This circuit features an Arduino Mega 2560 microcontroller interfaced with an HC-05 Bluetooth Module and an HC-SR04 Ultrasonic Sensor. The HC-05 is powered by the Arduino's VIN pin and is grounded to the Arduino's GND, enabling wireless communication capabilities. The HC-SR04 is powered by the Arduino's 5V output and uses two digital PWM pins (D7 for TRIG and D6 for ECHO) to measure distances via ultrasonic waves.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Controlled Ultrasonic Distance Measurement
Image of Ultrasonic sensore : A project utilizing Grove ultrasonic sensor seeed in a practical application
This circuit connects an HC-SR04 Ultrasonic Sensor to an ESP8266 NodeMCU microcontroller. The ESP8266's D1 and D2 pins are used to trigger the sensor and receive the echo signal, respectively, allowing the microcontroller to measure distance by timing the echo return. The sensor and the microcontroller share a common ground and are powered from the microcontroller's VIN pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental and Location Monitoring System
Image of TankSafe: A project utilizing Grove ultrasonic sensor seeed in a practical application
This circuit features an ESP32 microcontroller connected to an HC-SR04 ultrasonic sensor, a DHT22 temperature and humidity sensor, and a GPS NEO 6M module. The ESP32 uses its GPIO pins to trigger and read the ultrasonic sensor, communicate with the GPS module via serial communication (TX2/RX2), and interface with the DHT22 sensor for environmental data. All components share a common ground and are powered by the ESP32's 3.3V output, indicating a unified power scheme within the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Ultrasonic Distance Measurement with GPS Location and Servo Control
Image of Rail Guard: A project utilizing Grove ultrasonic sensor seeed in a practical application
This circuit features an Arduino UNO microcontroller connected to an HC-SR04 ultrasonic sensor, a Tower Pro SG90 servo motor, and a GPS NEO 6M module. The ultrasonic sensor's ECHO and TRIG pins are interfaced with the Arduino's digital pins for distance measurement, while the servo motor is controlled via another digital pin. The GPS module communicates with the Arduino through serial pins, and two LEDs with series resistors are connected to digital pins for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Grove ultrasonic sensor seeed

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of circuitcycle: A project utilizing Grove ultrasonic sensor seeed in a practical application
Arduino Mega 2560 Bluetooth-Controlled Ultrasonic Distance Measurement
This circuit features an Arduino Mega 2560 microcontroller interfaced with an HC-05 Bluetooth Module and an HC-SR04 Ultrasonic Sensor. The HC-05 is powered by the Arduino's VIN pin and is grounded to the Arduino's GND, enabling wireless communication capabilities. The HC-SR04 is powered by the Arduino's 5V output and uses two digital PWM pins (D7 for TRIG and D6 for ECHO) to measure distances via ultrasonic waves.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Ultrasonic sensore : A project utilizing Grove ultrasonic sensor seeed in a practical application
ESP8266 NodeMCU Controlled Ultrasonic Distance Measurement
This circuit connects an HC-SR04 Ultrasonic Sensor to an ESP8266 NodeMCU microcontroller. The ESP8266's D1 and D2 pins are used to trigger the sensor and receive the echo signal, respectively, allowing the microcontroller to measure distance by timing the echo return. The sensor and the microcontroller share a common ground and are powered from the microcontroller's VIN pin.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TankSafe: A project utilizing Grove ultrasonic sensor seeed in a practical application
ESP32-Based Environmental and Location Monitoring System
This circuit features an ESP32 microcontroller connected to an HC-SR04 ultrasonic sensor, a DHT22 temperature and humidity sensor, and a GPS NEO 6M module. The ESP32 uses its GPIO pins to trigger and read the ultrasonic sensor, communicate with the GPS module via serial communication (TX2/RX2), and interface with the DHT22 sensor for environmental data. All components share a common ground and are powered by the ESP32's 3.3V output, indicating a unified power scheme within the circuit.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rail Guard: A project utilizing Grove ultrasonic sensor seeed in a practical application
Arduino UNO Based Ultrasonic Distance Measurement with GPS Location and Servo Control
This circuit features an Arduino UNO microcontroller connected to an HC-SR04 ultrasonic sensor, a Tower Pro SG90 servo motor, and a GPS NEO 6M module. The ultrasonic sensor's ECHO and TRIG pins are interfaced with the Arduino's digital pins for distance measurement, while the servo motor is controlled via another digital pin. The GPS module communicates with the Arduino through serial pins, and two LEDs with series resistors are connected to digital pins for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

  • Model: Grove Ultrasonic Ranger
  • Operating Voltage: 3.3V to 5V DC
  • Operating Current: ≤15 mA
  • Measuring Range: 3 cm to 350 cm
  • Accuracy: ±2 mm
  • Ultrasonic Frequency: 40 kHz
  • Interface: Grove 4-pin (digital)
  • Dimensions: 50 mm x 25 mm x 16 mm

Pin Configuration and Descriptions

The Grove Ultrasonic Sensor uses a 4-pin Grove connector. Below is the pin configuration:

Pin Name Description
1 VCC Power supply (3.3V to 5V DC)
2 TRIG Trigger pin to send ultrasonic pulses
3 ECHO Echo pin to receive the reflected signal
4 GND Ground connection

Usage Instructions

How to Use the Component in a Circuit

  1. Connect the Sensor:

    • Use a Grove Base Shield to connect the sensor to an Arduino or other microcontroller.
    • Plug the Grove cable into the sensor and connect it to a digital port on the Base Shield (e.g., D7).
  2. Power the Circuit:

    • Ensure the microcontroller is powered with a 3.3V or 5V supply, as required by the sensor.
  3. Trigger and Read Data:

    • The microcontroller sends a HIGH signal to the TRIG pin for 10 microseconds to emit an ultrasonic pulse.
    • The sensor measures the time it takes for the echo to return and calculates the distance.

Important Considerations and Best Practices

  • Ensure there are no obstructions between the sensor and the target object for accurate readings.
  • Avoid using the sensor in environments with excessive noise or vibrations, as these can interfere with the ultrasonic signal.
  • The sensor works best when the target object has a flat, hard surface for reflecting the ultrasonic waves.
  • Use a decoupling capacitor (e.g., 10 µF) across the power supply pins to reduce noise.

Example Code for Arduino UNO

Below is an example Arduino sketch to use the Grove Ultrasonic Sensor with an Arduino UNO:

// Grove Ultrasonic Sensor Example Code
// This code measures the distance to an object using the Grove Ultrasonic Sensor
// and prints the result to the Serial Monitor.

#define TRIG_PIN 7  // Define the TRIG pin connected to D7
#define ECHO_PIN 8  // Define the ECHO pin connected to D8

void setup() {
  pinMode(TRIG_PIN, OUTPUT); // Set TRIG pin as output
  pinMode(ECHO_PIN, INPUT);  // Set ECHO pin as input
  Serial.begin(9600);        // Initialize serial communication at 9600 baud
}

void loop() {
  // Send a 10-microsecond pulse to the TRIG pin
  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  // Measure the duration of the echo pulse
  long duration = pulseIn(ECHO_PIN, HIGH);

  // Calculate the distance in centimeters
  float distance = duration * 0.034 / 2;

  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  delay(500); // Wait for 500 milliseconds before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Distance Reading:

    • Cause: Incorrect wiring or loose connections.
    • Solution: Double-check the Grove cable connections and ensure the sensor is properly connected to the Base Shield.
  2. Inaccurate Measurements:

    • Cause: Target object is too small, soft, or angled.
    • Solution: Use a larger, flat, and hard surface for better ultrasonic reflection.
  3. Sensor Not Responding:

    • Cause: Insufficient power supply or damaged sensor.
    • Solution: Verify the power supply voltage and current. Replace the sensor if necessary.
  4. Interference from Nearby Sensors:

    • Cause: Multiple ultrasonic sensors operating simultaneously.
    • Solution: Use only one sensor at a time or ensure sufficient spacing between sensors.

FAQs

  • Q: Can the sensor detect transparent objects?
    A: No, the sensor may struggle to detect transparent or highly absorbent materials like glass.

  • Q: What is the maximum range of the sensor?
    A: The sensor can measure distances up to 350 cm under ideal conditions.

  • Q: Can I use this sensor with a Raspberry Pi?
    A: Yes, the sensor can be used with a Raspberry Pi, but you may need additional libraries or GPIO handling code.

  • Q: How do I reduce noise in the readings?
    A: Use a decoupling capacitor across the power supply and average multiple readings in your code.

This documentation provides all the necessary details to get started with the Grove Ultrasonic Sensor from Seeed. Happy building!