You can add an LCD screen to your newly built water meter to display readings, rather than displaying them on the Arduino serial monitor. You can then disconnect your water meter from the computer after uploading the sketch on to your Arduino.
Using a Hitachi HD44780 driver compatible LCD screen and Arduino Liquid Crystal library, you can easily integrate it with your water meter. Typically, this type of LCD screen has 16 interface connectors. The display has two rows and 16 columns, so each row can display up to 16 characters.
The following image represents the top view of a Hitachi HD44760 driver compatible LCD screen. Note that the 16-pin header is soldered to the PCB to easily connect it with a breadboard.
The following image represents the bottom view of the LCD screen. Again, you can see the soldered 16-pin header.
Wire your LCD screen with Arduino as shown in the next diagram. Use the 10k potentiometer to control the contrast of the LCD screen. Now, perform the following steps to connect your LCD screen with your Arduino:
B04844_03_04.ino
from the Chapter 3
sample code folder.#include <LiquidCrystal.h>
LiquidCrystal lcd (RS, ENABLE, DB4, DB5, DB6, DB7)
:LiquidCrystal lcd(8, 7, 6, 5, 4, 3);
lcd.begin(number_of_columns, number_of_rows)
:lcd.begin(16, 2);
lcd.setCursor(column, row)
:lcd.setCursor(7, 1);
lcd.print()
function to print some text on the LCD screen:lcd.print(" ml/s");
You can see some information on the LCD screen such as pulses per second, water flow rate, and total water volume from the beginning of the time:
3.148.144.228