kmr-1.8 tft display supplier
Recently, I had the idea to make a digital picture frame—one of these kinds which load images from SD cards and show each image for some time. I was remembering myself that I already own a small TFT display, the KMR-1.8 SPI, that works out of the box with an Arduino Uno. When I digged up my KMR-1.8 SPI, I realized that it has also an in-built SD card reader. Moreover, I looked up the Internet and found ready-to-use libraries for the in-built SD card reader as well as showing images on the TFT display. For these reasons, I thought making such an digital picture frame will turn out very easy.
When I started to implement my first lines of codes and started to connect my Arduino Uno to the KMR-1.8 SPI, I ran into two major problems. First, the colors of my image file did not match to the colors displayed by the KMR-1.8 (red and blue were interchanged). Second, my first prototypes stopped to work after about 5 minutes. The application started to freeze and showed the same image forever instead of displaying the next image after a chosen time.
There exists various versions of so-called “1.8 TFT displays” from different manufacturers. Not all of them are 100% compatible to each other. Therefore, if you own a TFT display and want to use my tutorial to make it work, please check if your TFT display really matches the version I used in this tutorial:
The source code relies on three header files (and libraries): SPI.h (Link), SD.h (Link) and TFT.h (Link). Please make sure that all of them are correctly installed before trying out my source code (In Arduino IDE: Tools -> Manage Libraries…).
I overcame the first problem by not using the default initialization method (“TFTscreen.begin();”) of the TFT library. Instead, I looked up whats inside the “begin”-method. I found a method called “initR” which has a parameter that allows to perform the initialization for a specific chip. Here, the parameter value “INITR_BLACKTAB” worked for me as the colors were then shown correctly. In addition, I call the method “setRotation” with parameter value “1” in order to be conform to the default initialization method. In the end, the code for the setting up the TFT library object looks like this:// ...
The code looks for image files (*.BMP) on the SD card and shows each image for 60 seconds. You can change the display time by setting “DELAY_IMAGE_SWAP” to a new value.
@david_prentice: I meant Himax, well spotted! I remember seeing a 1.8" display with a HX---- driver advertised, but I am not sure where I saw it. Yes you are right, ILI9163/S6D02A1/ST7735 are all options often advertised for 1.8" displays.
Interestingly it reports my display as having an ILI9163 but I am using initialisation code from this library for a S6D02A1 and it works OK but that may just be by luck and a degree of initialisation address compatibility.
An 1.8" 128 x 160 TFT LCD can be purchased for around $3. The one that I got has the marking of "KMR-1.8 SPI". It claims to be ST7735R based. ST7735R is a 262K 18-bit color TFT controller/driver by Sitronix. ST7735R is a chip with large aspect ratio (10 x 0.7 mm); it has 759 pads (including 396 source and 162 gate driver output pins) and supports a number of interfaces, parallel and serial.
LED+, SD_CS, MOSI and SCK have 4.7-Ohm series resistors. LED- is shorted to GND. The display is advertised to work with Arduino, but it appears to take only 3V input.
I used 1600-Ohm resistors in series for 5V to 3V conversion. I wonder if that might cause some problem. The display input pins do not cause the 5V signal level to drop as I expect with ESD protection diodes. Could the input be 5V tolerant? The I/O voltage is specified as 1.65 to 3.7V according to the data sheet and the operating voltage is 2.3 to 4.8V. 5V would be stressing it. I power the Arduino nano with the USB, so the actual voltage is 4.7V (after the diode). It is possible that the 3V from the regulator is not actually used by the display, but only for the SD card.
People have reported that the display can also run on Orange Pi. The device is supported by notro"s fbtft, with built-in support for Adafruit 1.8". The wiring is as follows,
The data sheet specifies the min serial clock cycle time is 66ns for write and 150ns for read. Even for just writing, the max clock frequency is 15MHz. Even though the driver seemed to load correctly, I was unable to display anything. Lowering the SPI clock rate did not help.
I powered both the arduino and the display with 3.3V. The hardware SPI worked. (I mistakenly used D12 as DC, which compounded the problem. D12 is MISO.) Even the software SPI behaved a little better (without the some flicking). So the hardware is fine running 3.3V (drawing about 55mA).
The next step is to run X windows on it. I created X11 config file and run startx as the second display. The X Window did run on the display; but the X Windows on the HDMI display disappears.
Specification:Driver IC: ST7735RResolution: 128 x 160 pixelsFeatures:- Can help you to get rid of the Arduino serial monitor.- Some tests and provide UTFT library, AdaFruit Library and instruction on DropBox.- Tested with Latest Arduino 1.6.5.IO interface:1. RESET --directly to the microcontroller IO2. CS --directly to the microcontroller IO3. A0 --IO control registers select4. SDA --IO control data transmission5. SCL --IO control SPI bus6. BL--High Level 3.3V backlight onNote:Please contact us for documents and driver if you need. Please noted this LCD is 3.3V, which can not receive 5V signals from the Arduino, so please use a 1k series resistors between GPIO lines on a 5V arduino and this LCD, power this LCD with 5V but drive it with "level shifted resistor" GPIO lines.Besides, you could use mcifriend 2.8 inch TFT LCD library to get it to work, it will work fine with the Mega or Uno.
Features for the 1.8 Inch LCD TFT Display 128X160 SPI Serial Port With SD Card Holder is the best way to add a small, colourful, and bright display to any project. Since the display uses 4-wire SPI to communicate and has its pixel-addressable frame buffer, you can use it with every kind of microcontroller.
Even a tiny one with low memory and few pins available! The 1.8″ display has 128×160 color pixels. Unlike the low-cost Nokia 6110 and similar LCDs, which are CSTN type and thus have poor colour and slow refresh, this display is a true TFT! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!). And the 4.6 cm (1.8 “) SPI 128×160 TFT LCD Display Module will always come with the same driver chip, so there are no worries that your code will not work from one to the other. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector), an ultra-low-dropout 3.3V regulator, and a 3/5V level shifter to use it with 3.3V or 5V power and logic. It features a microSD card holder so you can quickly load full-colour bitmaps from a FAT16/FAT32 formatted microSD card
The display I have is a Keyes 128x160 Colour TFT LCD Module MD-333 Micro SD SPI I have successfully been able to wire this to an Arduino Nano however I understand that the Arduino is not powerful enough to run video. The screen has a MicroSD port for storage.
The biggest problem I find at the moment is the lack of a working micropython TFT or ST7735 library for the Pico. There are several micropython variants, but I"ve not been successful in getting any to work so far. (my lack of python skills I"m afraid)
Adafruit support the ST7735 with their Circuitpython library, but this means switching to Circuitpython which doesn"t support threads or interrupts. However there is a Circuitpython port for the Pico, which might be persuaded to work with a Chinese display.
That"s useful, but missing some vital details - do you have a link to the ST7735 library you used, and a link to the display you are using also please?
ST7735 is a MIPI DCS display. Most ST and ILI displays follow the MIPI DCS standard. Check for example HAGL. You will also need the MIPI DCS HAL. If in a hurry check a video of an example app.
I needed to install this library from Bodmer; then edit the User_Setup.h file ( in sketchbook/libraries/TFT_ESPI ) to match my display and the connections used.
This User_Setup.h works fine for the ESP32; except that in the UTFT_DEMO_FAST Example the final screen (orange rectangle on blue background) no text was displayed.
A wide variety of tft display 1.8 options are available to you, You can also choose from original manufacturer, odm and agency tft display 1.8,As well as from tft, ips, and standard.
Start the Arduino IDE and load the attached Analog_Clock_Box.ino file. Make sure to select the "Sparkfun Pro Micro" board as shown in the picture.If this option does not show up, please install the supporting drives and IDE addons as described here. As an additional fact, this site informs us that the RAW pin easily accepts up to 12V, so we could skip the external voltage regulator and connect the display directly to the Pro Micro. There are, however, different (cheaper) clones of the Pro Micro out there and some of them are very limited output current capabilities, so the display may run unstable. Thus, you may try to avoid the external voltage regulator and its capacitors by connecting 6V to the RAW pin, not to VCC pin as in the diagram!
The display should now show the clock and the possible options. Here are some details about the code:The following line at the beginning of the code controls how many subsequent correct answers are needed before the servo will flip by 90° and thus release the lid.#define MAX_ANSWERS 3The lines 20 to 28define the pinsused for driving the display, the buzzer and the servo. They should remain unchanged as this is the configuration that corresponds to the wiring on the perfboard.
Line 74 initializes the display. It might be the case that all colors appear awfully wrong on your device since there are different 1.8" displays with (slightly) different driver chips on the market. If the display looks strange, try to change "INITR_BLACKTAB" to "INITR_GREENTAB" or "INITR_REDTAB" here.
Line 89calls createTimesAndPaintClock()which does what it says: it generates a random time, paints the clock and displays three wrong and one correct option.
After three correct answers in a row, line 149 will flip the servo to 90 degrees, opening the lid. Now, the system waits in line 150 for any button to be pressed again. If that happens, the lid is expected to be in closed position again, and the servo will flip its flap now to the locked position again. After that, the entire "game" will begin from start again.The was a small bug in the original software when I made the video, so after giving three correct answers it still displayed "2/3". This is corrected in the attached .ino file... ...but not in the video.