Build and program a security system using an NXT. The alarm should be triggered by the proximity (ultrasonic) sensor.

Lesson Objectives:

– To learn about programming using the proximity sensor.

– To apply programming to real life problems.

Materials Needed:

One NXT brick per group

One or more proximity sensor per group

Assortment of pieces to attach proximity sensor

Computers running MINDSTORMS NXT software

Preparation and Set Up:

Set up computers running NXT Software.

Arrange students in groups of two.

Distribute necessary materials.

Necessary Background

Programming is used in real life situations. Programming is used in a wide variety of devices to enhance our lives in terms of safety, ease, entertainment, transportation, etc. This activity is a good example of a way that programming can be used in the real world.

Procedure

Have student design an alarm box that will detect when a person approaches the box. If students want to use more than one proximity sensor or a different sensor as well they should be allowed to be creative.

Allow students to decide how their security system will respond when someone approaches (display something on the screen, make a noise, drive away)

Have students program the NXT to respond when someone approaches the proximity sensor and to stop responding when that person backs off.

The entire program will need to be looped so that the NXT is always secure

When the NXT is not being threated it should signal that it is alarmed by displaying “system alarmed” on the NXT screen.

When the proximity sensor senses that an object is near it should respond (say by displaying back off! and playing a tone).

The alarm should be looped until the proximity sensor no longer detects an object close to it.

Students may use more than one sensor to trigger the alarm.

Allow students to test and redesign their prototypes.

Extensions:

Use multiple sensors to trigger the alarm. Have a different response for each

sensor.

Build an NXT alarm clock or timer.

Attach the NXT alarm to a diary or box. Build something to keep people from opening the diary/box.

Program the NXT so that a user needs to enter a security code to turn off the alarm.

1 comment on this post.

Marya Schnedeker:

January 10th, 2014 at 4:18 pm

I did this activity with 8th grade students as an introduction to sensors and programming. The students did struggle with the programming (particularly debugging), but when pointed in the right direction, they seemed to understand the programming blocks and loops. However, they did require a lot of support. It would have been ideal if we had a large board or screen where we could do the programming part together. The students seemed to enjoy the activity. Especially the fact that their designs, when triggered, would give them sound feedback.