Open the ``||sensors:Sensors||`` Toolbox drawer. Drag out an ``||sensors:on infrared object||`` block onto the Workspace (you can place this anywhere). Select ``detected`` from the second dropdown menu.
Open the ``||brick:Brick||`` Toolbox drawer. From the **Screen** section, drag out a ``||brick:show image||`` block onto the Workspace, and drop it into the ``||sensors:on infrared object||`` block.
Open the ``||brick:Brick||`` Toolbox drawer. From the **Buttons** section, drag out a ``||brick:set status light to||`` block onto the Workspace, and drop it after the ``||brick:show image||`` block.
Open the ``||loops:Loops||`` Toolbox drawer. Drag a ``||loops:repeat||`` loop onto the Workspace, and drop it after the ``||brick:set status light to||`` block.
sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
brick.showImage(images.informationStop1)
brick.setStatusLight(StatusLight.RedFlash)
for (let i = 0; i <4;i++){
}
})
```
## Step 7
Open the ``||music:Music||`` Toolbox drawer. Drag a ``||music:play sound effect until done||`` block onto the Workspace, and drop it into the ``||loops:repeat||`` loop.
```blocks
sensors.infrared1.onEvent(InfraredSensorEvent.ObjectDetected, function () {
Now, plug your EV3 Brick into the computer with the USB cable, and click the **Download** button at the bottom of your screen. Follow the directions to save your program to the EV3 Brick.
Attach an Infrared Sensor to Port 1 of your Ev3 Brick. Test your program by putting an object increasingly closer to the Infrared Sensor – your Intruder Alert should trigger when you get too close!