SecretsNsafes

by vaipal183 in Circuits > Microcontrollers

26 Views, 0 Favorites, 0 Comments

SecretsNsafes

whalley.png

This is a step by step instructable on how to make a motion detecter alarm system using a microbit.

Setting Up the Microbit

9-Volt-Battery-to-DC-Plug-Adapter-Cable-with-Battery-Installed.jpg
microbit-overview-1-5.png
download (8).jpeg
Screenshot 2025-02-26 at 8.05.36 PM.png
51D--iCMCzL._AC_SL1001_.jpg

To start off you need to connect everything to the gpio board. First put the microbit in the microbit slot. Next insert the battery wire into the circular hole that is on the left side of the board. After that you place the wires on 5 volt which is the middle red option, then you put one on P8, and one at the very end. And put all of those on the first row.

Setting Up the Motion Sensor

51D--iCMCzL._AC_SL1001_.jpg
download (8).jpeg

Over here you have to connect the same wires that you put on the gpio board over here. To begin with rotate the round yellow things to be away from you. After that you want to place the wire that was in the red section in the first slot. Place the one on P8 in the middle, and the last one in the 3rd slot. If it doesn't work as well then adjust the yellow plus signs. Move the first plus sign to the left to increase the range, and right to decrease it. For the second knob move it completley left for 0 input/output delay. Now you are done with the hardware.

Setting Up the Code

Screenshot 2025-02-26 at 9.58.45 PM.png

For the code you just want to copy this. What this does is sets any motion to 1, so if motion is detected then it would equal to 1 which means that the alarm would off. If there is no motion then the variable equals to 0 which just makes the microbit show a checkmark.

Thoughtful improvements: fix the range and find the perfect range+