Nemdez
Brazil
Asked
— Edited
Como controlar um servomotor através do sensor de colisão de infravermelho da Sharp? e como Robô fazer curvas usando o sensor Ultrassônico?
Related Hardware EZ-B v4
Related Control
Sharp IR Radar
Please see the "Sharp IR Radar" skill control: https://synthiam.com/Products/Controls/Infrared-Distance/Sharp-IR-Radar-16103
Please see the "Ultrasonic Distance" skill control: https://synthiam.com/Products/Controls/Ultrasonic-Distance/Ultrasonic-Distance-16090
In order to make the a robot avoid obstacles you'll need to write an EZ-Script that checks the value from the sensor while it is moving. A low value from the sensor represents an obstacle in front of the robot. Then you can write a script to turn the robot left or right. It works better if you place a servo under the sensor in order to "sweep" the sensor as the robot is moving, then you could tell if the obstacle if on the left or right or in front of the robot and turn the robot accordingly.
@athena Which model number of the Sharp IR distance sensor is appropriate for the EZ B V4 ?
I have the Sharp GP2D12 with a 5 volt regulator, and I cannot get the distance value to go below 70. (inches )
I need the distance to go below 20 in order for the robot to turn to avoid obstacles, when using the SHARP IR RADAR.
Is there a way to make it work with the SHARP GP2D12 ?
The Sharp GP2D12 is a suitable sensor for use with the EZ-B v4, as it operates within the 5V range, which is compatible with the EZ-B's ADC ports. However, if you're experiencing issues with the distance values not going below 70, there are a few things you can check and adjust:
Voltage Supply: Ensure that the sensor is receiving a stable 5V supply. If the voltage is lower, it might affect the sensor's performance.
Wiring: Double-check the wiring to ensure that the sensor is correctly connected to the ADC port on the EZ-B. The signal wire should be connected to the ADC pin, and the power and ground wires should be connected to the appropriate power and ground pins.
Calibration: The Sharp GP2D12 sensor might need calibration to provide accurate distance readings. You can do this by comparing the sensor's output with known distances and adjusting the readings in your code.
Sensor Positioning: Ensure that the sensor is positioned correctly and that there are no obstructions in its field of view that could affect the readings.
Code Adjustments: In your ARC project, you might need to adjust the settings in the Sharp IR Radar skill to better suit the GP2D12 sensor. This includes setting the correct ADC port and adjusting the minimum distance threshold for obstacle detection.
Testing: Test the sensor with a simple script to read the ADC values directly and see if the readings change as expected when an object is placed at different distances.
If you've checked all the above and the issue persists, you might want to consider using a different model of the Sharp IR sensor that is known to work well with the EZ-B v4, such as the Sharp GP2Y0A21YK0F, which has a range of 10-80 cm and is commonly used in robotics for obstacle detection.
For more detailed guidance on setting up and using the Sharp IR Radar skill, you can refer to the Sharp IR Radar skill documentation.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
It works with the setup in this video:
5V reg to Sharp sensor powered from Digital pin power rails. Analog voltage out from Sharp sensor to A0 on EZ-Bv4
YouTube video
The Sharp sensor in the video is the 2Y0A21 which is the new version of the GD2D12. They function almost exactly the same.