Questions tagged [ultrasonics]

28 questions
4
votes
2 answers

Controlling a 5V fan and ultrasonic fogger with an arduino - do I need an external power supply?

I know the whole controlling a fan with an arduino thing is getting old, but somehow I still don't get it to work. Tried to answer it based on other questions but I am too much of a newbie to extrapolate the info there to my specific problem. For my…
crabdance
  • 43
  • 3
4
votes
1 answer

Can't stop the 3 pin active buzzer

I was simply trying to program a buzzer with the ultrasonic HC SR04 and 128x64 OLED display. The buzzer is an active buzzer (3 pin) on a small board. The problem is that, once on, it never stops buzzing. I have used the following code which is…
Bukaida
  • 141
  • 2
3
votes
2 answers

Is an Ultrasonic Sensor or Infrared Sensor better for measuring distance (to/from a human body)?

I'm trying to make a sensor to detect that a person is within 50cm to trigger a function. But when I use the HR-SR04 sensor, it works accurately on flat surfaces (e.g. walls, books) with a margin of error around 5cm, but not on uneven surfaces (e.g.…
2
votes
1 answer

Arduino (line follower + ultrasonic sensor + servomotor)

I am making a line follower car that follows the line when push button is pressed. And by using ultrasonic sensor I want the car to stop when object ahead distance is closer than 100 and then make servo motor turn to 180 degrees. Used: Arduino…
PGI
  • 21
  • 2
2
votes
0 answers

Issues with Polytone Library?

I'm building a device that uses two ultrasonic sensors to detect objects and provide audio feedback in the form of beeps that get faster the closer an object is. I have two speakers, one for each sensor, but the tone command will only do one set of…
Kaytee
  • 21
  • 2
2
votes
0 answers

When is following code is dumped into Arduino NANO the output is not as expected after few trials

I'm a beginner of Arduino programming, when I dumped the following code into Arduino NANO board, at the first the output is as expected. But After few trials the 16*2 LCD display is getting off and DC motor pump is running continuously. …
Swathi
  • 21
  • 1
2
votes
2 answers

sro4m-2 waterproof ultrasonic sensor

I bought this waterproof ultrasonic sensor about 5 of them with the part number SR04M-2 Written on the PCB silkscreen Which is different from the usual SR04t-0.2, they are just not working, I don't know if its using a different communication…
Jephtah Jephtah
  • 37
  • 1
  • 1
  • 3
1
vote
0 answers

Inaccurate and changed results with ultrasonic sensor

I have an issue using an ultrasonic sensor. The problem is that when I connect the ultrasonic sensor to my Arduino Nano, it always gives some random values, usually 130 cm, I don't know why. I bought a second ultrasonic sensor and the problem…
1
vote
1 answer

Motor with ultrasonic sensor

I am new to programming so bear with me. I am writing a simple code to control a motor such that the motor will turn at full speed as long as the sensor does not detect an object within 5" of the sensor. If it does see something at 5 inches or less,…
Pilot Ken
  • 19
  • 2
1
vote
0 answers

Controlling Bluetooth voice-controlled car with ultrasonic sensor

I am trying to use an ultrasonic sensor to stop a tiny voice-controlled car but I can't get it to work. once the motor starts moving it doesn't stop I'm trying to make the car stop moving even though it is already in motion. I need help writing a…
brian
  • 11
  • 1
1
vote
0 answers

I want my LED's to turn on for 5 sec when the Ultrasonic Sensor Activated

const int Trigger = 6; const int Echo = 7; const int LEDpin1 = 4; const int LEDpin2 = 5; const int Parameter = 400; float Time; void setup() { Serial.begin(9600); pinMode(Trigger, OUTPUT); pinMode(Echo,…
1
vote
1 answer

can differential drive work together with ultrasonic sensor?

I've written a sketch to drive a differential drive system, specifically - to be able to drive strait. This does work. So I am trying to add the ability to stop when the path is blocked using US sensor directed towards the front of the "car". I…
1
vote
2 answers

Avoid using delay with the HR-S04 ultrasonic sensor

How can I measure the distance of an HR-S04 ultrasonic sensor with millis and micros?
1
vote
0 answers

Does natural outdoors wind affect the readings of an ultrasonic sensor significantly?

I am thinking of using an ultrasonic sensor outdoors, and am wondering if the presence of wind (say up to 20km/h) would significantly impact the accuracy of the readings, or would this not be a large concern? Thanks.
Eric
  • 41
  • 3
1
vote
2 answers

Arduino code not working properly (Please Help)

I am having some trouble getting my board to perform the function I want it to perform. This is a project I have due in a few days, and I have hit a wall I just can't seem to get past. Now, I will say the issue is definitely in the way I coded the…
Geraldo
  • 13
  • 2
1
2