This is my first ever post on here and it is due to a recent personal project i started on a Mega 2560 board. (I was attempting to build a temp and humidity sensor for which i would need to display the values on a LCD display). At first, i built the circuit according to a reference project and i noticed the LCD screen would light up only the first half of the screen (it would be lit up white boxes) img1
Then, assuming my LCD display is not working, i took everything apart and built an initialization LCD circuit.. in which i have read that it should display boxes on the top row. But, when i wire it up very basically, it just lights up but nothing happens. Can anyone tell me whether my LCD might be broken? (I have purchased 3 up till now and would hate to return to the store for ANOTHER broken LCD)
Kindly provide any advice or insight you may have to offer ( I am a complete beginner in Arduino)
I have attached all the pictures of my circuit wiring and of the LCD display.
EDIT 1: I rewired the circuit to include a resistor for contrast (V0; did not use a potentiometer because when i did use it.. it did not make any difference when changing the resistance) I also placed a 100ohm resistor for the backlight (pin A).
The code I used:
#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() { // set up the LCD's number of columns and rows:
lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); }void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis() / 1000); }
Also, i have uploaded a close up picture of my LCD and there seems to be a faint 'Dark' spot towards the middle of the display.. does that imply it is damaged?