Unlocking a car

Connect

Make sure that you can answer the following questions:
– How do electronic keys work?
– How can we ensure that each key is only able to open one car ?

Think about what you have learned, then document it. Describe the problem in your own words. Creatively record your ideas and findings.

unlock-car-key

Construct

Build
Start by constructing this model.

ev3-robot-ultrasonic-sensor

Program
Create a keyless entry system for your robot.
When a combination of sensors is activated, your drive program will be executed.
Program your robot to display the text “Welcome” when the Ultrasonic Sensor detects an object, and then display the text “Ignition” when the Touch Sensor is pressed.

Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas and findings.

Consider using these blocks in your solution:

layout-ex-cbs-07

Contemplate

You will need to use a number of different inputs and logic operations to make sure that the two inputs work together to provide information to another block. Think about how a keyless car works.
For this task:
– The Touch Sensor is the ignition.
– The Ultrasonic Sensor is used to detect the key inside the car.
– Both sensors need to be activated correctly in order for your robot to start.
– Use the sound output of your robot to indicate that it has started.

Consider adding these blocks to your solution:

layout-ex-cbs-08

For this task, you will use the sensor blocks (yellow) to create logic for the Logic Operations Block.
Each sensor block will be used to create a True/False output.

Reflect and document your learnings. Describe your pseudo-code for this task. Creatively record your ideas, and findings.

Differentiation Option
You now need to program your robot to “start” only when the conditions of three different sensors have all been met. For this task:
– The Touch Sensor is the ignition.
– The Ultrasonic Sensor is used to detect the key inside car.
– The Brick Buttons are used as the brake/clutch.
Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas and findings.

Share
Consider the following questions:
What did you think of the experience of using many Data Wires?
Could your program have been more streamlined? Have you used too many blocks?
Is there a more efficient way of building your program?
How could your program be used in real-world scenarios?
Comparing text-based programming with visual programming, which is easier to follow?
If you have not tried both programming methods, try the other method to see which is more efficient.

Consider using these blocks in your solution:

touch-sensor-compare-state

Continue

Explore text-based programming solutions for this activity and compare these solutions using different programming languages.