Tugas Akhir Water Flow Sensor On Arduino Uno R3 Galih NFS
|Tugas Akhir Water Flow Sensor On Arduino Uno R3 Galih NFS
Galih Naufal Falikh S
TK 13 A
NPM 13233012
Teknik Komputer Perguruan Tinggi Teknokrat Lampung
TA Water Flow Sensor Mata Kuliah Instrumentasi
Tugas Akhir Water Flow Sensor On Arduino Uno R3 Galih NFS
Tugas Akhir Water Flow Sensor On Arduino Uno R3 Galih NFS
18 Comments
maaf apa bisa minta coding ino nya untuk flowmeter ini,trims
Mas boleh minta email nya, buat sharing berkaitan dengan video-nya. Saya sedang mencoba buat juga
Terimakasih
mas bisa minta alamat untuk beli flow meternya
#include <LiquidCrystal.h>
// iNISIAL JALUR DATA KE Pcb KE ARDUINO
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
// Tentukan pin untuk dua tombol reset dan kontra indikator LED
byte resetButtonA = 11;
byte resetButtonB = 12;
byte statusLed = 13;
byte sensorInterrupt = 0; // 0 = pin 2; 1 = pin 3
byte sensorPin = 2;
// Sensor aliran lorong-efek output sekitar 4,5 pulsa per per detik
// Liter / menit aliran..
float calibrationFactor = 4.5;
volatile byte pulseCount;
float flowRate; //deklarasi flowrate
unsigned int flowMilliLitres;
unsigned long totalMilliLitresA;
unsigned long totalMilliLitresB;
unsigned long oldTime;
void setup()
{
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Galih NFS");
delay(500);
lcd.setCursor(0, 1);
lcd.print(" Production ");
delay(1500);
lcd.clear();
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Loading…");
delay(900);
lcd.setCursor(0, 1);
lcd.print("….");
delay(1500);
lcd.setCursor(4, 1);
lcd.print("…");
delay(800);
lcd.setCursor(7, 1);
lcd.print("….");
delay(1500);
lcd.setCursor(11, 1);
lcd.print("…..");
delay(1000);
lcd.clear();
// Inisialisasi koneksi serial untuk nilai pelaporan ke host
Serial.begin(38400);
// Mengatur status LED baris sebagai output
pinMode(statusLed, OUTPUT);
digitalWrite(statusLed, HIGH); // Kita LED aktif-rendah terpasang
// Mengatur sepasang tombol ulang counter dan mengaktifkan resistor pull-up internal yang
pinMode(resetButtonA, INPUT);
digitalWrite(resetButtonA, HIGH);
pinMode(resetButtonB, INPUT);
digitalWrite(resetButtonB, HIGH);
pinMode(sensorPin, INPUT);
digitalWrite(sensorPin, HIGH);
pulseCount = 0;
flowRate = 0.0;
flowMilliLitres = 0;
totalMilliLitresA = 0;
totalMilliLitresB = 0;
oldTime = 0;
// The efek Hall sensor terhubung ke pin 2 yang menggunakan interupsi 0.
// Dikonfigurasi untuk memicu pada perubahan negara FALLING (transisi dari TINGGI
// Negara bagian RENDAH)
attachInterrupt(sensorInterrupt, pulseCounter, FALLING);
}
/*
Main program loopPROGRAMNYA
*/
void loop()
{
if(digitalRead(resetButtonA) == LOW)
{
totalMilliLitresA = 0;
lcd.setCursor(0, 1);
lcd.print("0L ");
}
if(digitalRead(resetButtonB) == LOW)
{
totalMilliLitresB = 0;
lcd.setCursor(8, 1);
lcd.print("0L ");
}
if( (digitalRead(resetButtonA) == LOW) || (digitalRead(resetButtonB) == LOW) )
{
digitalWrite(statusLed, LOW);
} else {
digitalWrite(statusLed, HIGH);
}
if((millis() – oldTime) > 1000) // Only process counters once per second
{
// Disable the interrupt while calculating flow rate and sending the value to
// the host
detachInterrupt(sensorInterrupt);
//lcd.setCursor(15, 0);
//lcd.print("*");
// Because this loop may not complete in exactly 1 second intervals we calculate
// the number of milliseconds that have passed since the last execution and use
// that to scale the output. We also apply the calibrationFactor to scale the output
// based on the number of pulses per second per units of measure (litres/minute in
// this case) coming from the sensor.
flowRate = ((1000.0 / (millis() – oldTime)) * pulseCount) / calibrationFactor;
// Note the time this processing pass was executed. Note that because we've
// disabled interrupts the millis() function won't actually be incrementing right
// at this point, but it will still return the value it was set to just before
// interrupts went away.
oldTime = millis();
// Divide the flow rate in litres/minute by 60 to determine how many litres have
// passed through the sensor in this 1 second interval, then multiply by 1000 to
// convert to millilitres.
flowMilliLitres = (flowRate / 60) * 1000;
// Add the millilitres passed in this second to the cumulative total
totalMilliLitresA += flowMilliLitres;
totalMilliLitresB += flowMilliLitres;
// During testing it can be useful to output the literal pulse count value so you
// can compare that and the calculated flow rate against the data sheets for the
// flow sensor. Uncomment the following two lines to display the count value.
//Serial.print(pulseCount, DEC);
//Serial.print(" ");
// Write the calculated value to the serial port. Because we want to output a
// floating point value and print() can't handle floats we have to do some trickery
// to output the whole number part, then a decimal point, then the fractional part.
unsigned int frac;
// Print the flow rate for this second in litres / minute
Serial.print(int(flowRate)); // Print the integer part of the variable
Serial.print("."); // Print the decimal point
// Determine the fractional part. The 10 multiplier gives us 1 decimal place.
frac = (flowRate – int(flowRate)) * 10;
Serial.print(frac, DEC) ; // Print the fractional part of the variable
// Print the number of litres flowed in this second
Serial.print(" "); // Output separator
Serial.print(flowMilliLitres);
// Print the cumulative total of litres flowed since starting
Serial.print(" "); // Output separator
Serial.print(totalMilliLitresA);
Serial.print(" "); // Output separator
Serial.println(totalMilliLitresB);
lcd.setCursor(0, 0);
lcd.print(" ");
lcd.setCursor(0, 0);
lcd.print("Flow: ");
if(int(flowRate) < 10)
{
lcd.print(" ");
}
lcd.print((int)flowRate); // Print the integer part of the variable
lcd.print('.'); // Print the decimal point
lcd.print(frac, DEC) ; // Print the fractional part of the variable
lcd.print(" L");
lcd.print("/min");
lcd.setCursor(0, 1);
lcd.print(int(totalMilliLitresA / 1000));
lcd.print("L");
lcd.setCursor(8, 1);
lcd.print(int(totalMilliLitresB / 1000));
lcd.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);
}
}
/**
* Invoked by interrupt0 once per rotation of the hall-effect sensor. Interrupt
* handlers should be kept as small as possible so they return quickly.
*/
void pulseCounter()
{
// Increment the pulse counter
pulseCount++;
}
buat rangkaian yg menyambung ke arduino bagai mana mas? apa langsung apa dengan resistor?
Mas, apa bisa sensor ini dapat menghidupkan saklar pada volume tertentu yg sdh kita tentukan total volumenya? trims
masih ada mas wiringnya?
lanjukannnn gannnnn
mas habis berapa buat project ini?
thanks
minta lcd connection
mas boleh minta rangkaian skematiknya?
mantap mas . jadi bisa memperhitungkan waktu untuk ngisi air . jadi bisa di tinggal gk harus ngelihatin air nya aja ,,
#saran ane mas , hati2 lain kali kalau ingin buat video demo jgn sampe kaya gtu lagi hehe untuk gk rusak tuh laptop , kalo rusak bisa berabeee wkwkkw
bro liat scalling sensornya dong, boleh liat programnya ga om?
mantap mas, bisa bagi kontaknya mas? saya mau tanya tanya mas kalau bisa, makasih
mas bro, minta tolong mas brow, boleh minta alamat emailnya kah? @galih naufal falikh
Terima kasih
Cara kalibrasinya gimana om
Can you post your circuit please , Thank you.
fuck off