Hello, I would like to ask for advice.
I am trying to connect 16x2 LCD display type RAYSTAR RC1602B5-LLH-JWV to Arduino Nano, but it does not work at all. SCL and SDA pins of LCD are connected to pins A5 and A4 of Nano, see recommended connection diagram noted in attached datasheet.
Output from I2C LCD guesser:
i2c device found at address 0x3E
Device found: MCP23008
Only supports PCF8574
Regarding I2C backapack of the LCD, there is no visible external modul. The expected I/O expander for I2C is built in the display PCB.
The Nano is not original one, it is a cheap version denoted as „precision clone“. It works without any problems with ordinary no name 16x2 LCD display, using library <LiquidCrystal_I2C.h> included in standard installation of IDE.
Can you advise please?
Thanks for the accurate model number. This enabled me to Google for the item on my PC.
In future, it is best to post a clickable link to your actual purchase. Then readers can identify from a Tablet or phone.
Your LCD is designed for native I2C only. Whereas most 16x2 are native Parallel with an I2C backpack.
Install hd4470.h library via IDE Library Manager
Your device is native I2C. So you will use the hd44780_I2Clcd i/o class.
It looks like the user must install the pullup resistors (4.7K) on SDA and SCL lines. Either with external pullups or pullups on the Arduino board (if strong enough).
I am pretty sure that the hd44780ioClass/hd44780_I2Clcd diagnostic tools will tell you if pullups are present.
The Wire.h library enables the internal pullups. Which will probably make the LCD work even though the values are out of I2C spec.
The module does not have pullups. I suggest that you add external pullups e.g. 4k7
The hd44780ioClass/hd44780_I2Clcd examples should all work.
Note that you can select different I2C Slave addresses. I suggest that you just connect pins 7, 8, 12 to GND. (SA0, SA1, CSB)
On a 5V system you connect a 270R between pin#3 and GND. Leave Pin#15 as n/c.
Pin 15 is Vee which you can use if you are running on a 3.3V system i.e. variable resistor between 3 and 15
Pin 15 is Backlight Anode on most 16x2 LCDs.
I asked for re-opening as I have been struggling with this display, and finally managed to get it to work. So I would like to share my findings. The screen is very nice when it works, it is SO MUCH better than the white-on-blue crap, less ghosting, way better contrast, no piggyback board making it awkward to build in projects.
On a 5V system you connect a 270R between pin#3 and GND. Leave Pin#15 as n/c.
Pin 15 is Vee which you can use if you are running on a 3.3V system i.e. variable resistor between 3 and 15
Pin 15 is Backlight Anode on most 16x2 LCDs.
This goes wrong as pin 3 should have a negative voltage, and pin 16 must connect to GND to enable the backlight:
There is no need to use resistors
You must use the HD44780 library by Bill Perry! Others won’t work.
The address is 0x3C
You must connect pin 16 to the ground, and place a potentiometer of 10kΩ between GND and pin 15. Now connect the middle pin of the potentiometer to pin 3. This is because Pin 15 makes -5V, and the contrast setting pin needs somewhere around -1 to -2V to have a readable screen. At 0V or above you simply don’t see anything. I was having the software right at several occasions yet not seeing anything, it was because of this. After I figured this out (it is wrong in most documentation PDF’s!) I found out you can see a very slight bit of your program on extreme angles in plenty of ambient light if you don’t do the pin 3 trick right.
If you don’t have a potentiometer, a dirty fix is to connect pin 3 and 15 directly. This will not deliver the best contrast setting, but at least you will see what you are coding.
Working code:
#include <Wire.h>
#include <hd44780.h> // install hd44780 library by Bill Perry
#include <hd44780ioClass/hd44780_I2Clcd.h>
#define LCD_COLS 16
#define LCD_ROWS 2
#define LCD_ADDR 0x3C // address RC1602B5-LLH-JWV
hd44780_I2Clcd lcd(LCD_ADDR);
uint8_t musicNote[] = { //costom music note bitmap
B00100,
B00110,
B00101,
B00101,
B00100,
B01100,
B11100,
B11000
};
void setup() {
lcd.begin(LCD_COLS, LCD_ROWS);
lcd.createChar(0, musicNote); // setup custom character 0 as music note
// position 0-15 are available for custom characters
lcd.clear();
}
void loop() {
lcd.setCursor(0,0);
lcd.print(“Custom character”);
lcd.setCursor(0,1); // move to next line
lcd.write(0); // draw custom character 0, the music note
delay(1000);
}