This Christmas I really wanted to build something fun and easy with my kids to get them excited about microcontrollers, computers, and programming. So the first thing that came to my mind was using Wio Iot products because they are super simple and fun to create stuff with. My son mentioned something about bad guys stealing presents from people xmas trees so I told him that we can easily get all those bad guys by creating a cool sneaky alarm system.
You can't build an alarm system without creating an awesome movie to showcase the end result, so before I tell you how we did it, here is a cool trailer of the Sneaky Alarm System.
First you have to make sure that you have all the component you need to create the alarm system. There are three simple elements in this project.
After acquiring the required hardware, we can continue with the software. There are two different software components in this projects; the backend service and the front-end client running on the phone or a computer.
Back-end ServiceThe back-end service is handled by the Wio Link mobile app. Which is available in both Android and iOS.
Download the application and create an account. Then you have to follow the pairing process between the Wio Node and the mobile application.
1. Select the appropriate device from the UI.
2. Connect your mobile device with the Wio's Access Point (WiFi).
3. Connect the Wio to your access point (WiFi).
4. Once connected, add the PIR sensor to your Wio setup.
5. Deploy firmware and now take a look at the "View API" section.
You need to copy that token number because we are going to use it to build our mobile or desktop application.
Front-end UIWe are going to use Apache Cordova in order to provide a multi-platform solution for our UI. The entire UI code is not more than a few lines of Javascript and a few lines of CSS.
In order to utilize the public github repo, you'll need to install Nodejs, and Cordova in your OS.
npm i cordova -g
Once you get all the prerequisite software in your computer, you are ready to clone the repository.
git clone https://github.com/pirumpi/sneaky-alarm
cd sneaky-alarm
// Install dependencies
npm install
// add browser dependencies
cordova platform add browser
Now before you can try the Sneaky Alarm system we need to make some update to the code.
You need to change line 4 with your own token, and also double check that you have the same wio URL as me, otherwise, change line 5 with the correct websockets URL.
Final Product
Comments
Please log in or sign up to comment.