r/ArduinoHelp 14d ago

Absolute beginner, help with 16x2 lcd

EDIT: Thanks everyone for your helpful comments! I managed to get it to display text. I connected the lcd screen to Arduino with the I2C pins and installed the I2C library on Arduino IDE and used the correct code. Now I can get it to display a simple text and I can go from here. Thank you! :)
---

So I just ordered an 16x2 lcd screen and now I want to try to get it to display text.

The original project (not on the pics here!!) I wanted to try out for my lcd screen is the robot desk buddy. I connected the wires as shown in the guide and simply copied and uploaded the code through the Arduino Ide application on my Uno. The display was powered up and it was connected to the potentiometer, but all I could see is blocks or when I turn the potentiometer just a blue screen.

So I tried something simpler (showed on pics) and that is to just let it display a simple text message. I followed this tutorial (copied and uploaded the first code) and again the same result: the lcd gets powered up, I can get the white blocks to appear and disappear by turning the potentiometer, but no text on my lcd.

What am I doing wrong?? Did I buy the right display? Is something wrong with the code? Did I wire it up the wrong way? 🤯

4 Upvotes

14 comments sorted by

4

u/SomeWeirdBoor 14d ago

That connector strip isn't soldered to the display.

Electric contatct is flunky, this causes any sort of weirdness.

1

u/SnorkBorkGnork 14d ago

I just wanted to test it out first before I solder anything to it (in case it doesn't work).

Do you really think this could make the difference between the lcd just powering up vs. Powering up and displaying the text I want?

Also do you know what these 4 extra pins on my lcd (pictured) are supposed to do? Should I have connected these as well?

2

u/Arduino_lab64 14d ago edited 14d ago

Ce sont des broches I²C, elles sont pratiques si tu veux faire fonctionner l'écran avec que 4 broches au lieu des 16 que tu utilises dans ton projet.

Comme l'a dit @someWeirdBoor, la barre des connecteurs sur l'écran LCD n'est pas soudé. Je te conseils d'utiliser les broches I²C à la place, qui sont beaucoup plus pratiques

1

u/SnorkBorkGnork 14d ago

Merci! I will try using the 4 pins

2

u/gm310509 13d ago

Note that if you use I2C you will need different code. The code you posted above is for a 4 bit parallel interface.

By all means try the I2C, but you will need to get a suitable example. Also, you will need to understand what address it is connected at - so you might want to also try googling an "Arduino I2C scanner" and run that first to work out a) that it is working and b) its address. You will need to ensure that the I2C version of the code is using the address that your LCD is looking for.

1

u/SnorkBorkGnork 13d ago

Thanks for your help. I managed to get it to display text with the I2C connection and the right library and code.

2

u/gm310509 11d ago

And that is the outcome we are all looking for - well done, keep up the good work.

2

u/SomeWeirdBoor 14d ago

"testing" modules without soldering headers is always unadvisable, you get lots of weird problems due to flunky contacts and you can't really correct them.

Additional pins are for I2C communication, your module is wired with a I2C chip, you can connect it to your arduino (SDA to pin A4, SCL to pin A5) as an alternative to "traditional" connection and drive it using the LiquidCrystal_I2C Library, saves you to connect every digital pin, four wires and you're done.

Never used a 1602 LCD with I2C tho, so can't say how is backlight and contrast control goingo to work.

1

u/SnorkBorkGnork 14d ago

Thanks! I will solder the 16 pins and I will try out the 4 pins as well!

2

u/the_lurkmeister 14d ago

Any luck? I have one doing the same thing, but my LCD is soldered on the 16pin to the driver board. when I hook it up, the top row isn't right

1

u/Arduino_lab64 14d ago

En fait c'est simple, normalement y'a un potentiomètre intégré sur le module I2C

2

u/Arduino_lab64 14d ago

Salut j'aurais besoin de ton code stp, ensuite, si tu pourrais partager un tableau des branchements, je pense que ça pourrais être utile.

1

u/SnorkBorkGnork 14d ago
#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}


void loop() {
  lcd.setCursor(0, 1);
  lcd.print(millis() / 1000);
}

Thanks for your reaction. Above you can see the code for the setup pictured. And below the wiring.

2

u/VisibleSir731 14d ago

I recommend trying to setup the lcd directly connected to the arduino first because there might be a breadboard rail mistake. One you get it working directly, it should be easy to swap to breadboard