Ticker

6/recent/ticker-posts

Header Ads Widget

1.14 inch LCD interfacing with Raspberry Pi Pico RP2040

Hello Guys, In this blog we are going to interface 1.14 inch LCD with Raspberry Pi Pico RP2040 board. This LCD comes with inbuilt st7789 SPI driver, resolution of 240 x 135 pixels, 65K RGB colors with clear colorful IPS display where you can put your own creativity. 

In this tutorial, I am going to fetch data from raspberry pi pico internal temperature sensor, then i will display fetched value to 1.14 inch lcd display. 

Pinout

Connect 1.14 inch lcd with raspberry pi pico as shown in below pinout.

 
1.14 inch LCD Pico Pins Description
GND GND Ground Supply of pico
VCC 3V3 / VBUS Power Supply 3.3V - 5V DC (depending on module type)
DIN GP11 Serial Data Input / Output
CLK GP10 Serial Clock
CS GP9 Chip select input pin ("Low" enable)
DC GP8 Display data / Command selection pin
DC='1': Display data.
DC='0': Command data
RST GP12 Reset Pin. Initialize the chip with a low input
BL GP13 Backlight Control. High: backlight on Low: backlight off.

Installation Guide

  • Make sure you have connected your 1.14" lcd as same as shown above pinout.
  • Now press and hold BOOTSEL button on Pico and connect USB with your system (pc/laptop/Raspberry Pi). it will create a drive as RPI-RP2.
  • Now download firmware.uf2 file from below link and drag and drop this file to that RPI-RP2 drive. It will reboot your pico.
  • Now Open thonny ide, and select interpreter as "Micropython(Raspberry Pi Pico)".


  • Create a new file, then paste below code and save it on pico or on your computer drive with .py extension. (for eg: ReadTemp.py).

  • This code is using MicroPython libraries and hardware peripherals to display temperature readings on an LCD screen, and also print them to the console. The code is using an ADC (Analog to Digital Converter) on pin 4 to read the voltage from a temperature sensor, which is then converted to a temperature value using a conversion factor and a formula for the relationship between the sensor's output voltage and temperature. The code also uses the "st7789" library to control an ST7789 LCD screen, and the "utime" library to control the timing of the temperature readings.
  • The code first configures the SPI interface, with a high baudrate of 40000000, and the pins for clock, MOSI, reset, chip select, data/command, and backlight. Then it creates an ST7789 object and initializes the LCD.
  • Then it fills the top, middle, and bottom of the screen with red, yellow, and cyan color respectively.
  • In the infinite while loop, the code reads the sensor value, converts it to a temperature value and prints it on the LCD screen and console. Then it sleeps for 1 second before taking the next reading.
  • Finally click on green play button of thonny ide to start the program. It will print the internal temperature sensor value over thonny shel as well as on LCD with colorful blocks.
1.14 inch lcd output with pico




Post a Comment

0 Comments