Exercise 3: Alarm system


Based on model 2, the task for model 3 explains how a light barrier (phototransistor) works as a „digital sensor“ using the example of an alarm system. It prepares the content of models 4, 5, 7, 9 and 12, in which light barriers are also used. In addition, what has been learned from model 1, flashing light, is repeated.



What is a photoelectric sensor? How does an alarm system work? How can you output sound files in Scratch?


Learning objective

  • Understanding a phototransistor / light barrier as a „digital sensor“
  • Programming an alarm system, combination with model 1, flashing light
  • Controlling a motor in Scratch
  • Output of sound files in Scratch

Time required

Setting up and wiring the alarm system takes about half an hour. The programming tasks can be solved within one lesson. If the traffic light model is still more complex, it can be modified and the construction time shortened.

The last task is suitable as an additional task for students with particularly quick comprehension skills or experience with Scratch; it is not necessary to complete it in order to understand the following task sheets.