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.