Redzone
USA
Asked
— Edited
Resolved by DJ Sures!
Hello,
I am trying to free up many digital ports on my arduino mega and seen these Grove - Ultrasonic Distance Sensor. Will they work on my arduino mega?
Thank you in advance.
Edited: link to Grove - Ultrasonic Distance Sensor https://www.seeedstudio.com/Grove-Ultrasonic-Distance-Sensor.html?gclid=EAIaIQobChMI5fKn6rOn8wIVPXNvBB1GFgkpEAQYASABEgIsTvD_BwE
Related Hardware Arduino Due/Mega
Looks like it should. Specify the trigger and echo to be on the same port
Thanks DJ. I’m going to order one to test. Cheers
Hi DJ,
I just tried to use the Grove - Ultrasonic Distance Sensor and does not work. I used the trigger and echo to be on the same port . I have the version 10-3-21 software. Do you think you could take a look to see if you can get these working the mega. I have not tried the EZB 4 1/2 yet. EDITED: It does not work on the EZB 4 1/2 either. Edited again: here’s a copy of Q/A.. Can we connect mulitule ultrasonic to one arduino?
A4: Yes, Here is the example, one sensor is connected to D2 and other to D3.
#include "Ultrasonic.h"
Ultrasonic ultrasonic1(2); Ultrasonic ultrasonic2(3); void setup() { Serial.begin(9600); } void loop() { long RangeInCentimeters1; long RangeInCentimeters2;
}
Thank you in advance. Cheers
Try with an ez-robot ez-b first. Because maybe the sensor isn't working. I don't see a reason the sensor shouldn't work for you. The one-wire sensors I have worked fine with the mega. Are you using a digital port? You can't use a servo port. It has to be a digital port.
Remember, a D2 on the EZB Arduino Mega is pin #4. See the mapping here: https://synthiam.com/Support/Hardware/Arduino-Due-Mega
Or press one of the two buttons for viewing the board manual.
If it isn't working for you on an EZ-Robot EZB, then...
Is it getting enough power?
Is it wired correctly?
Are the correct pins selected?
Is it broken?
Those ping sensors are incredibly popular with Synthiam users - I can't see how it isn't working hmmm
PS, i added a slight change to the mega firmware that "might" help - it should at least provide higher accuracy as well. Get it from the Arduino Mega hardware page here: https://synthiam.com/Support/Hardware/Arduino-Due-Mega
But if that doesn't work - i'd look into my suggestions above. It might be power-related. These sensors are generally 5v and the Arduino and EZ-B are 3.3v
So you'd need a separate power supply or voltage regulator for ultrasonic sensors like that. Make sure they have common grounds.
You are the man! @DJ,
your firmware was the fix. They are now working, I testEd 3 of them all good.
BTY, you may have dated the firmware date on purpose or accident. It’s dated November 11, 2021
Thanks again you’re the best! Cheers
Hi Merme,
Have you ever used the Waterproof Ultrasonic Distance Sensors?
They work like the HC-SR04 but are good for outside adventures.
Purchased on Amazon
JSN-SR04T The JSN-SR04T is sensor in that it comes as a separate printed circuit board and sensor unit. The sensor, which is a single device that acts as both transmitter and receiver, is attached to the PCB using a 2-meter cable.
A02YYUW The A02YYUW is an ultrasonic distance sensor that some resemblance to the HC-SR04 in that it has a separate receiver and transmitter.
I tested both on a Arduino, the A02YYUW works better at closer distance for accurate readings
The JSN-SR04T’s default starts at about a foot distance for accurate readings
EzAng
Hi EzAn.
I have not used or tried using the Waterproof Ultrasonic Distance Sensors. I only use the 3 Wire Grove - Ultrasonic Distance Sensor.
BTY, the 3 Wire Grove - Ultrasonic Distance Sensor does not fix any of the standard 4 wire HC-SR0 Mounting brackets,boards. I have not been able to find any that fit the 3 Wire Grove - Ultrasonic Distance Sensor. I have to hot glue them to the Mounting brackets,boards.
I haven’t really played with them yet I’ve been doing other things that need done first.
Take care and talk to you later. cheers