HC-SR04 ultrasonic sensor Range Problem

8 visualizzazioni (ultimi 30 giorni)
Jordan Jenkins
Jordan Jenkins il 30 Ott 2019
Risposto: Amrtanshu Raj il 23 Set 2021
Hi all, im currently partaking in a robotics Project, with the aim of driving a robot arm using a vision guidence system. Im using a HC-SR04 ultrasonic sensor connected to an arduino uno to collect Z-axis data. The whole project being controlled through MATLAB as this is the main knowledge base at my institution.
However i have come across an issue, when using the Legacy HC-SR04 Add-On Library for Arduino the working range of the sensor is dramatically reduced. I can use the sensor in arduino IDE with a working range of 4 meters, so i beleive this rules out a harware issue, however when the sensor is controlled in MATLAB the working range is reduced to around 0.4 meters after which the sensor returns a value of 0.51m constantly.
Are there any workarounds for this issue? if not i will need to keep the arduino IDE program controlling the arduino/sensor and then import the data to MATLAB as and when needed.
Thanks in Advance,
Jordan.

Risposte (1)

Amrtanshu Raj
Amrtanshu Raj il 23 Set 2021
Hi,
The range problem with Legacy HC-SR04 Add-On Library is a known issue for this Library. This library is now no longer in use and has been replaced by MATLAB Support Package for Arduino Hardware which enables you to use MATLAB to interactively communicate with an Arduino board.
Hope this helps !!

Categorie

Scopri di più su ROS Toolbox Supported Hardware in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by