Ecran Nokia 5110

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).

IMGP2153
ecran

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 5110COLOURARDUINO NANO
RSTYellowD7
CEGreenD8
DCBlueD9
DinWhiteD10
ClkPurpleD11
VCCRed3V3
BLBrown3V3
GndBlackGND

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/

[Tutoriel] Arduino + écran 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 :

etBis
2014-10-19 17.43.38

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é

CaptureLCdAssst

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

IMGP2152
IMGP2151

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 :

Color OLED Display – SSD1331

OLED I2C 4 PIN :

https://www.instructables.com/id/How-to-Interface-With-OLED-13-Inch-LCD128x64/

Laisser un commentaire

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur la façon dont les données de vos commentaires sont traitées.

Articles récents
Commentaires récents
fatima dans Bienvenue !
AdminDroid dans Bienvenue !
fatima dans Bienvenue !
Archives
Catégories