# Gassistant

18,187

135

34

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.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## 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)

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

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):

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.

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.

Disconnect the ESP from Uno, put the battery on.

## 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.

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 :) )

## Recommendations

• ### Internet of Things Class

22,831 Enrolled

## 34 Discussions

Nice blog. Thank you.

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

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!

3 replies

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.

Nice Idea however, you guys didn't think the safety aspect through.

1. In event of a leak, you need to make sure that your device is not able to generate spark or acts as an ignition source. This mean that your circuitry and power source need to be either intrinsically safe or housed inside a spark-proof container.

2. Agree with some previous comments, LPG sensors is the way to go. LPG will always sink to the ground and spread. So, the sensor will pick it up fast.

3. Replace the wood with high density plastic. You can experiment with high quality birch plywood... they are way more stable than wood. Epoxy coats will enhance the stability of the ply as well.

4. Conserve battery by activating the scale only once every hour or longer. But the LPG sensor shall be polled every minute.

Hope these points will make it to your brainstorming sessions but please don't overlook the safety part.

5 replies

I'm trying to think of a scenario where a 5v non-relay circuit could ever cause a spark, & short of a, well, short, it isn't possible. Even a dead short with regular 1.5v batteries isn't going to ignite the gas unless it starts a fire somehow.

@_soapy_ & PravinG,

I'm thinking about spark issue too. It seems not possible with those little circuit & little batteries. I just saw a Spark Gap Igniter which can generate small spark from 5V on sparkfun.com. From my little knowledge, it is impossible to have spark from 5v without an igniter. Am I right?

iot_lab, although in normal use, spark is unlikely, in event of malfunction the potential is there. Consider cases of short-circuit or the power supply failing... Just explore these scenarios and apply the relevant standards. :)

hi soapy

you don't wanna take this risk. In the LPG business we go extra long distance to make sure all equips are certified IS. The hazards of LPG warrants it. Just take the extra step and be safe than sorry.

Possibly a better way to do this would be
to reverse it. Turn the entire thing upside down, and make a hard-point
hanging location the sensors would be on. Then hang the tank from the
sensor/ hard-point at the ceiling with one central rope from which three
or four ropes can be threaded through the valve guard and back up to
where the central rope ends, using an 'S' hook that has been closed on
one end.

I know that having the tank hanging could cause it to
swing if bumped or possibly wind. But, this idea would work - provided
the tank could be kept in a corner or even a small cabinet built for the
purpose(provided the cabinet had NO floor or base that would hold
leaking gas in). It would also solve the authors' wish to reduce the
sensors and prevent the gas from getting too close to a possible ignition source.

Leaking gas can be smelled instantly, so don't need to do anything. Add gauge pressure to check at any time the remaining gas in the bottle.

Se podria usar el mecanismo interno de una bascula hogareña , yo la uso para saber si se esta acabando el gas de la bombona del calentador .

Sobretodo en invierno

exelente idea , tenia una idea preistorica de lo que tu hiciste felicitaciones , mi idea era soloamente de confort para saber cuando se esta por agotar la bombona de butano para reemplazarla .

siempre me toca en fin de semana con gassinstan lo voy a solucionar saludos gracias por el aporte

Nice work, and a great idea.

As regards using only one strain gauge, you can change the design so the strain gauge is in the middle, and the CNC'd stand acts like a hydraulic cylinder or air pump, moving in only one axis. You'll likely need to add some plastic strips (UHMWPE is very low friction) or polish the wood with wax to get reasonably smooth motion, but it should work if the load is central.

One strain gauge will save a lot of battery versus 3, as well as the amplifiers, & cut costs massively too.

With the other battery saving tips here, like only taking a measurement every minute, only transmitting a change, etc. you should be fine to at least triple your battery life.