In this tutorial, we will be going over how to make a security motion detector that can send you push notifications whenever you smart home motion detector is triggered.
Image of PIR in Case Figure 1
Requirements- Wia Dot One Buy yours here
- Wia PIR Motion Detector Buy yours here
- Micro USB Cable Buy yours here
- Battery Power Pack Buy yours here
- Account on Wia
- Account at WiaYou will need to be registered and /or logged in to your Wia account at https://www.wia.io/.
- Set up your Dot OneYou will need to have a set up Dot One and you can find the tutorial on how to do that Here.
- Set up your code projectNow you will need to create a space and then a code project on your Wia Dashboard
Figure 2
Insert the PIR Motion Detector module on top of the Wia Dot One. Take care to connect the module pointing in the correct direction as shown on the picture below. You will notice that the rounded corners of the boards correspond to each other when inserted correctly.
Figure 3
Setting Up Block Project- For this project we will be using block projects to set up our Motion Detector on the Wia Dashboard.
- To start off go to your dashboard, open a space and create a block.
- Go to the Comms tab and drag the block Connect to WiFi onto your workspace.
- In the Logic tab you will find an If/Do block. This allows us to express a condition. Drag this block and connect it underneath your WiFi block.
- Open Wia > Modules and drag the block Motion Detected onto your diagram. Connect it to the right side of the [If] word.
- Now in Wia > Cloud drag the Create Event block and connect it just right of the Do word.
- Then change the event name from "my-event" to "security-alert". Complete!
- Your block diagram should look something like Figure 4.
Figure 4
Setting Up the Flows- On your Wia Dashboard go to the flows tab and create a new flow.
- Go to the trigger tab and drag a node Event Created into the workspace and change the name of the event to the name you set in the code (Motion Detected) and select your Dot One from the list.
- Next go to the Action tab and under Wia select Notification and you can choose if you want all users in your space to receive the notification or specific ones as well as what you would like the notification to say.
- Then connect the two nodes, turn on the flow, and your device is set up!
Congratulations and Well Done on completing the tutorial, hope you enjoyed it.
Here's another to keep you entertained - Get the beer of the day to display on your TFT screen
If you are more into building and making your own electronic devices and hooking them up to the cloud, why not out some of these tutorials
Coffee Counter with TFT Screen and Button
Slack Toggle Presence with Wia Button Module and Dot One
or build something from our hackster projects
Comments