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


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


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


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.


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.

<p>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</p>
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. <br>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.
<p>I don't know about other Asian countries, but in Indonesia, one can purchase the connecting valve with a gauge on it that shows &quot;Full&quot; to &quot;EMPTY&quot; and graded steps in between. (about USD 5/-)</p><p>As to leaks, here one can also purchase for less than USD 2/- a &quot;tie-down&quot; that engages the valve to the tank with a tightening handle. Hard to get a leak when the valve is completely tied down! </p>
<p>Know any website to buy it??</p><p>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</p>
<p>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&quot;micro tech&quot; store that sells tools.</p>
<p>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&quot;micro tech&quot; store that sells tools.</p>
<p>Nice Idea however, you guys didn't think the safety aspect through.</p><p>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. </p><p>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.</p><p>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.</p><p>4. Conserve battery by activating the scale only once every hour or longer. But the LPG sensor shall be polled every minute.</p><p>Hope these points will make it to your brainstorming sessions but please don't overlook the safety part.</p>
I'm trying to think of a scenario where a 5v non-relay circuit could ever cause a spark, &amp; 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.
<p>@_soapy_ &amp; PravinG,</p><p>I'm thinking about spark issue too. It seems not possible with those little circuit &amp; 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?</p>
<p>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. :) </p>
<p>hi soapy</p><p>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.</p>
<p>Possibly a better way to do this would be <br>to reverse it. Turn the entire thing upside down, and make a hard-point <br>hanging location the sensors would be on. Then hang the tank from the <br>sensor/ hard-point at the ceiling with one central rope from which three<br> or four ropes can be threaded through the valve guard and back up to <br>where the central rope ends, using an 'S' hook that has been closed on <br>one end.</p><p>I know that having the tank hanging could cause it to <br>swing if bumped or possibly wind. But, this idea would work - provided <br>the tank could be kept in a corner or even a small cabinet built for the<br> purpose(provided the cabinet had NO floor or base that would hold <br>leaking gas in). It would also solve the authors' wish to reduce the <br>sensors and prevent the gas from getting too close to a possible ignition source.</p>
<p>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. </p>
<p>Se podria usar el mecanismo interno de una bascula hogare&ntilde;a , yo la uso para saber si se esta acabando el gas de la bombona del calentador .</p><p>Sobretodo en invierno</p>
<p>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 .</p><p>siempre me toca en fin de semana con gassinstan lo voy a solucionar saludos gracias por el aporte </p>
Nice work, and a great idea. <br><br>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. <br><br>One strain gauge will save a lot of battery versus 3, as well as the amplifiers, &amp; cut costs massively too. <br><br>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.
<p>Nice idea. But why are you sending the reading over the internet if you could cheaply add a LED and/or a piezo beeper?</p>
<p>Great idea. Thanks for sharing.<br>We thought more about the scenario when we are away (from home) and forgot the fast &amp; easy way. Definitely will add it to the next version.</p>
Here in the states the gas has mercaptan added so if there's a leak it smells like rotten eggs, that way you know something's wrong with the tank or the plumbing, that alone will save lives. Apparently where you're from they don't have such a thing, if it's available to the masses at a low cost to the consumer the gas company needs to add it. I wish you the best on marketing your Gassistant especially if it will save lives. Keep tinkering.
<p>Freely after Johann Wolfgang von Goethe: But why look so far afield when there is so much close at hand?</p>
<p>LoL. Yah, to re-think, we over-thought and skipped the simple but close feature.</p><p>We were visioning (and dreaming big) something like <a href="https://www.instructables.com/member/Zodiac69" rel="nofollow">Zodiac69</a> mentioning: a device within a smart home. I am making an air-monitor. Won't miss it this time</p>
Maybe I am mistaken, but isn't the gas heavier than air? If I'm right and you're planning to eventually go with a DC power pack instead of a battery, couldn't a gas sensor be used for detecting a leak? If it were mounted inside with the load sensors ( basically directly beneath the tank), I would imagine it could detect a leak much more quickly than monitoring a slow but steady decrease in tank weight. This would also eliminate false alarms due to prolonged use of the gas.
<p>Using a gas sensor is really a better idea.</p>
<p>That assumes the leak is in the vicinity of the cylinder. </p>
Fair enough, I did not consider leaks farther from the cylinder, but that leads me to wonder if mounting it on the outside as near the floor as possible might help rectify that error.
<p>Wonderful idea and obviously really useful for your purposes. Nicely done!</p><p>I don't think you need three strain gauges. Anybody please correct me if I'm mistaken, but if the gauges are arranged as an equilateral triangle won't the load be evenly split? I'd build two supports and one gauge, all carefully leveled. Multiply the reading of the one gauge by 3 to get the total weight of the container, right?</p>
<p>Theoretically, you are correct. However, you yourself pointed out the 2 major flaws: </p><p>1: &quot;All carefully leveled&quot; (this would include the floor the unit and tanks sits on.)</p><p>2: also dealing with &quot;leveling&quot;...unless the tank sits *precisely* in the (calculated) center of the floating table; it would give you an erroneous reading (*very* likely.)</p>
<p>Wouldn't it be easier in most cases to just hang the tank from a steelyard balance? You could make one of those from any hardware store.</p><p>https://en.wikipedia.org/wiki/Steelyard_balance</p>
<p>Very cool, and practical but unfortunately I can't easily build one here in Nepal. Is there a commercial product product with the same functions? Just today I heard about an explosion that killed one father, and maimed the mother, all in front of little children. </p>
I didnt read much discussion about &quot;creep&quot; but this may be my fault for not reading carefully on my cell phone.<br><br>But biggest issue detecting a slow leak, i believe is the phenomenon called &quot;creep.&quot; It is natural for the sensor that is at roughly 80%+ of its capacity tonsignificantly change output over time as the strain in the sensor relaxes. But it is much less of an issue if your sensors are nonbeing used at their limit
<p>Great and alredy inpiring optimizations :)</p>
<p>Great idea!</p><p>To reduce power consumption make one measurement per day, for example, send the data to the thingspeak.com and place the ESP8266 in sleep mode. The next day the ESP8266 wakes up, makes all measurement and sleeps again.</p>
<p>Great idea, very practical. I made a scale to weigh birds that land on our feeder with a similar load cell, but connected locally by Bluetooth LE to a display. The 2 AA batteries last 3 weeks or so in intermittent use.</p>
<p>I think this is a great idea.<br>I have not played with it, but if it could track gas usage, energy consumption, this can be very useful for users that want to link gas usage to home automation systems like Domoticz as not all users that use gas have gas meters. Even rural users can then see how much energy they consume.</p>
<p>This is amazing! What a truly great idea! </p>

About This Instructable




Bio: We are the IoT R&D group at AxonActive Vietnam.
More by iot_lab:Gassistant 
Add instructable to: