In this article we’re going to go through the steps of setting up a 16/2 LCD on an Arduino, we know a lot of articles out there already that shows how to do this but today we are going to go through pretty much every function available in the liquid crystal library and show you what each one does and how to use it and where to put it in your code. We will show you how to set up the LCD on the Arduino.
How to set up the LCD on the Arduino
- Setup the LCD connects the jumper wire from pin 1 of the LCD over to a ground rail.
- From pin 2 of LCD connect a jumper wire to the positive rail.
- Then from pin 3 to the LCD, jumper wire to the middle pin of a 10K potentiometer. The potentiometer allows you to adjust the contrast of the characters.
- Now run a jumper wire from pin to the LCD over to the digital pin 12 of the Arduino.
- Then connect another jumper wire from pin 5 of the LCD to ground.
- After following point 3, from the pin 6 of the LCD, connect a jumper wire over to the digital pin 11 of the Arduino.
- And working from the other side pin 16 of the LCD connects to ground.
- Now, it’s time to connect the 220-ohm resistor from pin 15 of the LCD to the positive rail.
- From the pin 14 of the LCD than that jumper wire over the digital pin 2 of the Arduino.
- Now, connect the pin 13 of the LCD with the pin 3 of the Arduino.
- After this you will connect the pin 12 of the LCD with the pin 4 of the Arduino.
- Now, connect the pin 11 of the LCD with the pin 5 of the Arduino.
- Now, the last step of connecting is to connect the one outside of the potentiometer to the ground and connect the other side of the potentiometer with the positive rail.
- And then obviously connect the rails of your breadboard over the ground.
- And five volts pin of the Arduino and your LCD you should line up.
- Now, you will get the bunch of gibberish right now! Because you don’t have uploaded any kind of code on your board but you can do an amazing thing and that is just for the contrast, adjust the potentiometer. You can also replace the 220ohm resistor with the potentiometer and with that, you can easily adjust the brightness of the backlight.
After step 16, you are allowed to upload the code on your board. For uploading the code, you will need an Arduino editor via which you can easily upload your code. And Enjoy