Questions tagged [arduino-ultra-sonic]

85 questions
5
votes
2 answers

Arduino Ultra Sonic Sensor always returns 0

I am doing a basic project in Arduino UNO connecting an Ultra Sonic sensor (HC-SR04) which should print in the serial monitor the distance of the closest object but it always print 0. This is my code: long distance; long time; void setup(){ …
ianaya89
  • 4,153
  • 3
  • 26
  • 34
4
votes
1 answer

flowmeter using two ultrasonic with arduino

I'm working on a project which consists of two ultrasonic, LCD and Arduino. ultrasonic is also used for flow rate measurements. the concept behind that is to send waves by first ultrasonic to the second, calculate the time1. next, send waves from…
Majazen ـG
  • 139
  • 1
  • 2
  • 8
3
votes
0 answers

My code for controlling Sonor sensor(ultrasonic sensor) with python is not working

I want to control my ultrasonic sensor on arduino uno board with python, but I get an error that says that async and zerojson files are invalid. I have tried instaling the following files but the async is not compatible with my version of pycharm…
coder
  • 109
  • 1
  • 1
  • 6
3
votes
1 answer

Weird behaviour in Arduino loop

I'm creating a distance measurement system in Arduino (Mega2560 board, Arduino 1.8.9, JSN-SR04T-2.0 ultrasonic sensor). As the sensor is not very stable, I want to average 15 measurements or the measured values every 500 milliseconds, whichever…
balu
  • 111
  • 1
  • 8
3
votes
1 answer

Two Ultrasonic sensors on Raspberry Pi with Python script

I am working on a Raspberry Pi project with two ultrasonic sensors. But now I have a problem with the python script. The print() function at the end always tells me 0.0cm distance even if I hover with my hand over the sensor If I unplug the Sensor…
WeSt
  • 889
  • 5
  • 14
  • 32
2
votes
1 answer

ROS - problem adding ultrasonic data to range_sensor_layer

I need some help with a problem I encountered while adding ultrasonic sensors to a robot (loosely based on Linorobot), already equipped with an RPlidar. Hw/Sw: Raspi3B w/ Ubuntu 16.04.6 LTS, ROS kinetic, a Teensy, 2 Nano. The robot was working fine…
2
votes
1 answer

Multiple Ultrasonic sensors with Arduino

I'm trying to create a robot using three HC-SR04 ultrasonic sensors and my Arduino Pro Mini but I've run into a few problems. In short the robot's function is as follows: The robot is dual wheeled, with an H-bridge (SN754410) driving each…
user7384236
  • 21
  • 1
  • 2
1
vote
1 answer

longer distance ultrasonic LabVIEW

I'm reading the distance with Arduino ultrasonic kit. i want to show the longest distance during the session. i used shift register to have a previous value then I compared them with new the new one, but I think my algorithm is wrong. Thanks for…
1
vote
1 answer

Why ultrasonic sensor just output 0 in Arduino?

I have developed a code to get distance using an Ultrasonic Sensor. But it doesn't seem to work. It just output 0. Here's the code. `#include void setup() { Serial.begin(9600); } void loop() { int dist =…
1
vote
1 answer

how to set servo to rotate only once in 1 condition

I want to make a gate using 360 servo and ultrasonic sensor, here I use if else. when ultrasonic conditions >= 10 cm the servo should rotate one time to the right for 5 seconds, and vice versa. but when it reaches the condition >= 10 cm where the…
1
vote
0 answers

Connect Ultrasonic Sensor to Jetson Xavier NX

I have a Jetson Xavier NX Board. I need to interface the ultrasonic sensor. I used Jetson.GPIO lib to communicate through GPIO but I'm not getting any data from Jetson. I believe the GPIO pin is not powering up which shows 0V after making it…
1
vote
2 answers

I want the program to loop every time the sensor detects anything in 15cm

This is the code: def check_ultra(): global arduinoSerialData, y, i, x while True: if arduinoSerialData.inWaiting() > 1: myData = arduinoSerialData.readline() myData = str(myData) myData =…
1
vote
0 answers

How to stop LED from lighting up above distance with arduino?

How do I light up the LED on the Arduino ONLY when the distance is below 7 feet (213 cm)? When I run the program, the LED stays lit up even after an object has moved away from it. Here is my Arduino…
Batchguy
  • 27
  • 12
1
vote
1 answer

Arduino Ultrasonic Distance Sensor with Passive Buzzer to achieve different tones

I have an Ultrasonic Distance Sensor with Passive Buzzer. The passive buzzer was set up with different tones. The buzzer will keep playing until the Ultrasonic Distance Sensor detect any obstruction items. However, the Arduino couldn't compile the…
Shaobo
  • 15
  • 5
1
vote
0 answers

Multiple ultrasonic sensor interference

I am trying to use multiple ultrasonic sensor to develop an estimate of a profile by facing them on the same side and placing them 1 or 2cm away. The problem is a) I have trigger them at the same time b) I cannot change the frequency of the sound.…
1
2 3 4 5 6