When starting any IoT project, the most important materials needed for data collection are sensors. However, buying each individual sensor and finding places to store them can become a hassle, especially as you start making more and more projects. Luckily, there are at least ten high-tech sensors in a device that we use almost everyday: our smart phones. From accelerometers, gyroscopes, pressure and light sensors, to GPS, these devices can be utilized to gather the necessary data to start numerous IoT projects.
One of the best and easiest ways to collect, visualize, and analyze that smart phone data is with uBeac. uBeac is a versatile IoT platform for centralized digital transformation, data integration, and visualization. uBeac’s IoT hub allows you to connect, process, and visualize real-time data in a secure way. In conjunction with the Data Collector app, you will be working on your IoT projects in no time.
Signing up with uBeac is easy. You just need to add your email and create a password to get started. Next, you must create a team. This is also very simple, involving just a name for the team, a code name, and an address. Once you have finished this, you will arrive at a blank homepage for your team.
Now that you have your team set up, you need to create a gateway to connect all of your devices. From the uBeac homepage, click on the Gateways module and add a new gateway. Under the General tab, create a UID and name for your gateway. For your purposes in this tutorial, select Data Collector Application to be your gateway. Next, under the HTTP tab, there will be two gateway URLs: one HTTP and one HTTPS. These will be used to connect to your phone. Click submit to add the gateway.
Data Collector is an Android-based app that collects data from many sensors and sends it in JSON format to an unlimited number of servers at specified times using HTTP, HTTPS, Web Socket, and/or Web Socket Secure.
Data Collector comes with four modules: Sensors, Servers, Tasks, and Settings. The Sensors module displays a list of all sensors connected to the device. Clicking on each sensor will display the current data that is being read from that specific sensor. The Servers module allows the user to add an unlimited number of servers to read the sensor data. The Tasks module lets users assign what, where, when and how data will be sent from the Android device to the servers. Finally, the Settings module indicates the general parameters such as server timeout times and the format of the sent data.
For more information on Data Collector, visit https://unismart.tech/projects/data-collector/.
On the Data Collector app, select the Servers module and add a new server. Provide a name for this server and add one of the Gateway URLs from uBeac. Click save to add the server.
Next, you need to create a task to send to the server. Select the Tasks module and add a new task. Give this task a name, then choose the sensors that will be used from your phone. Select the server you had just created, and add a sampling time for how often you want Data Collector to send data to uBeac. Once this is completed, click save to add the task.
Finally, in Settings, select Data Format and select all options except Strict JSON. Once this is complete, it's time to work with uBeac.
Go back to uBeac and select the Gateways module to see that a device has been added to the gateway. If you click your gateway, you can see all the HTTP POST requests that your Android is sending to uBeac. If you select the Devices module and click on the newly added device, which is the Android device, you can find all the data that each sensor is sending to uBeac.
Now that you have all of this raw data, you can use the Dashboards module to visualize it.
Having a dashboard to visualize your incoming data is really useful, especially if you want to analyze and utilize the data afterwards. First, you must setup the dashboard. Go to the Dashboards module and add a new dashboard. Pick a name for the dashboard then click submit. A blank dashboard will appear, which you can customize however you want. On the top right corner of the dashboard page, click the clipboard icon to start editing the dashboard.
You can select widgets such as indicators, charts, and device tracker to help you visualize your data. For example, if you were to make an indicator for the phones ambient light sensor you would first drag and drop the indicator widget onto the dashboard. Next, you would click the “connect to data” button to edit the widget's settings. This includes changing the display icon, selecting the device to collect data from, and other features that are unique to each widget. Once you are satisfied with your widget, save your progress. You can continue doing this for as many widgets as you would like.
Below are some examples of dashboards that you can make with just the sensors on your phone.
While the dashboards display your live sensor activity, it does not show your previous data. That is kept in the Reports module. There, you can find all historical records of your sensor data, dating back to when you would have installed the sensor. You can also get reports from your entire gateway. These data can be filtered by date, time range, device, and sensor. Finally, if you need to use this data for another project, you can export it in JSON or in CSV.
This is how you can use uBeac to create a dashboard from your phone's sensors. Now you can use it for numerous projects, such as keeping track of where and how you have traveled to and from work, and what you can do to optimize your trip. The possibilities are yours!