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

How to Use ajsr04: Examples, Pinouts, and Specs

Image of ajsr04
Cirkit Designer LogoDesign with ajsr04 in Cirkit Designer

Introduction

The AJSR04 is an ultrasonic distance sensor designed to measure distances by emitting ultrasonic waves and calculating the time it takes for the echo to return. This sensor is widely used in robotics, automation, and IoT applications for tasks such as obstacle detection, distance measurement, and object tracking. Its compact design and reliable performance make it a popular choice for both hobbyists and professionals.

Explore Projects Built with ajsr04

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 101-Based Obstacle Avoidance Robot with Ultrasonic Sensor and Bluetooth Control
Image of car: A project utilizing ajsr04 in a practical application
This circuit is a robotic system controlled by an Arduino 101, featuring an ultrasonic sensor for obstacle detection, an IR receiver for remote control, and a Bluetooth module for wireless communication. It drives four hobby gear motors via an L293D motor driver and includes a micro servo for scanning. The system is powered by a 7V battery, with a TP4056 module for solar cell-based charging.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled Obstacle Avoiding Robot with Ultrasonic Sensor and L298N Motor Driver
Image of مشروع مركبة ذاتية تتفادى الحواجز: A project utilizing ajsr04 in a practical application
This is a mobile robot platform controlled by an Arduino UNO with a sensor shield. It uses an HC-SR04 ultrasonic sensor for obstacle detection and a servo motor for directional control. The robot's movement is powered by gearmotors controlled by an L298N motor driver, and it is designed to navigate by avoiding obstacles detected by the ultrasonic sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled Ultrasonic Sensor with Servo and Dual Motor Driver
Image of obstacle avoiding car diagram: A project utilizing ajsr04 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an HC-SR04 ultrasonic sensor for distance measurement, two hobbyist DC motors driven by an L298N motor driver, and a servomotor (SG90). The motors and servomotor are controlled by the Arduino, which is powered by a 4.5V battery through a rocker switch. The circuit is likely designed for a small robotic vehicle with obstacle detection and steering capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Ultrasonic Distance Measurement with TM1637 Display
Image of UNDERWATER SENSOR: A project utilizing ajsr04 in a practical application
This circuit is designed to measure distance using the JSN-SR04T ultrasonic sensor and display the measured value on a TM1637 4-digit 7-segment display. The Arduino UNO serves as the central controller, running code to operate the sensor, calculate the distance, and update the display. The sensor's TRIG and ECHO pins are connected to digital pins D12 and D11 of the Arduino, respectively, while the display's CLK and DIO pins are connected to digital pins D3 and D4, with both the sensor and display sharing power and ground connections with the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ajsr04

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 car: A project utilizing ajsr04 in a practical application
Arduino 101-Based Obstacle Avoidance Robot with Ultrasonic Sensor and Bluetooth Control
This circuit is a robotic system controlled by an Arduino 101, featuring an ultrasonic sensor for obstacle detection, an IR receiver for remote control, and a Bluetooth module for wireless communication. It drives four hobby gear motors via an L293D motor driver and includes a micro servo for scanning. The system is powered by a 7V battery, with a TP4056 module for solar cell-based charging.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of مشروع مركبة ذاتية تتفادى الحواجز: A project utilizing ajsr04 in a practical application
Arduino-Controlled Obstacle Avoiding Robot with Ultrasonic Sensor and L298N Motor Driver
This is a mobile robot platform controlled by an Arduino UNO with a sensor shield. It uses an HC-SR04 ultrasonic sensor for obstacle detection and a servo motor for directional control. The robot's movement is powered by gearmotors controlled by an L298N motor driver, and it is designed to navigate by avoiding obstacles detected by the ultrasonic sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of obstacle avoiding car diagram: A project utilizing ajsr04 in a practical application
Arduino-Controlled Ultrasonic Sensor with Servo and Dual Motor Driver
This circuit features an Arduino UNO microcontroller interfaced with an HC-SR04 ultrasonic sensor for distance measurement, two hobbyist DC motors driven by an L298N motor driver, and a servomotor (SG90). The motors and servomotor are controlled by the Arduino, which is powered by a 4.5V battery through a rocker switch. The circuit is likely designed for a small robotic vehicle with obstacle detection and steering capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of UNDERWATER SENSOR: A project utilizing ajsr04 in a practical application
Arduino UNO Based Ultrasonic Distance Measurement with TM1637 Display
This circuit is designed to measure distance using the JSN-SR04T ultrasonic sensor and display the measured value on a TM1637 4-digit 7-segment display. The Arduino UNO serves as the central controller, running code to operate the sensor, calculate the distance, and update the display. The sensor's TRIG and ECHO pins are connected to digital pins D12 and D11 of the Arduino, respectively, while the display's CLK and DIO pins are connected to digital pins D3 and D4, with both the sensor and display sharing power and ground connections with the Arduino.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Obstacle detection in robotics
  • Distance measurement in automation systems
  • Parking assistance systems
  • Liquid level measurement
  • Proximity sensing in IoT devices

Technical Specifications

The AJSR04 sensor operates by sending ultrasonic pulses at a frequency of 40 kHz and measuring the time it takes for the echo to return. Below are the key technical details:

Parameter Value
Operating Voltage 5V DC
Operating Current 15 mA (typical)
Measuring Range 2 cm to 400 cm
Accuracy ±3 mm
Operating Frequency 40 kHz
Trigger Input Signal 10 µs TTL pulse
Echo Output Signal TTL pulse proportional to distance
Dimensions 45 mm x 20 mm x 15 mm

Pin Configuration

The AJSR04 has four pins, as described in the table below:

Pin Name Description
1 VCC Power supply pin (5V DC)
2 Trig Trigger pin: Input a 10 µs TTL pulse to initiate measurement
3 Echo Echo pin: Outputs a TTL pulse proportional to the distance
4 GND Ground connection

Usage Instructions

Connecting the AJSR04 to a Circuit

  1. Power Supply: Connect the VCC pin to a 5V DC power source and the GND pin to ground.
  2. Trigger Signal: Use a microcontroller (e.g., Arduino) to send a 10 µs TTL pulse to the Trig pin.
  3. Echo Signal: Read the Echo pin to measure the duration of the returned pulse. The duration is proportional to the distance of the object.

Calculating Distance

The distance can be calculated using the formula: [ \text{Distance (cm)} = \frac{\text{Pulse Duration (µs)}}{58} ] This formula accounts for the speed of sound in air (approximately 343 m/s).

Example: Using AJSR04 with Arduino UNO

Below is an example Arduino sketch to measure distance using the AJSR04:

// Define pins for the AJSR04 sensor
const int trigPin = 9; // Trigger pin connected to digital pin 9
const int echoPin = 10; // Echo pin connected to digital pin 10

void setup() {
  pinMode(trigPin, OUTPUT); // Set the trigger pin as an output
  pinMode(echoPin, INPUT);  // Set the echo pin as an input
  Serial.begin(9600);       // Initialize serial communication at 9600 baud
}

void loop() {
  // Send a 10 µs pulse to the Trig pin
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Measure the duration of the pulse on the Echo pin
  long duration = pulseIn(echoPin, HIGH);

  // Calculate the distance in cm
  float distance = duration / 58.0;

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

  delay(500); // Wait for 500 ms before the next measurement
}

Best Practices

  • Ensure the sensor is mounted securely to avoid vibrations that may affect accuracy.
  • Avoid placing the sensor near ultrasonic noise sources, such as other ultrasonic sensors or motors.
  • Use a decoupling capacitor (e.g., 10 µF) across the VCC and GND pins to stabilize the power supply.

Troubleshooting and FAQs

Common Issues

  1. No Output from Echo Pin

    • Cause: The Trig pin is not receiving a proper 10 µs pulse.
    • Solution: Verify the microcontroller code and ensure the Trig pin is correctly connected.
  2. Inaccurate Distance Measurements

    • Cause: Interference from nearby objects or incorrect formula usage.
    • Solution: Ensure the sensor has a clear line of sight to the target object and use the correct distance formula.
  3. Sensor Not Responding

    • Cause: Insufficient power supply or loose connections.
    • Solution: Check the power supply voltage and ensure all connections are secure.

FAQs

Q: Can the AJSR04 detect transparent objects?
A: The AJSR04 may struggle to detect transparent objects like glass due to poor ultrasonic wave reflection.

Q: What is the maximum range of the AJSR04?
A: The maximum range is 400 cm (4 meters), but accuracy may decrease at longer distances.

Q: Can I use the AJSR04 with a 3.3V microcontroller?
A: The AJSR04 requires a 5V power supply, but the Trig and Echo pins can often be interfaced with 3.3V logic using a level shifter.

By following this documentation, users can effectively integrate the AJSR04 ultrasonic sensor into their projects for reliable distance measurement and obstacle detection.