Stuck with LCD Display and Black Blocks

Discussion in 'Homework Help' started by hunterage2000, Oct 24, 2012.

  1. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    I have been trying to get this LCD Display to work but I get a row of Black squares when I power it up. I have followed

    I havnt used the switches for the enable or data inputs I have just directy wired D7-4 to GND and D3-0 to +5VDC to the LCD to initialize it. Apparently the blocks are because of the contrast setting but I have tried values from 50 ohms (very high contrast) to 1000 Ohms (Very faint contrast) and nothing happens. Im expecting a block to the far left to blink on and off.

    Also I think the LED Backlight doesnt work. I have tried using a 100 ohm resistor between the +5VDC line and the +backlight pin but nothing seems to happen, just the blocks.

    Can anyone suggest and ideas why this is happening and what I can do to fix it?
  2. BMorse

    AAC Fanatic!

    Sep 26, 2009
    You can not initialize an LCD that way, you have to send it commands to tell it what it is, (2 Line x 16 chars, 4 Bit mode, etc....).

    Connecting a 100 Ohm resistor to the backlight probably fried the LED's, you should have tried a higher one for 5 volts, typical value would have been a 330 Ohm, unless of course it is an EL back light, then you would need an Inverter driver to power it.
  3. hunterage2000

    Thread Starter Senior Member

    May 2, 2010
    It worked for the guy in the link, I also tried this with an arduino and this code:

    Code ( (Unknown Language)):
    2. #include <LiquidCrystal.h>
    3. // Initialize the library with the numbers of the interface pins
    4. LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // Create an lcd object and assign the pins
    5. void setup() {
    6. lcd.begin(16, 2); // Set the display to 16 columns and 2 rows
    7. }
    8. void loop() {
    9. // Run the seven demo routines
    10. basicPrintDemo();
    11. }
    12. void basicPrintDemo() {
    13. lcd.clear(); // Clear the display
    14. lcd.print("Basic Print"); // Print some text
    15. delay(2000);
    16. }
    and in the arduino book it used a 10k res with the constrast and a 220 res with the backlight to get the same row of black blocks. The voltage out of the arduino is about 4.63V.

    Is there a way I can test if the LED is fried? Also any suggestions on why the code didnt work
  4. BMorse

    AAC Fanatic!

    Sep 26, 2009

    I doubt what you did would work for the guy in the tutorial since you did not follow his instructions, he had wired the switches to emulate a controller writing the commands to the LCD, you have not done this so it will not work the way he was showing.

    As for the code, where is the main subroutine that calls the setup routine.
  5. HonT

    New Member

    Oct 25, 2012
    To test the LED, you can perform a blinking LED test.

    I think it is somewhere on Arduino's official tutorial resources