Go Down

Topic: Correct way to hook up OM1621 LCD to arduino? (Read 4833 times) previous topic - next topic

skorpion_

Jan 06, 2014, 04:29 pm Last Edit: Jan 06, 2014, 05:58 pm by skorpion_ Reason: 1
Hi
I have an OM1621-G3S/80331A 16x2 LCD with green backlit that I'm trying to hook up to my Arduino UNO rev3

The datasheet for the LCD is located here:
http://www.channel-microelectronic.de/ch_html_de/lcds/pdf/om1621spec_r1.pdf
From datasheet:
Code: [Select]

pin 1 LED+
pin 2 LED-
pin 3 Vss
pin 4 Vdd
pin 5 V0
pin 6 RS
pin 7 R/W
pin 8 E
pin 9 DB0
pin 10 DB1
pin 11 DB2
pin 12 DB3
pin 13 DB4
pin 14 DB5
pin 15 DB6
pin 16 DB7


Back in the past (around 2003) I hooked it up to the paralell-port using this schematic:
http://geekjoan.com/joan/lcd2/ritning1_liten.gif
This doesn't appear to be a HD44780 compatible LCD, but ST7066U / S6A0070A according to the datasheet.
I couldn't find a schematic for this controller hooked up to arduino, so I used the HD44780 schematic as a basedrawing.

All I get is the background to light up, no characters at all :/

I hooked it all up this way:
Code: [Select]
OM1621 16x2 green backlit

 Pin No.  Symbol  Description                  Connection (on Arduino)
 1        LED+    LED Anode                    5V+
 2        LED-    LED Cathode                  22/52/82 ohm > GND (should be 100 ohm pot)
 3        VSS     Ground Potential             GND
 4        VDD     Power Supply                 5V+
 5        V0      Contrast Adjustment Voltage  Leg 2 10K Pot (Leg 1->18Kohm->5V+, Leg 3->GND)
 6        RS      Register Select Signal       Pin 12
 7        R/W     Read/Write Select Signal     Pin 10
 8        E       Data Read/write enable       Pin 11
 9        DB0     Code I/O Data LSB            Pin 9
 10       DB1     Code I/O Data 2nd Bit        Pin 8
 11       DB2     Code I/O Data 3rd Bit        Pin 7
 12       DB3     Code I/O Data 4th Bit        Pin 6
 13       DB4     Code I/O Data 5th Bit        Pin 5
 14       DB5     Code I/O Data 6th Bit        Pin 4
 15       DB6     Code I/O Data 7th Bit        Pin 3
 16       DB7     Code I/O Data MSB            Pin 2

I do not have a 100 ohm pot so I tried using 22/56/82 ohm resistor instead. That shouldn't make a difference, or?

The code I'm using is this:
Code: [Select]
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins

//Works for QC1602
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//Test for OM1621 (currently not working)
//LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)
LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

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);
}


Any suggestions?

EDIT: I tried to look into the -2 to +2 contrast adjusting. If I measure with my multimeter, I can only see positive voltage on V0. So maybe thats why I don't see any characters? How do I accomplish a negative voltage on my circuit?

Best regards
Niclas Gustafsson

floresta

#1
Jan 06, 2014, 06:07 pm Last Edit: Jan 06, 2014, 11:53 pm by floresta Reason: 1
Quote
Any suggestions?


The  ST7066U is essentially the same as an HD44680 so the LiquidCrystal library and the sketch from the tutorial should work.

Your device has it's 16 pins below and to the left of the display itself.  Most LCD modules with this configuration have a non-standard pinout so you will not be able to use the connections shown in the tutorial diagrams although the pin names themselves will be the same.

So, you have to determine the actual pinout for your device.  See if you can find any pin numbers on your module.  If you find none then go with the assumption that the pins are in the same order as on the datasheet, starting with pin 1 near the edge of the board near the center of the board (it's on the datasheet).


Don

raschemmel

I haven't heard of anyone using DB0- DB3.
You can ground the R/W.  There is really no need for it since you are only going to be Writing to the LCD.
The attached illustration shows UNO-5,4,3,2 connected to LCD D4,D5,D6,D7, respectively.
Have you already tried grounding R/W , deleting D0 -D3 from the Constructor and hooking it up
per the attached illustration which matches the constructor below ?
Code: [Select]
//Works for QC1602
             //LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


raschemmel

Like this:
Code: [Select]
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);



Pin No.  Symbol  Description                  Connection (on Arduino)
  1        LED+    LED Anode                    5V+
  2        LED-    LED Cathode                  22/52/82 ohm > GND (should be 100 ohm pot)
  3        VSS     Ground Potential             GND
  4        VDD     Power Supply                 5V+
  5        V0      Contrast Adjustment Voltage  Leg 2 10K Pot (Leg 1->18Kohm->5V+, Leg 3->GND)
  6        RS      Register Select Signal       Pin 12
  7        R/W     Read/Write Select Signal    GND
  8        E       Data Read/write enable       Pin 11
  9        DB0     Code I/O Data LSB            N/C
  10       DB1     Code I/O Data 2nd Bit       N/C
  11       DB2     Code I/O Data 3rd Bit        N/C
  12       DB3     Code I/O Data 4th Bit        N/C
  13       DB4     Code I/O Data 5th Bit        Pin 5
  14       DB5     Code I/O Data 6th Bit        Pin 4
  15       DB6     Code I/O Data 7th Bit        Pin 3
  16       DB7     Code I/O Data MSB            Pin 2

Keep in mind that anyone who creates a reference document that mixes DB0 through DB7 with LSB through MSB is
somehow missing something. If they have to tell you tell you that DB0 is the LSB and DB7 is the MSB then they are
probably just a paper pusher.  Anyone else would know this. Have you ever heard of DB0 being the MSB ?
(Big ENDIAN/LITTLE ENDIAN doesn't apply here because we are discussing H/W documentation, not S/W.

skorpion_

On the LCD, the first and last pin are numbered 1 & 16
I measured with my multimeter:
pin 1 leads to A on the backlit
pin 2 leads to K on the backlit
pin 3 leads to GND
So the pinout from the datasheet seem to be correct:
Code: [Select]
pin 1 LED+
pin 2 LED-
pin 3 Vss
pin 4 Vdd
pin 5 V0
pin 6 RS
pin 7 R/W
pin 8 E
pin 9 DB0
pin 10 DB1
pin 11 DB2
pin 12 DB3
pin 13 DB4
pin 14 DB5
pin 15 DB6
pin 16 DB7


I've tried all these:
Code: [Select]
//LiquidCrystal(rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7)
//LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);
//LiquidCrystal lcd(12, 11, 9, 8, 7, 6, 5, 4, 3, 2);
//LiquidCrystal lcd(12, 10, 11, 5, 4, 3, 2);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
//LiquidCrystal lcd(12, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9);
//LiquidCrystal lcd(12, 11, 2, 3, 4, 5, 6, 7, 8, 9);
//LiquidCrystal lcd(12, 10, 11, 2, 3, 4, 5);
//LiquidCrystal lcd(12, 11, 2, 3, 4, 5);

None worked :(
Grounding R/W did not make a difference

The datasheet states:
Code: [Select]
5 V0 Contrast Adjustment Voltage Adjust the contrast by changing the
supply voltage from -2V to 2V.

How do I accomplish a negative voltage?

Thanks for helping me out!

Best regards
Niclas

raschemmel

Your contrast should be fine with a 10k pot wired as you showed it.  The optimum contrast is a voltage
between 0.5Vdc and 1.0 Vdc, so you should be ok.
Does the backlight work with an 82 to 100 ohm resistor ?

Quote
I've tried all these:


LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

When you tried this one you grounded R/W, left D0 - D3 not connected and wired
  6        RS      Register Select Signal             Pin 12
  7        R/W     Read/Write Select Signal     GND
  8        E       Data Read/write enable           Pin 11
PIN-13: D4 - UNO-5
PIN-14: D5 - UNO-4
PIN-15: D6 - UNO-3
PIN-16: D7 - UNO-2

and used THIS:"LiquidCrystal lcd(12, 11, 5, 4, 3, 2);"

INSTEAD OF THIS : LiquidCrystal lcd(12, 10, 11, 9, 8, 7, 6, 5, 4, 3, 2);

Right ?

raschemmel


skorpion_


Does the backlight work with an 82 to 100 ohm resistor ?

When you tried this one you grounded R/W, left D0 - D3 not connected and wired
  6        RS      Register Select Signal             Pin 12
  7        R/W     Read/Write Select Signal     GND
  8        E       Data Read/write enable           Pin 11
PIN-13: D4 - UNO-5
PIN-14: D5 - UNO-4
PIN-15: D6 - UNO-3
PIN-16: D7 - UNO-2

and used THIS:"LiquidCrystal lcd(12, 11, 5, 4, 3, 2);"

The backlight works with the 82 ohm.

Yep, I tried it exactly as in your post above.

Maybe its bricked :/

EDIT: I bought it from a store in sweden in the beginning of 2000-something. I used this schematic to hook it up with the paralell-port on my PC then.
http://geekjoan.com/joan/lcd2/ritning1.gif

floresta

#8
Jan 06, 2014, 08:40 pm Last Edit: Jan 06, 2014, 08:45 pm by floresta Reason: 1
There is no sense in 'trying' a bunch of different constructor statements.  There is only one correct statement for any given circuit.  In order to determine which one is correct we have to know which pin of the LCD (using names, not numbers) is connected to which pin of the Arduino.

In your original post you have used an 8-bit interface and you have incorporated the R/W line.  There's nothing wrong with this, but it does tie up more I/O lines than necessary.  The constructor that you used was correct for that wiring, so the problem lies elsewhere, most likely in the requirement for a negative contrast voltage or possibly in your interpretation of the LCD pin numbers as I said previously.

What I suggest that you should now do is disconnect all of your wires and start over using the following outline. This is based on a standard outline that I have been posting for a while but I have modified it (changes are in red) slightly for your situation.

(1) Get the backlight working properly.  This involves only pins
1 and 2 on your LCD module.  Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly.  This involves only pins
3, 4, and 5 on your LCD module.  You should be able to see blocks on one row of a two row display and on two rows of a four row display.

Your module may very well require a negative voltage for the contrast.  You can get this from a second power supply or from a battery.  Leave the potentiometer connected to +5V and pin 5 but disconnect the other end of the pot from GND.  Connect the + end of your second supply to GND and the - end to the bottom of the pot and see if that works.

NOTE:  The Arduino has not been used yet, except as a possible source for the power needed for the first two steps.  Do not try to go any further until this is working.  If you don't see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six
(or 10) control and data wires between your LCD module and your Arduino.

(5) Upload your sketch and it should work.

If that doesn't work then what we need to see is a photograph of your setup that allows us to follow each wire from the LCD module to the Arduino.  We also have to see the code that you are using with that setup.

Don

raschemmel

According to the schematic you used originally with your PC, you did not use negative voltage then so
I don't see how anything should be different now.  I think your best bet is to try to simulate your PC
setup.  It's too bad you can't reconnect it to your PC to see if it still works. 

skorpion_

#10
Jan 06, 2014, 09:23 pm Last Edit: Jan 06, 2014, 09:26 pm by skorpion_ Reason: 1

There is no sense in 'trying' a bunch of different constructor statements.  There is only one correct statement for any given circuit.  In order to determine which one is correct we have to know which pin of the LCD (using names, not numbers) is connected to which pin of the Arduino.

In your original post you have used an 8-bit interface and you have incorporated the R/W line.  There's nothing wrong with this, but it does tie up more I/O lines than necessary.  The constructor that you used was correct for that wiring, so the problem lies elsewhere, most likely in the requirement for a negative contrast voltage or possibly in your interpretation of the LCD pin numbers as I said previously.

What I suggest that you should now do is disconnect all of your wires and start over using the following outline. This is based on a standard outline that I have been posting for a while but I have modified it (changes are in red) slightly for your situation.

(1) Get the backlight working properly.  This involves only pins
1 and 2 on your LCD module.  Make sure to use a current limiting resistor if there is none on the LCD module.

(2) Get the power and contrast working properly.  This involves only pins
3, 4, and 5 on your LCD module.  You should be able to see blocks on one row of a two row display and on two rows of a four row display.

Your module may very well require a negative voltage for the contrast.  You can get this from a second power supply or from a battery.  Leave the potentiometer connected to +5V and pin 5 but disconnect the other end of the pot from GND.  Connect the + end of your second supply to GND and the - end to the bottom of the pot and see if that works.

NOTE:  The Arduino has not been used yet, except as a possible source for the power needed for the first two steps.  Do not try to go any further until this is working.  If you don't see the blocks then no amount of program code will help.

(3) Connect the LCD R/W pin (pin 5) to GND.

(4) Connect the six
(or 10) control and data wires between your LCD module and your Arduino.

(5) Upload your sketch and it should work.

If that doesn't work then what we need to see is a photograph of your setup that allows us to follow each wire from the LCD module to the Arduino.  We also have to see the code that you are using with that setup.

Don


Thanks for the outline! I remember that I've seen those chunks of blocks earlier when playing around with LCDs (but not on this project)

Did you mean to hook it up like the attached picture?
Or did I get something wrong?

I used 4 1.2V AA batteries as external supply for the negative voltage
The other supply is the 5v+ and GND from the arduino (no data pins connected)
The pot is 10K ohm and the resistor between GND and lcd_pin_2 is 22ohm

Best regards
Niclas

floresta

Your circuit connections look correct so now you should use a voltmeter to make sure the LCD is actually being powered.  You should read about 4.3 V between pins 1 and 2 and 5V between pins 3 and 4.  You should be able to adjust the voltage between pins 3 and 5 from +5 to -4.8V.  Make the measurements right on the solder blobs, near the edge of the board.

Don

skorpion_


Your circuit connections look correct so now you should use a voltmeter to make sure the LCD is actually being powered.  You should read about 4.3 V between pins 1 and 2 and 5V between pins 3 and 4.  You should be able to adjust the voltage between pins 3 and 5 from +5 to -4.8V.  Make the measurements right on the solder blobs, near the edge of the board.

Don


That trick with the external power supply was new for me.
Had to google to get some more information., pretty easy when you think about it.
However, my 4x1,2V gives 4,8V so the positive will be +5V and negative -5V and I needed +2V to -2V. I understood that will be a problem because I'm using a fixed voltage at +5V from arduino, so I can not drop it to ~+2V without giving the circuit too less power. I simply hook up the multimeter and checked to see that voltage did not rise above +2V nor sink below -2V.
Even then, there where no blocks showing on the screen :/

For some reason I've saved a fried (big crack in the chip) LCD in the same version as this, in my junkbox, so I'm not sure if this also could have been one that I've fried earlier (no visible cracks or shortcuts) and saved for later for investigation.

Thanks for all the help guys!

Best Regards
Niclas Gustafsson

Go Up