Arduino Uno - Counting Days (LCD)

Noobie here. I'm currently making/combining a code for my project. I'll be doing a gas regulator using LCD that shows the number of days the gas cylinder tank was used. I don't have any experience of using LCD or combining codes with LCD. So if anyone has a piece of advice, I would be very grateful. :slight_smile: :slight_smile: :slight_smile: :slight_smile:

IDE -> file/examples/liquid crystal.

It is not to hard but you have a steep learning curve. Get the Arduino cookbook by Michael Margolis and read it. Also on line there are many videos etc showing the Arduino and how to do what you want. This additional information will go a long way in getting your problem solved. Once you get past this you then need to select your sensors and actuators. At that point you start on the hardware design and write your software.

It might not be abad idea to get an RTC.
http://bildr.org/2011/03/ds1307-arduino/
all you need do then is increment a counter at midnight.

Development of Arduino Based LPG Tank Switching Device through Cell Load

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "HX711.h"

LiquidCrystal_I2C lcd(0x27, 16, 2);
HX711 scale_1; //Load Cell 10kg - STOVE
HX711 scale_2; //Load Cell 20kg - LPG

const int loadCell_10kg_DT = 8;
const int loadCell_10kg_SCK = 9;
const int loadCell_20kg_DT = 10;
const int loadCell_20kg_SCK = 11;
const int solenoid = 13;

//weights in grams
int netWeight = 11000; //gas weight inside the tank
int tareWeight = 12000; //tank weight and included regulator
int stoveTop = 150; //minimum weight for kitchen utensils placement

void setup() {
pinMode(solenoid, OUTPUT);
digitalWrite(solenoid, LOW);
lcd.begin();
lcd.backlight();
lcd.clear();
lcd.print("Calibrating");
scale_1.begin(loadCell_10kg_DT, loadCell_10kg_SCK);
scale_2.begin(loadCell_20kg_DT, loadCell_20kg_SCK);
scale_1.set_scale(10);
scale_2.set_scale(73.5); //73.5 sa 12000g
scale_1.tare();
scale_2.tare();
delay(1000);
lcd.clear();
lcd.print("Device ready");
delay(1000);
}

void loop() {
long int timbStove = scale_1.get_units(10);
long int timbGas = ((scale_2.get_units(10)-tareWeight)/netWeight)*100;
int adlaw = millis()/86400000; //24 hours in seconds
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Gas level: ");
if (timbGas < 0) timbGas = 0; //To make sure the value will not be negative
lcd.print(timbGas);
lcd.print("%");
lcd.setCursor(0, 1);
lcd.print("Elapsed days: ");
lcd.print(adlaw);
if (timbStove > stoveTop) digitalWrite(solenoid, HIGH);
else digitalWrite(solenoid, LOW);
}

I'm posting an update regarding this topic. Due to covid19, our project was postponed many times. I haven't met my groupmates for more than 8 months. Thank God, we got it.
Thank you for your help and ideas. I appreciate it so much.

Electronics near an LPG tank need to be safety approved. This is not a task for an amateur project, as
you might be creating a source of ignition and endangering life and limb.