Each month my wife is finding huge difficulty while cooking in morning with less time (before office) due to LP gas cylinder suddenly come to end without any clue of refill time. Then to refill the cylinder we need to move on to several retail outlets due to out of cylinder stock which is really time consuming. My wife tried several ways to predict the refill time and she put remainder on her phone after a month from the date of cylinder refill or even she tried to find a pattern how she consume gas for cooking to predict the time remain in advance which all went unsuccessful and till now we face the problem on each month. I even conduct a research of 20 families (in market near 5 million domestic users in Sri Lanka) and out of all confirmed (100%) that they meet the same major issue and not found any fix solution other than keep checking the cylinder weight to predict roughly. Also I found a manual meter to check gas level of cylinders which is using by industrial LP gas users (agricultural | hospitals | construction & hotels) but they need to check the level manually to know the time remain.
Idea & SolutionThe solution I design is to introduce a new intelligence system (fully automated) with infrastructure consist of smart digital gas cylinder holder (connected smart device), mobile app (for domestic user to connect and for POS outlets to connect & manage real time stock) and web application (for large scale of LP Gas supplier to connect & monitor distribution) which integrate on cloud.
The idea behind here is to build a socially acceptable IoT system which support to overcome above major challenges face by every domestic user (refill time | manage gas consumption) with one cylinder and also to provide a smart system to manage industrial multiple gas cylinders (refill time | real time consumption pattern).
Smart Device (Gas Utilizing Unit)At first phase of development I designed & build the smart gas cylinder holder prototype which has following features to ensure user safety, to manage consumption and to predict refill time.
- Prototype has two sensors to measure cylinder weight+ time remain of refill and to alert in case of gas leakage (beep sound & led indicator).
- Display gas cylinder level & weight, remain time of refill and gas availability as a percentage.
- Embedded system to connect, monitor & control, device used a combination of ArduinoMKR1000board andArduino UNO.
- Device connect toMicrosoft Azure IoT SuitewithMicrosoft Azure Mobile Service.
- Each device identify with unique ID. (for domestic single cylinder | for industrial each cylinder in bulk)
- Each user can get analytical timely report of gas consumption pattern withMicrosoft Power BI tool.
1. Install Arduino Software (IDE) and set up from here.
2. To set up your MKR1000 can follow guideline here.
3. I used few libraries to develop this device as follow
- Adafruit_ILI9340 -https://github.com/adafruit/Adafruit_ILI9340
- Adafruit-GFX-Library -https://github.com/adafruit/Adafruit-GFX-Library
- RTClib -https://github.com/adafruit/Adafruit_ILI9340
- ArduinoJson -https://github.com/bblanchon/ArduinoJson
- HX711 -https://github.com/bogde/HX711
4. You need an Azure account and you can create a free trial here.
Project InstructionsStep 1: To build the embedded circuit please follow the schematic at GCU Unit Sketch.fzz
Step 2: The sketch files at Arduino Uno - arduino_uno_gcu_sketch.ino and MKR1000 - mkr1000_gcu_sketch.ino need to be upload. Before upload MKR1000 - mkr1000_gcu_sketch.ino need to set up as follow:
char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "secretPassword"; // your network password (use for WPA, or use as key for WEP)
const char *device_id = "yourDeviceName";
// Azure Mobile Service address
// You can find this in your service dashboard
const char *server = "yourMobileServerName"; // servername.azure-mobile.net
// Azure Mobile Service table name
// The name of the table you created
const char *table_name = "tableName";
// Azure Mobile Service Application Key
// You can find this key in the 'Manage Keys' menu on the dashboard
const char *ams_key = "applicationKey";
Step 3: To create a new Microsoft mobile service
Follow these steps to create a new azure mobile service using the web management portal.
1. Log into the Azure classic portal. At the bottom of the navigation pane, click +NEW. Expand Compute and Mobile Service, then click Create.
2. In the Create a Mobile Service dialog, select Create a free 20 MB SQL Database, select JavaScript runtime, then type a subdomain name for the new mobile service in the URL textbox. Click the right arrow button to go to the next page.
3. In Name, type the name of the new database, then type Login name, which is the administrator login name for the new SQL Database server, type and confirm the password, and click the check button to complete the process.
Next, you will add a new table in which to store device data. This table will be used by the device in place of the sensors value collection.
Step 4: Add a new table to the mobile service
To be able to store app data in the new mobile service, you must first create a new table in the associated SQL Database instance.
1. In the Azure classic portal, click Mobile Services, and then click the mobile service that you just created.
2. Click the Data tab, then click +Create.
This displays the Create new table dialog.
3. In Table name type Cylinder, then click the check button. This creates a new storage table Cylinder with the default permissions set. This means that anyone with the application key, which is distributed with your app, can access and change data in the table.
4. Click the new Cylinder table and verify that there are no data rows.
5. Click the Columns tab. Verify that the following default columns are automatically created for you:
Once your table is created, it is very simple to insert data using the Mobile Services REST API. Before you can send requests though, you will need to retrieve your Application Key, which is used to authenticate the API calls. You will find it from the Dashboard page, using the “manage keys” button at the bottom of the screen. The little popup that shows up will display two keys, and you will need to copy the “application” one.
Step 5: Power BI Connecting to Azure SQL Database
Power BI has a multitude of Azure connections available, and the business intelligence solutions you can create with those services are as unique as your business. You can connect as few as one Azure data source, or a handful, then shape and refine your data to build customized reports.
To get started, click Get Data at the top of the navigation pane.
Select the Azure SQL Database entry in the list on the left. You can use the Search box to help narrow down the list. In order to connect, you need to specify the server and database name, as well as your username and password to connect with.
Start your learning journey through Power BI to click here.
Step 6: Run the project.
Comments