Pages: [1]   Go Down
Author Topic: LCD pin connection  (Read 1380 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I 've seen some pictures of 16x2 LCD connected to Arduino Uno.All of those pictures show that the Digital I/O of Arduino which are used,are 2,3,4,5,11 and 12.
I 'd like to ask if this is a standard.I have to use these pins exclusively?
Thanks!
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have to use these pins exclusively?
No.  This misconception is the result of inadequate documentation.  If you look hard enough you will find the complete documentation, but it is not provided with most examples.

Here's how I would have done things:

Code:
//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Here is how you find the Arduino documentation:


And there it is under 'Syntax', how could you have missed that?

Don
« Last Edit: April 24, 2012, 09:28:56 am by floresta » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23718
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Could look into Serial displays (RS232, I2C, SPI) as well, use even fewer pins

http://www.newhavendisplay.com/index.php?main_page=index&cPath=253&zenid=a4ba23a73425b7ed09dd2f20457e4b05
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Sr. Member
****
Karma: 0
Posts: 339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PLus the fact that LCD's might have funny disposition of pins( example-15,16,1,2,3,etc)
Logged

10 LET Loop=Infinite
20 GO TO 10

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok,i wired everything like this link http://arduino.cc/en/Tutorial/LiquidCrystal

i run the example 'Hello,world' and everything was fine except the fact that the backlight doesn't work.
i must tell you that i used a 4.7K potentiometer (instead of 10K in the example) but i see that the resistor effects on the characters contrast and not on the backlight.Character contrast works properly.When i turned it all right the characters go off,when i turned all left characters go too black.
here is a foto to see my wirings as better as it's possible

http://www.flickr.com/photos/79759011@N05/6996395366/

From left to right,the wires are:
LCD GND to pot and from there to arduino GND (black wire)
LCD Vcc to pot and from there,to arduino Vcc (red wire)
LCD Vo to pot (brown wire)
LCD RS to digital pin 7 (black wires for all the others)
LCD RW to pot GND
LCD Enable to digital pin 6

LCD D4 to digital pin 5
LCD D5 to digital pin 4
LCD D6 to digital pin 3
LCD D7 to digital pin 2

another photo of the connections on the potentiometer

http://www.flickr.com/photos/79759011@N05/6996428812/in/photostream

i hope you can see clearly...
the red wire on the pot is from LCD Vcc.The other red wire goes to arduino Vcc
the brown wire is the LCD Vo
the three black wires are 1) LCD GND   2)LCD RW   3)To arduino GND

I can't have clear picture from the digital pins on arduino board,but trust me they are wired fine and correctly.
                                   

« Last Edit: May 04, 2012, 12:40:09 pm by wizer » Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Ok,i wired everything like this link http://arduino.cc/en/Tutorial/LiquidCrystal

i run the example 'Hello,world' and everything was fine except the fact that the backlight doesn't work.

The display in the example does not have power connected to the backlight and neither does yours.  The backlight is completely independent of the actual display and therefore the contrast adjustment has nothing to do with the visibility of the backlight.

Try connecting a 150 ohm resistor between +5V and pin 15 and connect pin 16 to GND and see if your backlight comes to life.


Quote
i must tell you that i used a 4.7K potentiometer (instead of 10K in the example)

This is fine as far as the LCD is concerned.  You are drawing more current from your power supply than you would with a larger potentiometer.  If you have a 20K or 50K pot one of those would be a better choice.

You probably should brush up on your soldering skills.


Don
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A 4K7 potentiometer draws a little over a milliamp @ 5Vdc, a 10 K one half of that and the green power LED on the board draws 3.4 milliamp and yes the Vee pin draws no current to speak about....
Where here are the savings??? Compared to what? I do understand both sides of the issue and it is my point that there are somethings that don't need fixing and aren't changed enough to make the changes worthwhile. The chances of making an error on a "Working" assembly trying to save 500 uA seems to be of dubious merit. In fact the chance that an error might very well happen during such a change would IMO make the change highly questionable, if Still not I ask myself what is the advantage in saving a couple of hundred microwatts of power. There is also the thought that such a change in current could not be measured by the Arduino easily either...

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
there are somethings that don't need fixing

I didn't say that there was anything that needed fixing.  I merely pointed out that another solution would have been a better choice.


Quote
The chances of making an error on a "Working" assembly trying to save 500 uA seems to be of dubious merit.

The chances of making an error by pulling one potentiometer out of a breadboard and replacing it with another one are pretty slim.  Any errors made would be immediately apparent and would not likely result in any damage.

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The LCD now is working properly.Thank you very much for your help.I'm grateful to you!
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The operating thought here is not likely... rephrased... Wanna Bet? If you don't touch it you didn't break it maybe. It has been my experience for far longer than I like to think that the less handling of any item the less chance for an inadvertent 'something' to happen. Yes I err frequently but at least some of my errors are now due to an excess of caution. Electronically I am Very conservative and in my old age I still brick things but quite a bit less often, now.

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The operating thought here is not likely... rephrased... Wanna Bet? If you don't touch it you didn't break it maybe. It has been my experience for far longer than I like to think that the less handling of any item the less chance for an inadvertent 'something' to happen.

So are you saying that if you have a circuit that is working but is not configured optimally that you shouldn't reconfigure it because you might break it?

Quote
Electronically I am Very conservative and in my old age ...

There's a very good chance that my old age is at least as old as yours yet I don't hesitate to swap out parts in my breadboard, even though I need one of those headband magnifiers to do so.

Don
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My thought were based on the distinct possibility that he had neither our headband eyes or our skill set... I was also of the thought that the difference in current was more statistics than substance and I expressed that opinion. Do remember that it was only my opinion... for 500 uA?

Doc

Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 25
Posts: 4110
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do remember that it was only my opinion... for 500 uA?

Yes, but does your opinion change when you realize that the LCD controller itself typically draws only 1.5 mA?

Don
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2808
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No as the original thread was about connecting the display, not about low power uses/issues... (like help this lcd is killing my power supply) and it works well with 470R as a pot value, draws 10 ma but  was a line operated serial terminal I made in the late 90's for a project I was developing. The only valid reason to save 500 uA would be IMO for a battery/solar project, so my bad advice about 'leave it alone... it's working' might well make his project fail... of course he might provide LCD power through a Pin from the Uno... Not the backlight though... all of it could be switched on at a button press or data change (with a mosfet) and drop the power consumption to ZERO except when it is needed, this would IMO and experience be a good thing to do... I did it on several of my commercial battery powered Soil Moisture and Soil Conductivity meters I designed in the early '00s - 06 -07 I think. It is IMO not very applicable at the stage where this thing started as the point was to get it working... not to save power. Finding "errors" in my thinking has little to do with fixing the basic issue and only provides distraction from the main thread. Since this issue has 'little' to do with the REAL ISSUE... it should have been moved IMO to a private message... IMO rather than what it appears to be... Entertainment for those that choose to read this thread... Thus the reason that I mentioned the power led on the main board and it's "GASP" 3400 uA power consumption which is 6.8 times as much. What I really think is that there was little thought applied to the responses and a great deal about essentially IMO NOTHING. Pleasse remember ALL I offered was MY OPINION and your response was most correct but off topic as the discussion was about a NOOB trying to get something to light up (work) and NOT about "Saving Power"... IMO

Docedison
(AKA Robert K. Johnson Sr.)... IMO
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Pages: [1]   Go Up
Jump to: