Improve facility management by taking into account actual usage based on real time measurements.
This example shows how a sensor can count visits to optimise cleaning based on usage rather than rigid fixed schedules. Now you can measure the number of toilet visits and inform you when this number exceeds 20 visits. Facility services can indicate by pushing the button when their cleaning job is done, and this action will reset the counter.
count-visits
under File > Examples > arduino-nbiot-rdk-master.If you did the first application on the previous page, your device is ready for use, and you can continue and run the example.
If not, please complete the following step.
keys.h
file located in the arduino-nbiot-sdk-master
Library folder, by default you can find it in:DeviceID
and DeviceToken
values with the values that can be found under Device Settings > Authentication section of your device in the Maker Application. In the keys.h
file you will notice that the APN is already pre configured and should not be changed.1 | /**** |
Simply hit the upload icon in the Arduino IDE. This will save the sketch, compile it and upload it to your Arduino.
After uploading, you might need to flip the power switch on the Sodaq Mbili OFF and back ON to make sure the Mbili reboots and starts up our sketch.
You can now watch the values change in Maker.
Alternatively, you can open the Tools > Serial monitor of the Arduino IDE.
- Make sure you select the correct COM port to listen (under Tools > Port )
- When the monitor is open, make sure the Baud rate is set to 57600
We want to get notified with the visit count:
1 | When counter >= 20 |
For a simple rule like this, we can use the rules wizard.
Time to create our rule!
That’s it! When your asset receives a count above 20, you now will get notified!
The count only resets when the button is pushed, meaning cleaning is done.
To visualise our date, we will create a pinboard. For more information on pinboards, please check how to use pinboards.
Now we will pin a control (visual representation) for our Counter asset to visualise the amount of visits.
You can pin the same asset multiple times. Pinning the asset to visualise it both as a historical chart and a label may give you an even better look!