I am hoping there is a simple fix to this problem.
I am playing around with a 16x2 lcd with a I2C connector attached. I wired it up to an elegoo uno R3.
I started with some code I've used before and ended up with one row of the LCD fully lit and the other dark.
After a ton of trouble shooting, I can not get the LCD to show anything but one lit and one dark row.
In this image:
Power: 5V, 1.5A
Pin | LCD | Uno |
---|---|---|
SCL | SCL | SCL |
SCA | SDA | SDA |
+ | VCC | 5V |
gnd | gnd | gnd |
I've also tried:
- putting the SDA to A4 and the SCL to A5
- Using different power supplies
- Powering from the USB connector
And I've tried several of the libraries available
They are all variations of the following from the Adafruit_LiquidCrystal library:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup()
{
// initialize the LCD
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();
lcd.print("Hello, world!");
}
void loop()
{
// Do nothing here...
}
No matter what I do the display does not change.
-
There should be a potentiometer for the contrast. Turning it ccw will make the text visibleSBF– SBF2023年07月08日 18:51:29 +00:00Commented Jul 8, 2023 at 18:51
-
I've played with that. There is no position where text is visible. The top row is fully lit and the bottom row off. When I turn the pot, the lit crystals dim evenly to nothing.Andrew Staroscik– Andrew Staroscik2023年07月08日 19:09:03 +00:00Commented Jul 8, 2023 at 19:09
-
1Maybe try an I2C scanner to verify the I2C address which your code assumes is 0x276v6gt– 6v6gt2023年07月08日 21:10:01 +00:00Commented Jul 8, 2023 at 21:10
-
That fixed it. The scanner found the i2c at 0x3f. Everything is working. Thank you!Andrew Staroscik– Andrew Staroscik2023年07月08日 21:52:30 +00:00Commented Jul 8, 2023 at 21:52
-
@6v6gt, if you could create an Answer and Andrew if you could accept it, that would make this Q & A perfect for anyone else in the same predicament.st2000– st20002023年07月09日 00:16:31 +00:00Commented Jul 9, 2023 at 0:16
2 Answers 2
Some common problems with LCD displays which incorporate an I2C backpack include:
- Not using the correct I2C address for the I2C backpack. Use an I2C scanner to discover the correct address.
- Mixing voltages without proper level shifting, say using a 5v display with a 3.3v MCU
- Failing to adjust the contrast potentiometer
- Some I2C backpacks may use a non-standard pin allocation which may be corrected by specifying a pin mapping in the constructor to the display library. Fortunately, this is rare.
- Using code samples intended for a different variant of the library supporting the display. Always use a basic test sketch which is packaged with the chosen library to verify the performance of the display.
Apparently I have the same problem. I did what was said over and over again but I couldn't get a display. I found that my problem was due to a manufacturer's defect. The 5th pin (rw) from the left of the I2C package was not soldered at all. However, I had seen this pin unsoldered before and thought it should be like that. I hope it helps someone.