Intruder Detection

by RayM81 in Circuits > Gadgets

1524 Views, 10 Favorites, 0 Comments

Intruder Detection

1.png

This article is from tinkercademy, you can see the link here : https://tinkercademy.com/tutorials/plant-monitori...

Swiper no swiping! Stop burglars with this simple intruder detection system.

Note:
For more funny creation, you can pay attention to : http://www.elecfreaks.com/

Our product store: http://www.elecfreaks.com/estore/

Pre-build Overview

1.png

In this project, we are going to create an intruder detection system which will sound when someone opens the door. The status of the house will be displayed on the OLED.

Materials:

2.jpg

1X Octopus Crash Sensor Brick

1 x BBC micro:bit

1 x Micro USB cable

1 x Breakout board

1 x OLED

1 x Buzzer

2 x Female-Female jumper wires

Goals:

Get to know the Crash Sensor, OLED and Buzzer

Make something with a OLED Make something with a Crash Sensor

Components

3.jpg

Insert the micro:bit into the Breakout Board and plug in the micro USB cable, then connect the buzzer using the jumper cables. The positive (usually longer) pin on the Buzzer will connect to the yellow pin on the breakout board, while the negative (usually shorter) one connects to the black pin. Plug the other end of the jumper wires to Pin 0.

Plug in OLED

4.jpg

Plug in the OLED as shown in the picture above. You should be able to plug it into any of the three rows.

Plug in the crash sensor to Pin 1. Make sure the colour of the wire follows the coloured pins on the breakout board.

Pre-coding

6.jpg

We will add a package of code to enable us to use our kit components. Click on Advanced in the Code Drawer to see more code section and look at the bottom of the Code Drawer for Add Package.

Add Package

7.jpg

We will add a package of code to enable us to use our kit components. Click on Advanced in the Code Drawer to see more code section and look at the bottom of the Code Drawer for Add Package.

This will open up a dialog box. Copy and paste the following link into the Add Package… text field: https://pxt.microbit.org/50544-64675-33322-24641. Click on the search icon or press enter, then click on the Tinkercademy button.

Note: If you get a warning telling you some packages will be removed because of incompatibility issues, either follow the prompts or create a new project in the Projects file menu.

Coding

8.jpg
9.jpg

Click on Tinkercademy inside the Code Drawer to find our custom blocks for the various components in your kit.You should always initialize the OLED at the beginning. 64 and 128 represent the height and width of the OLED respectively.

Choose Condition

10.jpg

Since there are only two conditions, we need only one “else-if”statement.

When crash sensor is triggered, the buzzer will sound and the OLED will display the message “Intruder Detected”. Or else, if there is no force is applied to the crash sensor, the buzzer will not sound and the OLED will display the message “The house is safe”.

Completed!

1.png

Voilà! You have created a intruder detector!Let's have a try!

Note:
For more funny creation, you can pay attention to : http://www.elecfreaks.com/

Our product store: http://www.elecfreaks.com/estore/