Introduction: Lego Mindstorm Ev3 Rescue Challenge
This tutorial is meant for grade levels 5-12 and details the construction, wiring, and basic programming for an Ev3 Lego Mindstorm robot to seek out a "cube with people that need to be rescued" using the ultrasonic sensor, and the motorized arm. The primary driving design is easily modifiable, so with some modifications, there can be additional sensors attached for different tasks.
This project falls under particular ITEEA Standards for Technological Literacy.
Standard # 14: Students will develop an understanding of and be able to select and use medical technologies.
- F: Many tools and devices have been designed to help provide clues about health and to provide a safe environment.
- This robot and its challenge address this standard and benchmark by looking toward the future and see how we can use robots and send them into situations that are not stable enough to send in a human rescue.
Standard # 18: Students will develop an understanding of and be able to select and use transportation technologies.
- B: Vehicles move people or goods from one place to another in water, air or space, and on land.
- This robot and the challenge that it is completing required the robot to go into a situation and pick up a rescue carrier and rescue two lego people.
- LEGO MINDSTORMS EV3 Kit (Prebuilt Robot with no connected cables) ~$500
- A Computer ~$$$
- LEGO MINDSTORMS Education EV3 Software ~Free
Step 1: Gathering Materials
To begin this tutorial pick up your Mindstorm kit with your prebuilt-robot, your laptop, and head over to the link that is provided to download your software. Once at the link choose the correct type of operating system for your computer, and begin downloading the programming software.
Step 2: Building Your Rescue Carrier
So to begin this step open up your LEGO Mindstorm Ev3 kit and get out the following.
- 3- red links
- 3- blue links
- 3- yellow links
- 3- green links
- 12- double-length blue connectors
- 18- black connectors
- 2- silver 13 hole length links
- 2- square pieces
- 2- lego people
Once you have gathered up the required materials, take one of the grey square pieces, and insert the short length of eight of the double-length blue connectors on the flat face side. Once that is completed, start stacking two of each of the colored links together onto the longer ends of the blue connectors. After completing this move to the other grey square piece and insert eight of the black connectors in the face holes, then stack the remaining colored links respectively so they will line up and connect with the other square piece to combine these two pieces you will need to take four more black connectors and enter them into the remaining empty hole of the colored links. Once that is finished, connect the two pieces so that they line up color to color and are one big cube. Next, take the block and six remaining black connectors and add four of them to the top of the cube and then take the last two and add them onto the center inside hole of the carrier. For the final steps, take the remaining four blue double-length connectors and insert the short end of them into each end of the two silver thirteen hole length links. Center them both up on top of the cube by sticking them onto the four black connectors, then insert the lego people onto the black connectors on the inside of the rescue carrier.
(Follow along with the pictures provided for additional assistance)
Step 3: Wiring Your Robot
Working on your preassembled robot, gather up four wiring cables (I prefer the four shortest cables easier to work with). Before you start hooking up anything, one key piece of information that is required to know about these robots when wiring is that the four ports A-D are the plugin ports for motors, and the ports 1-4 are the ones for sensors. When wiring as long as you remember this, you can plug the motors and sensors in whichever port you want, but if you are following along with my hookups for this, I will be using motor ports A, B, and D, and the sensor port 2. Moving to the first hookup we are starting with the left motor, take one cable and hook it into the port on the motor itself, and the other end into the port A, next do the same thing with the right motor cable being plugged into port B. This next wire is a little more difficult to plug in so if you need to at any point remove the Ev3 brick from the top of the robot you can to clean up your wiring if you choose too or are just having a hard time hooking any of the wires up. Port D is plugged in for the arm; the porthole for this is on the back of the large motor directly below the Ev3 brick. Once the engines are connected move to hooking up the ultrasonic sensor, this sensor is what is going to allow for us to detect our rescue carrier and save our two lego people. Hooking up this sensor you will run the cable from the bottom of the robot plugged into the back of the "eyes" to port 2 on the back end of the brick (I tucked my cables up and ran them different ways to keep it clean looking and out of the way from the wheels).
Step 4: Writing Code for the Challenge
Working on a windows computer, this is what your programing software will look like once you have completed your download and opened up the application. Take some time and play around with the program and start looking at the many different things that you can do with this programming software. You will see six different tabs of colors with different types of block coding that you can use for this challenge. We will only be using green and orange tabs. The green tab is where you can choose motors you would like to use, and orange is where you can set conditions for the different sensors. Take some time and see if you can figure out different things within this program to solve the challenge if not follow these steps. First, you want to select the green block that is called move steering, and you want to change it to be on and set to a speed of around 35 up in the top right corner of the block you want to make sure that the ports A+B are selected so that this block applies to these motors. Next, you want to switch over to the orange tab and select the wait block, click on the little stopwatch icon and switch it to ultrasonic sensor compare distance in centimeters make sure the block code is set for measuring distance less than and I found 13 cm works best again make sure the correct port number is selected in the top right of the block. After that, you want to add another move steer block, but this time you want it to stop, so that once the robot senses something closer than 13 cm it will stop moving while doing this you want to add a large motor block for port D so that you can lower and raise the arm of the robot setting this to on for degrees with a low power setting of 15 with a degree rating of -165 to lower the arm first. While the arm is down, you then want to add another move steer block going forward this time for rotations with a 25 power rating, but only going .2 of rotation, so that the robot can then pull ahead with the arm down under the arms of the rescue carrier with our lego people. Once the robot has moved forward, you then again want to add a large motor block on for degrees with 15 power, but this time with a 150 degree to pick the rescue carrier up and ready for transport. After you have secure the carrier, I like to add a simple wait orange block for a quarter of a second, allowing for the robot to have a break and get ready to run the remainder of the code. Once that time is up, you want to add a move steering block this time on for one rotation again, but having a turn take place 50 on the arrow scale is a 90 degree right turn. After you have completed your right turn you can continue to add more turn or straight runs if you would like. The only remaining code that is needed is a large motor block set on degrees again with 15 power and -160 degrees to lower the arm and release the rescue carrier, then add a last move steering block going with -35 power on for half a rotation to back away from the carrier, and one final large motor block for 160 degrees to raise the arm back up to its starting position.
(The picture of the code that is provided is what I created for this challenge)
Step 5: Downloading Code and Running It
After having finished writing your desired code, go back to your robot, and proceed to turn it on by pressing and holding the center button for a few seconds. Once your robot has turned on, go back to your computer with the Mindstorm program open plug in the USB cable that is provided in your kit into your computer and the brick. Once you have done that in the lower right-hand corner of your window, you will see a download button click that, and once your robot has downloaded the code, you will hear it make a very distinct noise. Once that is done you need to hit the arrow to the right of the center button on your robot and then you should see the name of the code you created on the screen of the brick click it and then it will have a drop-down list scroll down and click on the code so that it will run. Before you run the code, make sure you are on a flat surface with no unnecessary objects, put the rescue carrier a certain distance from directly in front of your robot, then you can hit run. If you created your own code and encounter issues, you can go back and copy the code that is provided with video evidence of the coded completing the challenge.