I will Connect Arduino LCD without Potentiometer Register & I2C Module. We will use 20 X 4 display in this tutorial because it has 20 characters each line. If you wish to buy, then buy this version. The process of connection will be the same for all the version.
To see the output from Arduino, we need to connect LCD display with it. There is mainly two version of LCD display is available in the market. One is 16X2 display which has 2 lines & another one is 20X4 display which has 4 lines.
The LCD module can be connected to an Arduino board in 3 ways:
- Direct connection from the LCD module to the Arduino board without POT.
- Direct connection from the LCD module to the Arduino board with POT.
- LCD Module and Arduino board connected through an I2C Module.
I will show the first process in this post to Arduino LCD without Potentiometer Register & I2C.
There is another alternative for LCD display which is OLED display. See the following post for that.
Components Used:(Click to Buy)
Connection Setup Arduino LCD without Potentiometer
We have to connection using the following Table. In the left hand side, the pin numbers of LCD display is written. Numbering of the pins are started from left to right i.e 1 to 16. If you find any problem if numbering, you can see the connection diagram below.
|LCD Pin||Arduino Pin|
Now we have completed our connection. We have to upload the code.
Code Explain Arduino LCD without Potentiometer
The code is a very simple one. In line 7, an LCD object is created with the connected data pin values passed as the parameter. These pins are the pins which we have connected via jumper wires. In line 6, we are setting an integer as the contrast value. this will work as a fake Potentiometer or POT. In line 11, we are writing analogue values of the fake pot. Basically LCD module with think it is a POT. So this value is 145 here. It may be different on your system. Kindly change its value between 0 to 500 and check on which point you are getting a clear display. This is pretty much like trial & error method. Once you get the clear output, note that value & use it in every program.
Arduino Sketch for Arduino LCD without Potentiometer
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
lcd.print("Enjoy the Day");