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:
- ESP8266 - v12. NOTE: On the yellow board we use:
GPIO_4: is 5, GPIO_5: is 4 (they are label incorrectly)
- 3 Straight-gauge loadcells (we use 20kgs loadcells)
- 3 Loadcell amplifiers
- Breadboard & male-female, male-male cables
- 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
- 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
- Connect each loadcell with its amplifier (please refer to the fritzing diagram)
- 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:
- 'Given code' (which is the Chip ID we read in the previous step)
- Name: whatever name you want to call your scale
- 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),
- 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)
- 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
- Your mobile must connect to the wifi network that you want to config for your Gassistant
- Stay close to your Gassistant (prefer <5m)
- On the Gassistant mobile app, choose Connection
- 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:
- Power: the battery only last a couple days. For long term, adapter is needed. This is not so handy and beautiful.
- 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.
37 Comments
2 years ago
Anyone willing to partner with me to produce this product so that we can market it in Africa. I will do the funding
Reply 1 year ago
yes, I am willing to do it. I am based in Rwanda. Please check your inbox my contact. Thank you
3 years ago
can the load cell be used for constant load (as the lpg cylinder is kept permanently)?
i am concerned about "creep factor"
Question 3 years ago on Step 9
Ótimo projeto.
Poderia dizer como abrir os codigo fonte no Android studio??
Question 3 years ago
apk file doesnt work shows server errror
5 years ago
Nice blog. Thank you.
5 years ago
can anyone teach me how to upload the coding using arduino? i use this wifi module
Reply 5 years ago
Do you know which version do you have?
5 years ago
EXCELLENT SAFETY IDEA!!!!
6 years ago
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
6 years ago
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.
6 years ago
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!
Reply 6 years ago
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
Reply 6 years ago
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.
Reply 6 years ago
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.
6 years ago
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.
Reply 6 years ago
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.
Reply 6 years ago
@_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?
Reply 6 years ago
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. :)
Reply 6 years ago
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.