Automatic Headlights

Connect

Make sure that you can answer the following questions:

– What are the dangers of driving at night?
– How can we define the concept of ambient light?
– How can drivers be assisted in their nighttime driving?

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

car-road-line

Construct

Build
Start by constructing this model.

ev3-robot-driving-base

Program
Write a program that will simulate the automatic headlights on a car.

– Find a light bulb image for the EV3 Brick Display that you can incorporate into your program.
– Use the Color Sensor to trigger your “light bulb” to turn on.
– Take ambient light readings from the Port View in order to properly calibrate your program.

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-02

Contemplate

Now that your automatic headlights turn on successfully, you will need to extend your program so that they switch off when it becomes light again. To do this, you will need to create a program that repeats itself so you don’t need to keep restarting it.

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

Consider adding these blocks to your solution:

layout-ex-cbs-03

Differentiation Option
Create a program that gives more control over your car’s automatic headlights so that the lights can be switched on and off manually. Many modern cars have this function, which gives the driver the
option to override the automatic program.

– You might need to explore new ways of structuring your program by using parallel programming or multitasking.
– You could use a Touch Sensor to simulate the manual switch.
– You might need to use the Loop Interrupt Block to override the automatic control.

Share
Consider the following questions:
What challenged you? Where there any surprises? How could you improve your program?
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?

Think about what you have learned, then document it. Creatively record and present your ideas, creations, and findings.

Consider adding these blocks to your solution:

layout-ex-cbs-04

Continue

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