Tuesday, April 2, 2024

Connecting 128x4 LCD to arduino Nano

Use the u8glib library hello world to verify the code and following should be the constructor. 

Constructor used: 
U8GLIB_ST7920_128X64 u8g(4, 3, 2, U8G_PIN_NONE); 
or 
U8GLIB_ST7920_128X64 u8g(A0, A1, A2, U8G_PIN_NONE); 

1 -> Gnd 
2 -> Vcc 
4(RS) -> A2/D2 
5(R/W) -> A1/D3 
6(E) -> A0/D4 
19 -> Vcc 
20 -> Gnd 

 Troubleshooting: 
1. LCD doesn't show the characters even after connecting the nano and verifying the code on uno.       
 Solution: I used Vin pin of the nano to power the lcd, it should have been 5v pin instead.