Micro:bit Radio Door Alarm
by Aloy_barkbark in Circuits > Microcontrollers
56 Views, 0 Favorites, 0 Comments
Micro:bit Radio Door Alarm
Usually, it’s human nature to open a door at a usual rate. However, if there’s a disturbance in that velocity that a door is opened, that could mean someone needs help with something or an intruder is present!
Supplies
Sender: Tape, battery pack, micro:bit #1
Reciever: Battery pack (or micro-usb connected to a computer), micro:bit #2
Video Help
Video of the project in action & Design Brief
Downloads
Sender Micro:bit
- First is to code the Sender Micro:bit code. On start, we would like both microbits to be on the same radio group, so set them both to the same number. In my case, I picked a number my students have engrained into me as a second coming of skibidi.
- On Button press A, I would like for it to tell me how fast I am going in the Z- axis. Z is towards or away from the microbit.
- Forever, the microbit will see if it ever reaches beyond a certain Z-axis acceleration. Once it reaches beyond that, a LED animation will pop up and send over a radio number 0 to the receiving micro:bit. If nothing is occuring to the micro:bit, then the screen will stay empty and send radio number 1 over to the other microbit.
Downloads
Receiver Micro:bit
- Similar to the sender micro:bit, we need to make sure this microbit is on the same radio group.
- In the radio functions, the sender is sending either a 0 or 1.
- 0 means that the sender moved, so a tone will play and show an X for a compromised icon.
- 1 means that the sender has not moved, so it will keep showing a checkmark until your door has been comrpomised.
Downloads
Debugging/Reflection
My project works; however it is inconsistent. In the uploaded video, there are times when I open the door and the reciver does not go off. Depending on the orientation of the micro:bit, It changes what axis I should be using(X, Y or Z axis). There was a lot of time spend, reorientating and figuring out what is the best way to get an accurate reading.
If I had more time, I would do more research upon what would be the best orientation to put it on the door. I used chatgpt to help guide me through my mistakes. It told me that one axis may not be accurate enough, but to get a reading of all 3, use a formula to see if those acclerations reach a certain threshhold sounds intriguing, but with my current time frame for this assignment, I worked with what I have.