Lego Mindstorms EV3 Sensor Tutorials PDF

Title Lego Mindstorms EV3 Sensor Tutorials
Course Project 2
Institution University of Dundee
Pages 4
File Size 311.7 KB
File Type PDF
Total Downloads 80
Total Views 144

Summary

Download Lego Mindstorms EV3 Sensor Tutorials PDF


Description

Sensor Tutorials Touch Sensor Tutorial Attach two touch sensors to ports 1+2 of the programmable brick using the connecting cables. Attach a large motor to port A. See Figure 1 below:

Figure 1: Touch Sensors Create the following programme in LEGO Mindstorms EV3 software:





The first two yellow bordered blocks are “wait” functions which can be selected from the “flow control” tab. These blocks prevent the motor from starting until the appropriate touch sensor has been pressed i.e. has a binary value of 1. The second set of blocks are “large motor” blocks which can be found in the “action” tab. Depending on whether or not the touch sensor connected to port 1 or 2 is pressed, the motor will drive forward or backward for 2 rotations.

Create, download and test the programme. The motors should not move until one of the touch sensors is pressed.

Ultrasonic Sensor Tutorial The ultrasonic sensor will sense objects in the direction the sensor is facing. This can be used to stop the robot from moving if it is going to collide with an object. Attach an ultrasonic sensor to port 1 of the programmable brick using a connecting cable.

Figure 2: Ultrasonic Sensor The following programme will cause the programmable brick to emit a sound when an object is less than or equal to 6cm away from the ultrasonic sensor:

 

The first block prevents the programmable brick from emitting a sound until the ultrasonic sensor detects an object less than or equal to 6cm from it. The second block causes the programmable brick to emit a sound after the condition from the first block is met.

Create, download and test the programme. You can use your hand as the object to place in front of the ultrasonic sensor.

Gryo Sensor Tutorial The gyro sensor measures the rotational motion of the robot as well as changes in its orientation. This sensor is useful for measuring angles and correcting angular momentum during turning sequences. Attach a gyro sensor to the side of the programmable brick using a blue peg. Now connect the gyro sensor to port 1 of the programmable brick using a connecting cable.

Figure 3: Gyro Sensor The following programme will reset the orientation of the gyro sensor to zero. Once the gyro sensor is turned 90 degrees to the right, the programmable brick will display an image on the screen, file name “neutral”, for 5 seconds, after which point the display will reset:

    

The first block resets the gyro sensor orientation to zero The second block tells the programmable brick to wait for the gyro sensor to orientate 90 degrees from the zero position before moving onto the third block of the programme. The third block causes an image to appear on the display screen. The fourth block allows the image to remain on the display screen for 5 seconds. The fifth block resets the display screen.

Create, download and test the programme detailed above.

Light Sensor Tutorial Connect a light sensor to port 1 of the programmable brick, and a large motor to port D. Find an object with a distinct colour. In this tutorial, I used a green wooden cube:

Figure 4: Light Sensor The following programme activates the motor at a power rating of 50. This action continues until the light sensor detects a green object, at which point the motor will come to a halt and the programme will end:

  

The first block activates the motor to turn at a power rating of 50. The second block tells the motor to continue until the colour green is detected by the light sensor. The third block stops the motor once the condition from the second block is met.

Create, download and test the programme. If you do not have a green object, you can change the colour of the object you would like to detect by selecting the drop-down menu in the second block shown in the diagram above....


Similar Free PDFs