Você está na página 1de 6

24/1/2014

Como usar o display Nokia5110 com o Arduino

pesquisar...

MENU PRINCIPAL
Principal Artigos de usurios Ambiente de Aprendizagem Tutoriais
Arduino Banco de Dados Celulares e Tablets Diversos Internet Mac Raspberry Pi Linguagem de Programao Linux Window s

Como usar o display Nokia5110 com o Arduino


Sex, 04 de Outubro de 2013 16:50 Bryan Frizzarin Fernando

TRANSLATION
Selecione o idioma
Pow ered by

Tradutor

Avaliao do Usurio: Pior


Tw eetar 14

/2 Melhor A VA LIA R
Recom endar

Usar esse tipo de display em projetos com o Arduino agregam enormemente funcionalidade e valor, visto se tratar de um display LCD grfico, mais precisamente o mesmo utilizado nos celulares Nokia 5110! D quase para dizer com certeza: Quem nunca teve um desses?!.

Frum Links Contato Webmail

ENTRAR
Nome de Usurio

Senha

Remember Me
LOGIN

Forgot your password? Forgot your username? Create an account

Inclusive o display LCD est no mercado desde 1998, ou seja, consolidado e muito testado em muitas aplicaes alm do celular. Bom, vamos ao que interessa. Esse display pode ser facilmente encontrado em sites no exterior voltados para produtos eletrnicos e DIY (Do it yourself Faa voc mesmo), aqui no Brasil encontrei na Tato Equipamentos Equipamentos Eletrnicos a preo convidativo para quem no tem ou no quer usar o carto internacional/esperar at um ms pela entrega.

Com o display conectado ao protoboard vamos iniciar as conexes. Sendo os pinos: RST CE Reset Chip Enable
1/6

http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid

24/1/2014

Como usar o display Nokia5110 com o Arduino

DC Din Clk Vcc BL GND

Data/Command Data Input Clock Power Supply Back Light Terra

Ligue o pino GND do display ao GND do Arduino:

Ligue o pino BL do display ao pino digital 2 do Arduino. Isso far com que seja possvel controlar o back light, caso queira deixa-lo ligado direto conecte-o ao Vcc:

Ligue o pino Vcc do display ao pino 5V (ATENO: verifique a voltagem do seu display, caso tenha dvidas, ligue no pino 3,3V) do Arduino:

Ligue o pino CLK do display ao pino digital 8 do Arduino:

Ligue o pino Din do display ao pino digital 9 do Arduino:


http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid 2/6

24/1/2014

Como usar o display Nokia5110 com o Arduino

Ligue o pino DC do display ao pino digital 10 do Arduino:

Ligue o pino CE do display ao pino digital 11 do Arduino:

Ligue o pino RST do display ao pino digital 12 do Arduino:

Antes de continuar, confira todas as ligaes, pois a quantidade de jumpers grande! Agora vamos ao cdigo desenvolvido por Jim Park, disponvel no prprio site do Arduino, aqui. Porm fiz algumas modificaes para lidar com o back light e melhorar o posicionamento dos caracteres.
0 0 1 . 0 0 2 . 0 0 3 . 0 0 4 . 0 0 5 . 0 0 6 . 0 0 7 . 0 0 8 . # d e f i n eP I N _ R E S E T1 2 # d e f i n eP I N _ S C E 1 1 # d e f i n eP I N _ D C 1 0 # d e f i n eP I N _ S D I N 9 # d e f i n eP I N _ S C L K 8 # d e f i n eP I N _ B L 2 # d e f i n eL C D _ C L O W / /R e s e t / /C h i pE n a b l e / /D a t a / C o m m a n d / /D a t aI n p u t / /C l o c k / /B a c kL i g h t

http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid

3/6

24/1/2014
0 0 9 . 0 1 0 . 0 1 1 . 0 1 2 . 0 1 3 . 0 1 4 . 0 1 5 . 0 1 6 . 0 1 7 . 0 1 8 . 0 1 9 . 0 2 0 . 0 2 1 . 0 2 2 . 0 2 3 . 0 2 4 . 0 2 5 . 0 2 6 . 0 2 7 . 0 2 8 . 0 2 9 . 0 3 0 . 0 3 1 . 0 3 2 . 0 3 3 . 0 3 4 . 0 3 5 . 0 3 6 . 0 3 7 . 0 3 8 . 0 3 9 . 0 4 0 . 0 4 1 . 0 4 2 . 0 4 3 . 0 4 4 . 0 4 5 . 0 4 6 . 0 4 7 . 0 4 8 . 0 4 9 . 0 5 0 . 0 5 1 . 0 5 2 . 0 5 3 . 0 5 4 . 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 x 0 0 ,0 x 4 1 ,0 x 3 6 ,0 x 0 8 ,0 x 0 0 }/ /7 d} , { 0 x 1 0 ,0 x 0 8 ,0 x 0 8 ,0 x 1 0 ,0 x 0 8 }/ /7 e? , { 0 x 0 0 ,0 x 0 6 ,0 x 0 9 ,0 x 0 9 ,0 x 0 6 }/ /7 f? } ; v o i dL c d C h a r a c t e r ( c h a rc h a r a c t e r ) { L c d W r i t e ( L C D _ D ,0 x 0 0 ) ; f o r( i n ti n d e x=0 ;i n d e x<5 ;i n d e x + + ) { L c d W r i t e ( L C D _ D ,A S C I I [ c h a r a c t e r-0 x 2 0 ] [ i n d e x ] ) ; } L c d W r i t e ( L C D _ D ,0 x 0 0 ) ; } v o i dL c d C l e a r ( v o i d ) {

http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid

4/6

24/1/2014

Como usar o display Nokia5110 com o Arduino


1 2 9 . f o r( i n ti n d e x=0 ;i n d e x<L C D _ X*L C D _ Y/8 ;i n d e x + + ) 1 3 0 . { 1 3 1 . L c d W r i t e ( L C D _ D ,0 x 0 0 ) ; 1 3 2 . } 1 3 3 . } 1 3 4 . 1 3 5 . v o i dL c d I n i t i a l i s e ( v o i d ) 1 3 6 . { 1 3 7 . p i n M o d e ( P I N _ S C E , O U T P U T ) ; 1 3 8 . p i n M o d e ( P I N _ R E S E T ,O U T P U T ) ; 1 3 9 . p i n M o d e ( P I N _ D C , O U T P U T ) ; 1 4 0 . p i n M o d e ( P I N _ S D I N , O U T P U T ) ; 1 4 1 . p i n M o d e ( P I N _ S C L K , O U T P U T ) ; 1 4 2 . p i n M o d e ( P I N _ B L , O U T P U T ) ; 1 4 3 . 1 4 4 . d i g i t a l W r i t e ( P I N _ R E S E T ,L O W ) ; 1 4 5 . / /d e l a y ( 1 ) ; 1 4 6 . d i g i t a l W r i t e ( P I N _ R E S E T ,H I G H ) ; 1 4 7 . 1 4 8 . L c d W r i t e (L C D _ C M D ,0 x 2 1) ; / /D i s p l a ye mc o m a n d o se s t e n d i d o s 1 4 9 . L c d W r i t e (L C D _ C M D ,0 x B f) ; / /C o n t r a s t ed od i s p l a y-v a l o rB 1 1 5 0 . L c d W r i t e (L C D _ C M D ,0 x 0 4) ; / /C o e f f i c i e n t ed et e m p o-0 x 0 4 1 5 1 . L c d W r i t e (L C D _ C M D ,0 x 1 4) ; / /B I A Sm o d e1 : 4 8 .-0 x 1 3 1 5 2 . L c d W r i t e (L C D _ C M D ,0 x 0 C) ; / /D i s p l a yn om o d on o r m a l-p a r am o d o i n v e r s ou s o0 x 0 d 1 5 3 . L c d W r i t e ( L C D _ C ,0 x 2 0 ) ; 1 5 4 . L c d W r i t e ( L C D _ C ,0 x 0 C ) ; 1 5 5 . } 1 5 6 . 1 5 7 . v o i dL c d S t r i n g ( c h a r* c h a r a c t e r s ) 1 5 8 . { 1 5 9 . w h i l e( * c h a r a c t e r s ) 1 6 0 . { 1 6 1 . L c d C h a r a c t e r ( * c h a r a c t e r s + + ) ; 1 6 2 . } 1 6 3 . } 1 6 4 . 1 6 5 . v o i dL c d W r i t e ( b y t ed c ,b y t ed a t a ) 1 6 6 . { 1 6 7 . d i g i t a l W r i t e ( P I N _ D C ,d c ) ; 1 6 8 . d i g i t a l W r i t e ( P I N _ S C E ,L O W ) ; 1 6 9 . s h i f t O u t ( P I N _ S D I N ,P I N _ S C L K ,M S B F I R S T ,d a t a ) ; 1 7 0 . d i g i t a l W r i t e ( P I N _ S C E ,H I G H ) ; 1 7 1 . } 1 7 2 . 1 7 3 . / /x-d e0a t 8 4 1 7 4 . / /y-d e0a t 5 1 7 5 . v o i dg o t o X Y ( i n tx ,i n ty ) 1 7 6 . { 1 7 7 . L c d W r i t e (0 ,0 x 8 0|x ) ; / /C o l u n a s 1 7 8 . L c d W r i t e (0 ,0 x 4 0|y ) ; / /L i n h a s 1 7 9 . 1 8 0 . } 1 8 1 . 1 8 2 . v o i dd r a w L i n e ( v o i d ) 1 8 3 . { 1 8 4 . u n s i g n e dc h a r j ; 1 8 5 . f o r ( j = 0 ;j < 8 4 ;j + + )/ /T o p o 1 8 6 . { 1 8 7 . g o t o X Y( j , 0 ) ; 1 8 8 . L c d W r i t e( 1 , 0 x 0 1 ) ; 1 8 9 . } 1 9 0 . f o r ( j = 0 ;j < 8 4 ;j + + )/ /R o d a p 1 9 1 . { 1 9 2 . g o t o X Y( j , 5 ) ; 1 9 3 . L c d W r i t e( 1 , 0 x 8 0 ) ; 1 9 4 . } 1 9 5 . f o r ( j = 0 ;j < 6 ;j + + )/ /D i r e i t a 1 9 6 . { 1 9 7 . g o t o X Y( 8 3 , j ) ; 1 9 8 . L c d W r i t e( 1 , 0 x f f ) ; 1 9 9 . } 2 0 0 . f o r ( j = 0 ;j < 6 ;j + + )/ /E s q u e r d a 2 0 1 . { 2 0 2 . g o t o X Y( 0 , j ) ; 2 0 3 . L c d W r i t e( 1 , 0 x f f ) ; 2 0 4 . } 2 0 5 . } 2 0 6 . 2 0 7 . v o i ds e t u p ( v o i d ) 2 0 8 . { 2 0 9 . d i g i t a l W r i t e ( 2 , H I G H ) ; / /L i g aob a c kl i g h t 2 1 0 . L c d I n i t i a l i s e ( ) ; / /I n i c i a l i z aod i s p l a y 2 1 1 . L c d C l e a r ( ) ; / /A p a g at o d o so sc a r a c t e r e s 2 1 2 . } 2 1 3 . 2 1 4 . c h a rc a r a c t e r e=' | ' ; 2 1 5 . 2 1 6 . v o i dl o o p ( v o i d ) 2 1 7 . { 2 1 8 . i n ta , b ; 2 1 9 . c h a rS t r [ 1 5 ] ; 2 2 0 . d r a w L i n e ( ) ;/ /D e s e n h aab o r d a 2 2 1 . / /x-c o l u n a s-d e0a t 8 4 2 2 2 . / /y-l i n h a s -d e0a t 5 2 2 3 . g o t o X Y ( 1 0 , 1 ) ; 2 2 4 . L c d S t r i n g( " S e uC u r s o " ) ; 2 2 5 . g o t o X Y ( 2 4 , 3 ) ; 2 2 6 . L c d S t r i n g ( " T E S T E " ) ; 2 2 7 . d e l a y ( 5 0 0 ) ; 2 2 8 . g o t o X Y ( 2 4 , 3 ) ; 2 2 9 . L c d C h a r a c t e r ( ' t ' ) ; 2 3 0 . L c d C h a r a c t e r ( ' e ' ) ; 2 3 1 . L c d C h a r a c t e r ( ' s ' ) ; 2 3 2 . L c d C h a r a c t e r ( ' t ' ) ; 2 3 3 . L c d C h a r a c t e r ( ' e ' ) ; 2 3 4 . d e l a y ( 5 0 0 ) ; 2 3 5 . i f ( c a r a c t e r e= =' | ' )c a r a c t e r e=' / ' ;e l s e 2 3 6 . i f ( c a r a c t e r e= =' / ' )c a r a c t e r e=' ' ;e l s e 2 3 7 . i f ( c a r a c t e r e= =' ' )c a r a c t e r e=' \ \ ' ;e l s e 2 3 8 . i f ( c a r a c t e r e= =' \ \ ' )c a r a c t e r e=' | ' ;e l s e 2 3 9 . g o t o X Y ( 8 0 , 3 ) ; 2 4 0 . L c d C h a r a c t e r ( c a r a c t e r e ) ; 2 4 1 . }

Funcionando:
http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid 5/6

24/1/2014

Como usar o display Nokia5110 com o Arduino

Com esse cdigo em mos podemos fazer inmeras mudanas e adaptaes para qualquer aplicao que se possa imaginar.

MOSTRAR OUTROS ARTIGOS DESTE AUTOR


ADICIONAR COMENTRIO Nome (obrigatrio) E-mail (obrigatrio) Ttulo (obrigatrio)

Voc ainda pode digitar 1000 caracte re s

Notifique-me de comentrios futuros

Atualizar

Enviar
J C omments

http://www.seucurso.com.br/index.php?option=com_content&view=article&id=308:como-usar-o-display-nokia5110-com-o-arduino&catid=901:arduino&Itemid

6/6