Liquid Filling Machine Using Arduino Flow Rate Sensor

Tuesday, September 25, 2018

Liquid Filling Machine Using Arduino Flow Rate Sensor

35 comments :

Liquid Filling Machine Using Arduino Flow Rate Sensor





CODING OF THIS PROJECT:-
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#define Password_Length 4

int signalPin = 12;

char Data[Password_Length]; 
char Master[Password_Length]; 
byte data_count = 0, master_count = 0;
bool Pass_is_good;
int customKey;
int sum=0;
const byte ROWS = 4;
const byte COLS = 4;

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 1};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

byte statusLed    = 13;
byte sensorInterrupt = 0;  // 0 = digital pin 2
byte sensorPin       = 2;

// The hall-effect flow sensor outputs approximately 4.5 pulses per second per
// litre/minute of flow.
float calibrationFactor = 1;

volatile byte pulseCount;  

float flowRate;
unsigned int flowMilliLitres;
unsigned long totalMilliLitres;

unsigned long oldTime;
LiquidCrystal_I2C lcd(0x3F, 16, 2);

void setup()
{
  lcd.begin();
  lcd.backlight();
  pinMode(signalPin, OUTPUT);
  
  // Initialize a serial connection for reporting values to the host
  Serial.begin(9600);
   
  // Set up the status LED line as an output
  pinMode(statusLed, OUTPUT);
  digitalWrite(statusLed, HIGH);  // We have an active-low LED attached
  
  pinMode(sensorPin, INPUT);
  digitalWrite(sensorPin, HIGH);

  pulseCount        = 0;
  flowRate          = 0.0;
  flowMilliLitres   = 0;
  totalMilliLitres  = 0;
  oldTime           = 0;

  // The Hall-effect sensor is connected to pin 2 which uses interrupt 0.
  // Configured to trigger on a FALLING state change (transition from HIGH
  // state to LOW state)
  attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}

/**
 * Main program loop
 */
void loop()
{
      lcd.setCursor(0,0);
  lcd.print("Entr Amont in ml");
customKey = customKeypad.getKey();
  if (customKey){
    Data[data_count]=customKey-48; 
    lcd.setCursor(data_count,1); 
    lcd.print(Data[data_count]); 
    sum=sum+Data[data_count];
    data_count++; 
    }
    if( data_count==3)
    {    
 digitalWrite(signalPin, HIGH);
 delay(990*sum);
  sum =sum*100;
 lcd.setCursor(0,1);
lcd.print(sum); 
digitalWrite(signalPin, LOW);
     clearData();  
  }
   
   if((millis() - oldTime) > 1000)    // Only process counters once per second
  { 
    detachInterrupt(sensorInterrupt);
    flowRate = ((1000.0 / (millis() - oldTime)) * pulseCount) / calibrationFactor;
    oldTime = millis();
    flowMilliLitres = (flowRate / 60) * 1000;
    // Add the millilitres passed in this second to the cumulative total
    totalMilliLitres += flowMilliLitres;
     unsigned int frac;
     // Print the flow rate for this second in litres / minute
    Serial.print("Flow rate: ");
    Serial.print(int(flowRate));  // Print the integer part of the variable
    Serial.print("L/min");
    Serial.print("\t");       // Print tab space
    // Print the cumulative total of litres flowed since starting
    Serial.print("Liquid Quantity: ");        
    Serial.print(totalMilliLitres);
    Serial.println("mL"); 
   Serial.print("\t");       // Print tab space
  Serial.print(totalMilliLitres/1000);
  Serial.print("L");
    
   
    
// Reset the pulse counter so we can start incrementing again
    pulseCount = 0;
    
    // Enable the interrupt again now that we've finished sending output
    attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
  }
  if(sum < totalMilliLitres ){
      digitalWrite(signalPin, LOW);
    lcd.clear();
      lcd.setCursor(0,1);
   lcd.print ("In=");
     lcd.setCursor(3,1);
lcd.print(sum); 
     lcd.setCursor(0,0);
  lcd.print ("Amount Delivered");
    lcd.setCursor(6,1);
   lcd.print (",Out=");
  lcd.setCursor(11,1);
  lcd.print(sum,DEC);   // print the Flow Rate
  lcd.setCursor(14,1);
  lcd.print ("ml");
   delay(60000);
   lcd.clear();
    clearData();
   } 
}
void pulseCounter()
{
  // Increment the pulse counter
  pulseCount++;
}
void clearData(){
  while(data_count !=0){
    Data[data_count--] = 0; 
  }
  return;
}



35 comments :

  1. sir in the circuit diagram part which pins are for 16*2 lcd plz rply

    ReplyDelete
    Replies
    1. A5-SCL, A4-SDA
      If you connect 1602 lcd with i2c.
      Thanks

      Delete
    2. i use i2c lcd module for connecting the lcd or arduino directly

      Delete
  2. Where is the ground pin on circuit diagram?

    Also where is the flow rate sensors pin is connect? Please make it understandable.

    ReplyDelete
    Replies
    1. j5 header block pin2 is ground.i use female header for input purpose in which you driectly connect flow sensor to arduino ic with female headers

      Delete
    2. if you want to make this project then you contact me on facebook messenger go facebook search projects and products

      Delete
  3. Hi sir.would you mind if you give me the full code

    ReplyDelete
  4. sorry sir, what is X1 on schema? is that capasitor? if that is capasitor, then what value on that? thanks sir

    ReplyDelete
  5. While viscosity level will always play a part in the filling principle used for any given packaging project, it is not as important when it comes to choosing the automation level. Overflow fillers, gravity fillers, pump filling machines and piston fillers are all available in different levels of automation. The starting automation level for a packager will most often be based on the production requirements and the available space to perform the packaging. powder filling machine

    ReplyDelete
  6. lcd.begin(); error

    Arduino: 1.8.10 (Windows 8), Board: "Arduino/Genuino Uno"

    C:\Users\GOPAL\Documents\Arduino\auto_fill\auto_fill.ino: In function 'void setup()':

    auto_fill:49:13: error: no matching function for call to 'LiquidCrystal_I2C::begin()'

    lcd.begin();

    ^

    In file included from C:\Users\GOPAL\Documents\Arduino\auto_fill\auto_fill.ino:2:0:

    C:\Users\GOPAL\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:58:8: note: candidate: void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)

    void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );

    ^~~~~

    C:\Users\GOPAL\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2/LiquidCrystal_I2C.h:58:8: note: candidate expects 3 arguments, 0 provided

    Multiple libraries were found for "Keypad.h"
    Used: C:\Users\GOPAL\Documents\Arduino\libraries\Keypad-3.1.1
    Multiple libraries were found for "Wire.h"
    Used: C:\Program
    Multiple libraries were found for "LiquidCrystal_I2C.h"
    Used: C:\Users\GOPAL\Documents\Arduino\libraries\LiquidCrystal_I2C-1.1.2
    exit status 1
    no matching function for call to 'LiquidCrystal_I2C::begin()'

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    ReplyDelete
  7. Sir I want to make this.how can I contact you ?

    ReplyDelete
  8. Good articles, Have you heard of LFDS (Le_Meridian Funding Service, Email: lfdsloans@outlook.com --WhatsApp Contact:+1-9893943740--lfdsloans@lemeridianfds.com) is as USA/UK funding service they grant me loan of $95,000.00 to launch my business and I have been paying them annually for two years now and I still have 2 years left although I enjoy working with them because they are genuine Loan lender who can give you any kind of loan.

    ReplyDelete
  9. @Projects&Products Hello, sir I have a plan of doing this project for my home use so if possible could you please give me the schematic, PCB design, and coding along the list of components to be used.

    ReplyDelete
  10. How if I wanted to use it for selling a liquid; in this case I should set price per unit and instead of inputting the quantity, I be typing in the amount of money the customer has.
    Your help will be highly appreciated

    ReplyDelete
  11. Sir can I get the materials list, PCB design and the Gerber file? I am trying to implement this project as well. Your work is the only project that compatible to my project idea sir. If you can help me, I would be really greatful.
    kalpani.me26@gmail.com

    ReplyDelete
  12. Thanks for sharing this blog with us. This blog is very amazing, and informative also. I got some important points related to Filling Machine

    ReplyDelete
  13. Thanks for sharing this blog with us. I got some important points related to Liquid Filling Machine In India

    ReplyDelete
  14. Hey, Are you looking for Pouch Packing Machine. Get the best Chips Packing Machineand Powder Packing Machine at low prices. Visit our website omautopack.com.

    ReplyDelete
  15. Thank you for your wonderful work
    Can you provide me with the names of the parts along with their values that I used?

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Thank you for your wonderful work
    Can you provide me the names of the parts with their values that you used?

    ReplyDelete
  18. Thanks for sharing such amazing information. we are appreciate. what will be cost of if we want work on other project share your mail id so we will discuss regarding.

    ReplyDelete
  19. Send me circuit diagram with pin details

    ReplyDelete
  20. Sir can you give me your mob. No.

    ReplyDelete
  21. Reading this write-up will inform you about the hot and sizzling market of filling machines these days. As technology is constantly advancing, filling machines would always have a perfect place in the store!

    ReplyDelete
  22. Great Blog Admin, Thank you for sharing the informative blogs. Keep on sharing such kind of useful information with Us. Get know More About Contract Filling Services.

    ReplyDelete
  23. The code is not complete,
    Where's the pin of the relay responsible to stop the pump.
    Also the code is the same as in the example dilivred with IDE Arduino
    Copie and paste.

    ReplyDelete
  24. Also there's no relation between the code and the schematic.
    No comments!!!

    ReplyDelete
  25. મોબાઇલ નંબર આપશો ભાઈ

    ReplyDelete