Gassistant

16,631

132

41

Posted

Introduction: Gassistant

The issue we want to address: In many Asia countries, LPG bottle exists in most household. There is a frustration when the bottle run out while cooking. Moreover, there is a risk of explosion (In Vietnam, where I live, there are some cases the bottle explored, claimed the life of innocent people).

We have ambition to make something that can help:

- detect if the household gas bottle is running out

- warn if the bottle is leaking gas (which can lead to explosion)

We come up with the idea: Based on the weight of the bottle, it can tell if the gas is running out. It also can help detect gas leaking threat based on the continuous reducing gas weight exceed a certain period.

Hence, we make the Gassitant: a device that sitting underneath the gas bottle.

Step 1: Gather Material

To build 1 gas scale, you will need the following items:

  1. ESP8266 - v12. NOTE: On the yellow board we use:

    GPIO_4: is 5, GPIO_5: is 4 (they are label incorrectly)

  2. 3 Straight-gauge loadcells (we use 20kgs loadcells)
  3. 3 Loadcell amplifiers
  4. Breadboard & male-female, male-male cables
  5. Bolts & nuts (to assemble the loadcell)

Additionally, we use a Arduino Uno for burning the source code
to ESP (A colleague suggests we use the USB UART CP2102 but we didn't buy to try because we have spare Uno from previous project)

Step 2: Make the Scale Base

If you want to CNC your base like we did, please find the AutoCAD file at

https://github.com/aavn/Gassistant/tree/master/design

Otherwise, you can create your own design ( We are interested in a solution that use a smaller number of loadcells than us, please leave us a comment if you have any suggestion).

Design:

The idea is 3 loadcells are positioned at 3 corners of an equilateral triangle. The weight will be distributed on 3 loadcells. We sum up the result to have the actual weight of the bottle.

Step 3: Assemble the Base

  1. Put the loadcells on the base: This require a little bit strength and skill with nuts & bolts. We were inspired by this setup: loadcell & platforms
  2. Connect each loadcell with its amplifier (please refer to the fritzing diagram)
  3. Connect amplifiers to ESP8266-v12:

Amplifier ------------ ESP8266

VCC ------------------ VCC

GND ----------------- GND

DT1 ------------------ GPIO_12

SCK1 ---------------- GPIO_14

DT2 ------------------- GPIO_13

SCK2 ----------------- GPIO_5

DT3 ------------------- GPIO_4

SCK3 ----------------- GPIO_16


DT1, SCK1: DT & SCK pins on the 1st amplifier.

DT2, SCK2: DT & SCK pins on the 2nd amplifier.

DT3, SCK3: DT & SCK pins on the 3rd amplifier

Step 4: Setup ESP8266 With Arduino IDE

The original source code for the Gassistant can be download from here.

For coding on ESP, we use the ESP8266 Addon on Arduino IDE.
With this approach, we can reuse most Arduino libraries for ESP. You can find the instruction how to setup here.

We use the Arduino Uno as the bridge to upload the source code to ESP. The setup as following:

Arduino Uno Reset - Arduino GND

ESP8266 ------------------ Arduino Uno

RX -------------------------- RX

TX -------------------------- TX

VCC ------------------------ 3.3V

CH_PD -------------------- 3.3V

GND ----------------------- GND

GPIO_15 ----------------- GND

GPIO_0 ------------------ GND

Also make sure that you choose the correct board type for the ESP (like the attached photo).

Find the ESP8266 chip ID (We use it as a unique ID for the scale):

Upload the ESP_chip_id sketch from

https://github.com/aavn/Gassistant/tree/master/design

to your ESP board, and note the chip ID printed on the Serial monitor. This ID will be used later when you add your scale to the cloud server.

Note:

If you want to re-upload to ESP board while it is still connecting to bridge, just unplug ESP's VCC and GPIO_0, then re-plug them before uploading new code.

Step 5: Download Gassistant Source Code to ESP

Get the source code for the Gassistant base from GasScale github

You can find the libraries needed inside the library folder. Copy them to your Arduino IDE folder.

Upload the source code to your ESP.

Disconnect the ESP from Uno, put the battery on.

Your scale is ready to go.

Step 6: Install the Android App

You can find the .apk file also in GitHub at

The app will be published on Google Play later, when we finish clean up.

Step 7: Add Your Scale to the Cloud

When adding your scale to the cloud, you will be prompted for:

  1. 'Given code' (which is the Chip ID we read in the previous step)
  2. Name: whatever name you want to call your scale
  3. Tank type: in Vietnam, we refer it as the net weigh of the gas inside (exclude the bottle weigh). In here, we have 6kg (not very common), 12kg & 13kg (these 2 types are common for household),
  4. Amount to remind out-of-gas: The Gassistant will trigger out-of-gas warning when the amount of gas in the bottle drop below this value)
  5. Alert gas usage time: The Gassistant will trigger an alert for leaking-gas-threat when it detects that gas reducing continuously exceed this period. If you (or your family member) is cooking then of course you can discard the message. Otherwise, you need to act.

NOTE: The Gassistant cannot stop the gas leaking for you. When you receive the alert, it's up to you to verify and take action if needed.

Step 8: Setup Wifi for Your Gassistant

Finally, the last step is to bring your Gassistant to your home wifi

  1. Your mobile must connect to the wifi network that you want to config for your Gassistant
  2. Stay close to your Gassistant (prefer <5m)
  3. On the Gassistant mobile app, choose Connection
  4. Enter the password for the wifi network. Press Save

We embedded the SmartConfig into the app for ease of use. If you are interested in deep knowledge how SmartConfig work, you can take a look here (I could not find the explanation for ESP SmartConfig, but after all, from what I searched around, they use the same concept)

Step 9: Source Code

If you want to get your hand dirty and modify the way your Gassistant work, please feel free to get the source from the link Gassistant. We are also interested to see any upgraded/modified versions from you :)

Step 10: Post-mortem

There are some issues that we did not have enough knowledge (& effort) to improve:

  1. Power: the battery only last a couple days. For long term, adapter is needed. This is not so handy and beautiful.
  2. Wooden case: we use wood since we think it strong enough (to be under the bottle), and non-conduction. But after a few months, it shrink a bit here and there. We do not have knowledge about material to make a better one yet (It will definitely be in our (already very long) study list :) )

You can find more information on this project at www.gassistant.org.

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

39 Comments

Nice blog. Thank you.

can anyone teach me how to upload the coding using arduino? i use this wifi module

171695649.jpg

Do you know which version do you have?

This is a really great great idea. I got a little problem, i wana try to traslate it into spanish. I try to open it with Android Studio and i cant open it... I am so newbe in this programs. Can you help me in any way? thanks a lot

Great idea! I wanted to do something similar, but just to measure amount left. I have two suggestions. The first is leak detection. You want to know that a decrease in tank weight is caused by a leak not consumption. Why not set up a flame dectector. Two bi metallic switches one N.O. one N.C. Setup with a time delay to allow lighting a flame. No flame, No consumption, assume a leak.
The second is trying to keep the cylinder from tipping while weighing. Why not use the load cells on the bottom? The sensors do not have to contact the gas cylinder just measure a change in weight right? Placing them on the very bottom accomplishes this and keeps your gas from tipping accidentally.

I don't know about other Asian countries, but in Indonesia, one can purchase the connecting valve with a gauge on it that shows "Full" to "EMPTY" and graded steps in between. (about USD 5/-)

As to leaks, here one can also purchase for less than USD 2/- a "tie-down" that engages the valve to the tank with a tightening handle. Hard to get a leak when the valve is completely tied down!

Know any website to buy it??

Here in Chile we also use these kind of tanks (5, 11, 15 and 45kg) for cooking, heating and heating bath water, and at least 2 times runs out when I was in the shower

Sorry, don't know any websites that sell these items. The gauge valves are sold at supermarkets! (along with non-gauge valves); I found the screw-down clamp at a local"micro tech" store that sells tools.

Sorry, don't know any websites that sell these items. The gauge valves are sold at supermarkets! (along with non-gauge valves); I found the screw-down clamp at a local"micro tech" store that sells tools.