Monitor if the door or the valve gas is open… or if someone opened the cookie jar!
the project is simple, a switch connected to the Artik Cloud.
The program running on the genuino MKR1000 check the status of the switch and collect every change for 15 minutes.
The battery must be 700mAh minimum
Every 15 minutes the mkr1000:
- connect to the wifi
- turn on the on board led
- send an update to Artik Cloud with all the changes registered (open/close events)
- disconnect from wifi
- turn off the on board led
- start to register event again
There are also another counter I missed in the diagram: failed attempt. This counter is increased everytime the device try to send the data over the cloud and it fails.
where can I use it?
I imagined to use the device to monitor:
- a door
- a gas valve
- ..a cookie jar! My preciooous
Replicate the project
Part of the following tutorial are adapted from the artik.cloud tutorial, here: https://developer.artik.cloud/documentation/tutorials/
Create the IOT Device
Go to the Developer Dashboard to create a private device type.
- 1. First, sign into the ARTIK Cloud Developer Dashboard, https://developer.artik.cloud/. If you don’t have a Samsung account, you can create one at this step.
- 2. Click “+ New Device Type”.
- 3. Name this device type “Door Sensor” and give it the unique name such as “com.example.iot.doorsensor”.
- 4. Click “Create Device Type”. This creates the device type and takes you to the device types page.
Create a manifest for the “Door Sensor” device type.
- 1. Click “Flame Sensor” in the left column.
- 2. Click “Manifest” and then “+ New Version”.
- 3. Add 3 Fields:
- – “open” type Integer
- – “closed” type Integer
- – “failed” type Integer
- 4. Click “Save” and “Next Actions”.
- 5. Leave actions empty , and click on “Save New Manifest”
Now a new “Door Sensor” Device is available.
- 1. Go to Artik Cloud https://www.artik.cloud/ (sign in, if you are not) and than on the Dashboard click to connect a new device.
- 2. Choose “Door Sensor”: just start typing on the box to filter the search.
- 3. Click on “Connect Device…”. You are taken back to the dashboard.
- 4. Click the Settings icon of the device you just added. In the pop-up, click “GENERATE DEVICE TOKEN…”.
- 5. Take note (copy) the device ID and device token on this screen.
Read more: Door Sensor
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw