L’écran est piloté par un DRIVER CMOS LCD de Philips le PCD8544. La résolution est de 84×48 pixels, l’écran consomme seulement 7mA. L’écran est rétroéclairé par des leds mais attention ! par précaution placer une résistance de 330 Ω. De même, les niveaux étant en 3v il est préférable de placer des résistances de 10kΩ entre les pins CLK, DIN, D/C, et RST pins et une résistance de 1kΩ entre la pin CE. L’interface est de type SPI.
Les écrans que vous achetez sur le net sont des écrans d’occasion. Quelques petits défauts peuvent être présents (traces de colle ou pixels morts).


RST pin resets the display. It’s an active low pin meaning; you can reset the display by pulling it low. You can also connect this pin to the Arduino reset so that it will reset the screen automatically.
CE(Chip Enable) pin is used to select one of many connected devices sharing same SPI bus. It’s an active low pin as well.
D/C(Data/Command) pin tells the display whether the data it’s receiving is a command or displayable data.
DIN is a serial data pin for SPI interface.
CLK is a serial clock pin for SPI interface.
VCC pin supplies power for the LCD which we connect to the 3.3V volts pin on the Arduino.
BL(Backlight) pin controls the backlight of the display. To control its brightness, you can add a potentiometer or connect this pin to any PWM-capable Arduino pin.
GND should be connected to the ground of Arduino
Librairies :
Adafruit’s PCD8544 Nokia 5110 LCD library
// Software SPI (slower updates, more flexible pin options):
// pin 7 – Serial clock out (SCLK)
// pin 6 – Serial data out (DIN)
// pin 5 – Data/Command select (D/C)
// pin 4 – LCD chip select (CS)
// pin 3 – LCD reset (RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
https://learn.adafruit.com/adafruit-gfx-graphics-library/graphics-primitives
u8g2lib library
#include "U8glib.h"
U8GLIB_PCD8544 u8g(
Clk, Din, DC, CE, RST ) ;
Liste des fonctions : https://github.com/olikraus/u8glib/wiki/userreference
Fonts : https://github.com/olikraus/u8glib/wiki/fontsize
Branchements : LCD – arduino UNO
VCC (Vcc) -> 3v3 (!! pas 5v !!)
LED (DL) -> 3v3 (!! pas 5v !!) mais attention ! par précaution placer une résistance de 330 Ω
GND (Gnd)-> GND
NANO :
NOKIA 5110 | COLOUR | ARDUINO NANO |
---|---|---|
RST | Yellow | D7 |
CE | Green | D8 |
DC | Blue | D9 |
Din | White | D10 |
Clk | Purple | D11 |
VCC | Red | 3V3 |
BL | Brown | 3V3 |
Gnd | Black | GND |
Exemple de code :
#include "U8glib.h"
U8GLIB_PCD8544 u8g(11, 10, 8, 9, 7); // Clk, Din, DC, CE, RST
void draw()
{
u8g.setFont(u8g_font_unifont);
u8g.drawStr(0, 20, "Hello");
u8g.drawStr(12, 36, "World");
}
void setup()
{
u8g.setColorIndex(1);
u8g.setRot180();
}
void loop()
{
u8g.firstPage();
do
{
draw();
}
while(u8g.nextPage());
delay(1000);
}
MEGA :
Display - Arduino Pin 1(RST) – D12 Pin 2(CE) – D11 Pin 3(DC) – D10 Pin 4(DIN) – D9 Pin 5(CLK) – D8 Pin 6(VCC) - VCC Pin 7(LIGHT) - GND Pin 8(GND) - GND
Le contraste des écrans n’est pas une valeur fixée pour chaque écran. Il faut faire varier la valeur indiqué dans le script pour trouver la constante adaptée.
L’écran a une taille en pixels de 48 de hauteur par 84 de large et 8 pixels par byte.
Références :
https://cuneyt.aliustaoglu.biz/en/nokia-5110-lcd-with-arduino-nano-and-u8glib/
http://skyduino.wordpress.com/2012/01/24/tutoriel-arduino-ecran-de-nokia-5110/
http://playground.arduino.cc/Code/PCD8544
http://blog.stuartlewis.com/2011/02/12/scrolling-text-with-an-arduino-and-nokia-5110-screen/
Pour afficher une image :


cf exemple
1°) créez l’image avec un logiciel permettant d’enregistrer en BitMap monochrome comme paint sous windows
2°) Dimensionnez l’image noir&blanc en :
Width -> 84
Height -> 48
8 pixels par byte
3°) Convertir avec l’outil OnLine http://javl.github.io/image2cpp/

OU
3°) convertissez l’image à l’aide du logiciel LCDassistant, en enregistrant le fichier généré

Ou avec le software “BitmapEncoder” here.
4°) récupérez le tableau de valeur dans le fichier généré et placez le dans un fichier image.h
https://www.electronicwings.com/arduino/nokia5110-graphical-display-interfacing-with-arduino-uno
Pour faire défiler un texte :
Le code est ici


Librairie à tester : https://github.com/olikraus/u8glib et https://code.google.com/p/u8glib/
Références :
http://electroniqueamateur.blogspot.com/2018/12/afficheur-lcd-nokia-5110-et-arduino.html
OLED COLOR DISPLAY 7 PIN :

OLED I2C 4 PIN :
https://www.instructables.com/id/How-to-Interface-With-OLED-13-Inch-LCD128x64/
Votre commentaire