Download and install the new pre-release programming software for LEGO MINDSTORMS EV3 to your Apple Computer with macOS 10.14 Mojave or above. This pre-release has limited functionality, but you can install and connect to your programmable brick and download programs to your five Hero robots. Measure the distance between the EV3 Ultrasonic Sensor and the nearest object in front of the sensor. The sensor can detect objects from approximately 5 to 255 centimeters away. When the nearest object is beyond the maximum range of the Ultrasonic Sensor, the sensor outputs the maximum value, 255. The measured distances are approximate.
- Using The Ultrasonic Sensor Ev3
- Ultrasonic Sensor Lego Ev3
- Touch Sensor Ev3
- Download Ultrasonic Sensor Ev3 Macbook Programmer
- Download Ultrasonic Sensor Ev3 Macbook Pro 2017
- I have to solve a problem with EV3, using language C with ROBOTC. I am trying to find a ball in the field, grab it and drop in the triangle area. I'm using a ultrasonic sensor in front of the robot.
- Procedure: An EV3 Ultrasonic sensor was attached to a LEGO-made stick, and a cable connected the Ultrasonic to an input port on the EV3 Brick. A reading was taken using Port View, on the EV3 Brick, of a wall inside the tunnel. The EV3 Brick was programmed to have the Ultrasonic sensor respond to a specified distance from the wall with an action.
Follow an object using the LEGO Mindstorms Ultrasonic Sensor. Object moves away, the robot moves with the object. The program is very useful if you are doing STEM classes and you want to demonstrate results. People react very well to a robot following you like a dog for example.
- #145
- 15 Oct 2015
- 5:43
- LEGO MINDSTORMS
- EV3, Ultrasonic Sensor, Basic, Programming
- K.Mitov, I.Bozhilov, I.Gerginov
Previous video tutorials:
Follow an object with the Ultrasonic sensor
EV3-G program for following and object with the LEGO Mindstorms EV3 robots
English
The next program with our ultrasonic sensor is to make the robot follow my hand. Аs I move my hand away from the robot, I would like the robot to follow it and to keep at a distance of about 4 inches, like this.
Download, run the program.
Now I move my hand and the robot moves forward. The only thing that we should add to this program is that when I move my hand the robot should move at exactly the same distance, so it should keep 10 cm.
Move, stop and move my hand and it continues moving. How can we make this process repeatable, moving and keeping distance of 10 cm? Since we want this whole process of moving forward, stopping and moving forward to repeat we need to use a loop.
What we want to repeat are the following blocks. First moving forward, waiting until we see an object, stopping and then waiting until the object moves away and when the object moves away we return to the beginning of the loop and we'll move the motor forward until we detect an object and when the object moves away we start again and move forward for undefined amount of time. This way we'll get our robot to follow the object in this case my hand. Let's see if the program works correctly.
Using The Ultrasonic Sensor Ev3
The robot moves forward, reaches my hand, I move my hand and the robot moves with the hand.
What you can see is that we have this not very smooth movement of the motors. How can we improve this? What we want to change in our program is the Tank block with the stop option. We want to change it so it does not break when stopping but to coast, so it's stopping very slowly not immediately and this will probably make following the object a little smoother. Let's see if this works.
Ultrasonic Sensor Lego Ev3
I'll stop the program now. Let's run it again and what happens. We move with the robot forward until it sees my hand
Touch Sensor Ev3
but it does not stop.
Download Ultrasonic Sensor Ev3 Macbook Programmer
It moves it's smother but there is a glitch and the glitch happens if the sensor is very near to my hand. Now is following, it's very smooth but if my hand is very near to the sensor, like this, the robot won't stop.
So we have the program for following my hand but as we have the coast option it is possible if the object moves very slowly we actually touch the object and when we are touching the sensor is not able to detect any distance to the object and it's not working as expected. It might return a maximum distance or it might return 0 but if the object touches the sensor, the sensor is not returning correct values. As a result from this video we have a program for following an object that is moving.
In the next video we'll set few tasks that you can implement for the ultrasonic sensor so that you can learn more about it.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons
EV3 Basic Course. Introduction to robot programming, construction and sensor use
This course is designed for students, mentors and teachers that are completely new to LEGO Mindstorms EV3 robots and would like to start using them to learn, in classes or at competitions. It is quite different from previously built resources at FLLCasts because it makes no assumption on any previous knowledge and tries to introduce everything step-by-step.
Download Ultrasonic Sensor Ev3 Macbook Pro 2017
- 38
- 193:26
- 30