I can make flow sensor 2 flow each liter/min. and collect the flow value, display through both i2c 20x4 lcd screen and using node mcu

I can make flow sensor 2 flow each liter/min. and collect the flow value, display through both i2c 20x4 lcd screen and using node mcu can display through google sheet using the same arduino, please know the coding thanks

certainly possible - have you selected a flow sensor and LCD screen?
upload the code you have implemented so far using code tags </>

Yes, you can.
Keep it simple and stupid.

Run some tutorials for the hardware selected.
If you are happy with the results of the tutorials you can merge these to your project.

Have a nice day and enjoy coding in C++.

I just got one code on all my devices.

#include <LiquidCrystal_I2C.h>
 LiquidCrystal_I2C lcd(0x27, 16, 4);
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
 
int X;
int Y;
int led = 3;
float TIME = 0;
float FREQUENCY = 0;
float WATER = 0;
float TOTAL = 0;
float LS = 0;
int Pulses = 4;
volatile int pulsecount;   
volatile int i=0;     
void setup()
{
Serial.begin(9600);
lcd.init();
lcd.backlight();         
lcd.clear();
lcd.setCursor(2,0);
lcd.print("WaterFlowmeter");
lcd.setCursor(2,1);
lcd.print("****************");
delay(2000);
pinMode(Pulses,INPUT_PULLUP);
pinMode(led,OUTPUT);
attachInterrupt(digitalPinToInterrupt(Pulses), CountPulses, FALLING);
}
void loop()
{
X = pulseIn(Pulses, HIGH);
Y = pulseIn(Pulses, LOW);
TIME = X + Y;
FREQUENCY = 1000000/TIME;
WATER = FREQUENCY/7.5;
LS = WATER/60;
if(FREQUENCY >= 0)
{
if(isinf(FREQUENCY))
{
Serial.println(TIME);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Flow:0.00");
lcd.setCursor(0,1);
lcd.print("Total :");
lcd.print( TOTAL);
lcd.print(" L/H");
}
else
{
TOTAL = TOTAL + LS;
Serial.println(FREQUENCY);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Flow:");
lcd.print(WATER);
lcd.print(" L/M");
lcd.setCursor(0,1);
lcd.print("Total :");
lcd.print( TOTAL);
lcd.print(" L/H");
}
delay(1000);
   }
  }
void fflow(){
  pulsecount = 0;  //Start counting from 0 again
  i=0;             //Reset led toggling variable
  interrupts();    //Enables interrupt on arduino pin 3
  delay (1000);    //Wait 1 second 
  noInterrupts();  //Disable the interrupt
}
void CountPulses()
{
    pulsecount++; //Increment the variable on every pulse
    //On every pulse toggle the state of led.
    if(i%5==0)
    digitalWrite(led,HIGH);
    else
    digitalWrite(led,LOW);
    i++;
}

does the flow sensor readings display on the LCD OK
what do you want the WiFi connection to do? e.g. run on web server on the NodeMCU to display sensor readings - remote web browser can can to view the readings

Simply display the flow values on Google Sheets and a remote web browser can view the readings.

have a look at esp32-web-server-sent-events-sse
run some example code to get an idea of functionality
then create a basic web server and add the flow sensor to it
when that works add the LCD

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.