6.3 KiB
Make It Smarter and Faster
Connect
Design Brief
Design, build and program a robotic creature that can sense its environment and respond by moving.
https://www.youtube.com/watch?v=y9-A_C_08KY
- What do the robots in the video need to be able to sense, plan, and act?
- What senses do humans have and why are they important to us?
- How many human-like senses do you see the robots demonstrating?
Brainstorm
Discuss different solutions to the design brief.
Think about:
- What kind of creature can it be?
- How can it move?
- What does it need to be aware so that it stays safe, well fed and warm (or cool)?
- Is it looking for food, a safe place to hide or a warm place to soak up the sun?
- Will the creature need to move fast or slow?
- Will it need to turn?
- Will it need to go backward?
Construct
Build
Think about a creature’s movement for inspiration. Your mechanism can be attached or unattached to the EV3 brick. You can start by tinkering with the LEGO elements in the picture add then build on. More building ideas:
Program
Before you program, think about:
- How will you program the robot to sense?
- How will you program the robot to respond?
- Which programming blocks will you use?
~ hint
Hint: Explore the different Sensor blocks in the Sensors Menu
~
SCREEN 5
Sample Solution
[Video: EV3 Insect]
This Insect uses its Ultrasonic Sensor to sense danger and move away from threat.
The Insect solution combines these building ideas:
- EV3 Frames
- Leg 2
- Leg 3
- Ultrasonic Sensor
Four copies of Leg 3 were built: one for the front left, one for the back right, and two mirror copies for the front right and back left.
Sample Solution
This program checks if the Ultrasonic Sensor senses something near.
This program:
- Turns on the green EV3 brick Status Light
brick.setStatusLight(StatusLight.Green)
- Waits for Ultrasonic Sensor to detect an object
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectDetected)
- Turns on Motors A and D in opposite directions
motors.largeAD.tank(50, -50)
- Waits for one half of a second (1500 milli seconds)
pause(1500)
- Reverses the direction of Motors A and D
motors.largeAD.tank(-50, 50)
- Waits for one half of a second
- Stops all motors
motors.stopAll()
- Makes an insect chirping sound
music.playSoundEffectUntilDone(sounds.animalsInsectChirp)
- Loops so the insect wanders around when the Ultrasonic Sensor is triggered
forever(function () {
brick.setStatusLight(StatusLight.Green)
sensors.ultrasonic4.pauseUntil(UltrasonicSensorEvent.ObjectDetected)
motors.largeAD.tank(50, -50)
pause(1500)
motors.largeAD.tank(-50, 50)
pause(1500)
motors.stopAll()
music.playSoundEffectUntilDone(sounds.animalsInsectChirp)
})
Download and test
Click Download and follow the instructions to get your code onto your EV3 Brick. Press the center button on the EV3 Brick to run the program.
Contemplate
Test and Analyze
As you work on your solution:
- Describe one part of your design that worked especially well.
- Describe one design change that you had to make.
- What will you try next?
Review and Revise
Take a moment to reflect on your robot solution.
Think about:
- Does your robot move when the sensor is activated?
- If not, what will you change to make the robot’s ability to sense and respond more obvious?
- What other behaviors can you add to the robot to make it more realistic?
Describe two ways you could improve your robot.
Continue
Personalize your project
- Add/remove LEGO elements to improve the way your robot moves.
- Click on the JavaScript tab and experiment with changing the values in the code.
- Add a custom image or sounds by adding blocks from the Brick or Music menus.
- Does your robot resemble a creature? Add arts and crafts materials to you project.
Communicate
Here are some ideas:
- Create a video of your project, especially your final presentation and your robot’s performance. Explain some important features of your software program.
- Produce a building guide for your model by taking a series of photographs as you deconstruct it.
- Include an image of your program with comments.
- Add a team photograph!
Congratulations! What will you design next?