Unable to get display on mcufriend tftlcd + UNO

Hi all,

Im trying to display temperature reading from IR sensor to tft, but I dont know what exactly the problem is. The alarm is beeping, the sensor is also working (serial output), but TFT display just blinks BLUE and then just blank WHITE screen and nothing happens :-

#include <Adafruit_TFTLCD.h>
#include <Adafruit_GFX.h>
#include <TouchScreen.h>
#include <Adafruit_MLX90614.h>

#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#define TS_MINX 122
#define TS_MINY 111
#define TS_MAXX 942
#define TS_MAXY 890

#define YP A3
#define XM A2
#define YM 9
#define XP 8

#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define YELLOW 0xFFE0
#define WHITE 0xFFFF

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
int piezoPin = 10;
boolean buttonEnabled = true;

void setup() {

Serial.begin(9600);
mlx.begin();
tft.reset();
uint16_t identifier = tft.readID();
tft.begin(identifier);
delay(200);

}

void loop() {

tone(piezoPin, 1000, 1000);

tft.fillScreen(BLUE);
tft.setCursor(30,40);
tft.setTextColor(BLACK);
tft.setTextSize(5);
tft.print("Tobj");

tft.setCursor(115,80);
tft.setTextSize(2);
tft.print(String(mlx.readObjectTempC()));

delay(500);

}

The MLX90614 is an I2C device. I2C uses A4, A5 on a Uno. A4 is the LCD_RESET pin on Mcufriend shields.

Please post a link to the actual screen that you have bought. e.g. Ebay sale page.
Please report the value from tft.readID()

David.

Hi David,

This is my exact tft screen

tf.readID() = 37669

Your ID = 0x9325 (37669 in old money)

The JPEG shows a shield with regulator U1. Does your shield look the same ?

I suggest that you use the shield with a different Arduino i.e. with different I2C pins.
Or use a thermometer with SPI interface. Or even a 1-wire interface.

I do not advise any hardware mod on the Shield.

David.

Sorry david,
this is my exact tft model snsapshot tft model

I noticed that very very quickly a BLUE screen comes, then the text "Tobj" gets displayed for 1/4th of a second but the temperature value doesnt show. And then it goes back to white screen and nothing else happens. What could be the reason for this behaviour ?
All this , while the serial monitor shows the temperature reading properly and even the buzzer is buzzing.
Just that the TFT isnt working properly !!

Thanks for the accurate photo. This shows the "current Mcufriend" pcb design. (which is crap)
The photo in your original JPEG shows an "older" pcb (which is much better).

Anyway, as explained in #3 the I2C SDA pin shares A4 with LCD_RESET pin. As soon as the I2C wiggles the SDA pin, the LCD is reset.

David.