Skip to main content

Questions tagged [hc-sr04]

For questions about the HC-SR04 ultrasonic ranging sensor.

Filter by
Sorted by
Tagged with
0 votes
1 answer
114 views

I am using a HC-SR04 ultrasonic sensor to measure the distance using an Arduino Uno. When I run this code which is worked perfectly in the previous, it only shows just random readings in the serial ...
Y_Jay's user avatar
  • 13
0 votes
1 answer
132 views

I'm trying to understand how HC-SR04 sensor works. I looked for detailed explanations online and read datasheets, but I still have a detail I don't get. If I understood correctly how the "trigger&...
Rocco Mantovani's user avatar
1 vote
1 answer
158 views

I’m making a smart car using an arduino uno, sensor shield v5, motor control with a L298N and a servo motor + HC-SR04 ultrasound sensor. I want to add a IR receiver on the board so I can also control ...
AugustinS's user avatar
1 vote
1 answer
920 views

I am working on an autonomous robot using two 4-pin stepper motors, HC-SR04 ultrasonic sensor, 2 L298N motor drivers (one for each motor), and an Arduino Uno. My problem is that when I use the stepper ...
Renier Jr.'s user avatar
-1 votes
1 answer
111 views

int trigPin = 10; const int echoPin = 8; int led = 7; const int distance = 200; void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(led, OUTPUT); } void loop() { ...
user90289's user avatar
1 vote
0 answers
216 views

I'm having problems using an HC-SR04 ultrasonic sensor in conjunction with an LED display module. The sensor appears to work fine when outputting values to the serial monitor, measuring distances up ...
Nicholas's user avatar
  • 111
0 votes
1 answer
148 views

I'm building a kind of pin ball machine, and I need to detect when the ball has hit the wall with the sensor attached. The ball will hit the wall with a small impact, not large enough to push a button ...
SJ19's user avatar
  • 111
0 votes
1 answer
797 views

Is there a limit for the connector distance between an arduino and a HC-SR04 ultrasonic sensor? I have a set-up for measuring a liquid's level in a tank. The benchtop version worked OK, but when I ...
Ken's user avatar
  • 103
1 vote
0 answers
68 views

I'm making a project based on HC-SR04 ultrasonic sensor with a stepper motor and an SG90 servo motor. I have done some conditions for my stepper motor that is given below. Now I want to include my ...
Toufiq's user avatar
  • 11
3 votes
1 answer
2k views

I am somewhat familiar with Arduino and am trying to use two ultrasonic HC-SR04 modules to measure the direction of water flow inside a pipe. The sensors are kept as in the image below. The direction ...
Aradhya Jain's user avatar
1 vote
0 answers
52 views

I asked a question about this last time but I still couldn't make it work but it somehow gave me an overview about my project. Now I've created an another project that is similar to the last one, the ...
Thomas Raymond Santos's user avatar
2 votes
1 answer
215 views

I used an HC-SR04 sensor and connected it to an Arduino board (BOARD1) with a 433 MHz transmitter, and the other board (BOARD2) is connected to the 433 MHz receiver. I don't know how to see the sensor ...
Thomas Raymond Santos's user avatar
1 vote
0 answers
266 views

I found a simple code online that meets my goal to almost 100%, however when I place my hand in front of it, the number continues to count. I am trying to only count "1" when the solid ...
Chris's user avatar
  • 11
1 vote
0 answers
62 views

Having trouble with arduino Ultrasonic Sensor Module HC-SR04 I'm sure when you read this you're going to say how stupid can he be and you're probably right but I'm 82 years old and I'm trying very ...
Dennis M Martin's user avatar
1 vote
0 answers
422 views

I have a problem in a project that I am working, basically I need to use a ESP-01 to receive the measurements from a HC-SR04 and send it to another ESP-01 (which I won't cover here). Basically my ESP ...
Danillo Lange's user avatar
1 vote
1 answer
3k views

I am currently working on an alarm system using multiple sensors and one arduino board and I am getting readings from 2 of the sensors but one gives a constant zero and a constant buzzer sound even ...
Wayne 254's user avatar
3 votes
1 answer
1k views

I am am trying to make a code which automatically controls relay on basis of ultrasonic sensor measurements. I am using a nodeMCU as a microcontroller rather than an arduino. The relay and the ...
Shubham Bajaj's user avatar
0 votes
1 answer
276 views

I am new to Arduino and just got this error after writing this code:The error message is pasted after the code. I am kindly requesting for assistance so that someone can help me understand why it isn'...
Wayne 254's user avatar
1 vote
0 answers
294 views

I wanted to make a buzzer go off when the distance measured by the ultrasonic sensor becomes more than 100cm. The things used in this project are a 4x4 keypad, an hc-sr04 ultrasonic sensor, and a ...
Abhi's user avatar
  • 31
0 votes
1 answer
65 views

I'm running a water pump based on ultra sonic readings. Once the Ultra Sonic Sensor reads > 10 cm , I want the water pump to start until sensor reads < 5 cm. Would you please help me adjust the ...
motion channel's user avatar
1 vote
1 answer
5k views

This is my code: int trigPin=13; //Sensor Trig pin connected to Arduino pin 13 int echoPin=11; //Sensor Echo pin connected to Arduino pin 11 float pingTime; //time for ping to travel from sensor to ...
python man's user avatar
0 votes
1 answer
338 views

first of all, Im from Cuba, that means I may have some problems to find parts... I have a little system to measure the water level in my house water tank. The system is pretty rough: a proximity ...
k.Cyborg's user avatar
  • 262
0 votes
2 answers
3k views

I'm using and ESP8266 with HC-SR04 ultrasonic sensor. The sensor requires 5v input and will also output to the GPIO pins at 5V. ESP8266 has a strong recommendation to use 3.3V into the GPIO pins. I'...
Yousuf's user avatar
  • 13
1 vote
0 answers
79 views

I'm trying to combine two scripts I've found. One to get my remote control model to work via a controller and the other to enable 6 ultrasound modules I have. When I omit the code highlighted in "THIS ...
Frank Warren's user avatar
1 vote
3 answers
2k views

I was wondering if I connect a HC-SR04 to an Arduino or any other microcontroller by normal cables, what would be the maximum length of this cable so that the measurements will still be true, and not ...
Mihnea Cristian Marin's user avatar
1 vote
0 answers
203 views

I want to build a systems that measures if some parking spots are occupied or not. I chose to use an ESP8266 12-E NodeMCU Kit with multiple HC-SR04 ultrasonic sensors. In my project, it is essential ...
Mihnea Cristian Marin's user avatar
0 votes
3 answers
3k views

My main goal is to use connect the HC-SR04 ultrasonic sensor with ESP8266. Problem is, HC-SR04 works with 5V while the ESP8266 works with 3.3V In order to solve this, idea would be to use a logical ...
3dprogramin's user avatar
1 vote
0 answers
36 views

I am trying to implement a bot which can sense obstacle in front, left or right and post detection send interrupts. Which in turn will perform the appropriate motor function to avoid these obsticles. ...
Abhishek's user avatar
2 votes
3 answers
634 views

So I just got into arduino and bought Elegoo's car robot v3 kit and built it, but when I put the robot on "object avoidance" it constantly spins as though there is an object in front of it. I tried ...
Jordan's user avatar
  • 21
0 votes
2 answers
397 views

Excuse my naivete in this as I am very new to Arduino and the programming of. I am trying to put together a project for stair lighting triggered by a ultrasonic sensor at the bottom of the stairs and ...
DapurDan's user avatar
1 vote
0 answers
1k views

Wondering if it's the sensor or the code? can anyone help? I've used the code here /* HC-SR04 Ultrasonic Sensor with LCD dispaly HC-SR04 Ultrasonic Sensor VCC to Arduino 5V GND to Arduino GND ...
Tanish's user avatar
  • 11
0 votes
1 answer
371 views

I have a parking guide using an ultrasonic sensor (HC-SR04), based on the instructions here. I'm trying to modify the code so that the Arduino goes to sleep after a certain period of inactivity (say, ...
Jim421616's user avatar
  • 188
-1 votes
1 answer
381 views

I have created a Bluetooth based smartphone controlled robot (a 4 wheel car) earlier using Arduino and an obstacle avoidance robot. Now, I wanted to combine both of them. So, I combined their ...
Naved THE Sheikh's user avatar
0 votes
1 answer
92 views

I am working on an obstacle avoiding robot. It uses an ultrasound sensor to avoid obstacles, but currently has trouble avoiding objects that are diagonal to it. Thus, i want to add a second ultrasound ...
Nick Heumann's user avatar
1 vote
2 answers
19k views

I followed this tutorial for a demo code for the SR04 ultrasonic distance sensor (without the LCD display). I've installed the Arduino IDE and wrote the code in it and saved it in some location. ...
Dame Lyngdoh's user avatar
0 votes
1 answer
766 views

I have implemented an HC-SR04 distance sensor using an Arduino. After power up, the sensor operates well when objects are within range of the sensor. However, if the distance to be measured exceeds ...
BitBanger46's user avatar
-1 votes
1 answer
427 views

How can I interface an ultrasonic sensor with a MCU with 3.3 V GPIO like the NodeMCU? I tried powering the sensor with both 5 V and 3.3 V from the MCU. Both failed to show any results as the distance ...
maheshmt's user avatar
0 votes
1 answer
528 views

Alright. This is what I wanted to do: Make a circuit and code the arduino such that there are 2 tactile switches, each with a predefined pwm value. Whenever any one button is pressed the led should ...
Kishore's user avatar
  • 35
0 votes
1 answer
437 views

I got a question regarding the ultrasound sensor (HC-SR04) connecting to the arduino. I have a project, and the space is really tight, so i will have to bend the pins of the HC-SR04. Is this okay to ...
user507237's user avatar
1 vote
1 answer
8k views

My Ultra sonic sensor (HC-SR04) is returning these types of values when it has nothing in front: Ping: 144cm Ping: 0cm Ping: 0cm Ping: 0cm Ping: 105cm Ping: 105cm Ping: 94cm Ping: 0cm Ping: 378cm ...
gpuguy's user avatar
  • 123
1 vote
1 answer
199 views

I appreciate the help of this forum very much and it`s my first time to ask you experts befor driving crazy... ArduinoUno and SDcard-BreakOutboard and DistanceSensor HC-SR04 are not working well ...
Rob's user avatar
  • 13
1 vote
0 answers
163 views

I have a HC-SR04 connected to my Arduino. its all working very nice. Yet with a constant interval a weird value appears (see the Serial Plot picture). I am wondering what causes this. I will soon ...
Anton van der Wel's user avatar
0 votes
1 answer
1k views

I'm experimenting with an HC-SR04 sonar sensor. Basically I'm measuring the distance to a cardboard box twice a second with these lines of code running on an ESP32: unsigned long sonarMeasure() { ...
Falko's user avatar
  • 103
0 votes
2 answers
730 views

I am working on a project which uses a set of sensors (HC-SR04). These sensors use pins 2 to 13 of the Arduino Uno. Here you can find the board: . I also want to add an MP3 shield (VS1053B) to it ...
Majid Hojati's user avatar
2 votes
3 answers
10k views

I am extremely new to Arduino and electrical engineering, and the project I am attempting involves a ultrasonic sensor. I am using the HC-SR04 with the Elegoo Mega2560 Arduino board. A few days ago ...
cr5519's user avatar
  • 23
1 vote
1 answer
445 views

void setup () pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(LED_Blue_pin, OUTPUT); pinMode(LED_White_pin, OUTPUT); Serial.begin(9600); digitalWrite(LED_Blue_pin, LOW); digitalWrite(...
Mecha hornbill's user avatar
1 vote
2 answers
5k views

I have bought a NodeMCU (1.0) and a JSN-SR04T waterproof ultrasonic sensor compatible with HC-SR04. If I upload my program to NodeMCU it works but sometimes it measures a wrong distance - it is an ...
Dániel Kis's user avatar
2 votes
0 answers
253 views

I have an project which control a heat exchanger. I read 4 temperature sensors DS18B20, a distance with HC-SR04 Ultrasonic Sensor, and a flow with YF-S201 (with attach interrupt). I can turn on and ...
FelipeFonsecabh's user avatar
2 votes
1 answer
295 views

I recently started a project with HC-SR04 sensors and RTC DS1302 clock. The idea is when a sensor detects an object, call and keep a timestamp (hh:mm:ss) all over the loop until Else If{} appears, ...
MGL1080's user avatar
  • 21
2 votes
2 answers
5k views

I am doing a watch with GPS tracker project. I am using an Ultrasonic HC-SR04 sensor. I don't know where to connect the Echo and trig pins with my Arduino. Please let me know how to connect it.
Nurul Nazerah's user avatar