Pages: [1]   Go Down
Author Topic: LCD not functioning properly  (Read 704 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have a 2 x 16 parallel LCD.  It is attached to a protoshield attached to a UNO.  It works fine on "Hello world" but when I have it hooked up to a thermocouple, it gives the Int temp as -127 and states T/C Problem.  Then it goes bonkers with all 32 characters rapidly changing with various symbols like #,@,&, sigma and omega, etc..  Then it shuts down and then repeats.

However, the serial monitor sketch works fine and shows the proper temperature.

The LCD thermocouple sketch is from LadyAda who sells the TC and break out board/amplifier so I assume the sketch is not the problem.

This was a very inexpensive LCD - as a total noob, I am wondering if that could be the problem?

Any suggestions or recommendations would be greatly appreciated.

TIA
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4249
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Any suggestions or recommendations would be greatly appreciated.
Since the LCD works with 'Hello World' that implies that the connections between the LCD and the Arduino are correct.  That leaves us suspecting a problem with your implementation of the sketch from LadyAda.  Don't you think that you might get more help if you provided us with a copy of your version of the sketch and a photograph of your protoshield hookup?

Don

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, Don

here is the sketch from LadyAda - only change was the sequence of the pin #s


 
Code:
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>

int thermoCLK = 3;
int thermoCS = 4;
int thermoDO = 5;

// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

 
void setup() {
  Serial.begin(9600);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
 
  lcd.print("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   lcd.setCursor(0, 0);
   lcd.print("Int. Temp = ");
   lcd.println(thermocouple.readInternal());
   lcd.print("  ");
     
   double c = thermocouple.readCelsius();
   lcd.setCursor(0, 1);
   if (isnan(c))
   {
     lcd.print("T/C Problem");
   }
   else
   {
     lcd.print("C = ");
     lcd.print(c);
     lcd.print("  ");
   }
 
   delay(1000);
}

Here are some photos but as you said, it must be hooked up to the UNO properly for "Hello World!" to work


Pin one is top right in the next shot







The pinout for the LCD is  11-RS to UNO pin 11, 9-EN to UNO pin 12, 4-D4 to UNO pin 7, 3-D5 to UNO pin 8, 2-D6 to UNO pin 9 and 1-DB7 to UNO pin 10

Hope this gives you the information you need
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4249
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
lcd.println(thermocouple.readInternal());
Well for starters this is really going to mess up the LCD display.  There's a good reason that there is no mention of println in the LCD documentation.

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don, what is this absolute noob supposed to do at this point - delete that line of code?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

May have accidentally discovered something - in reconnecting the Maxim TC board to the UNO, I misplaced the pins and got the same message on the serial monitor as I was getting on the LCD.  This leads me to believe there is an error in the LCD sketch - but I don't know enough to know how to debug it smiley-cry

The MAX31855 has DO to UNO pin 3, CS to UNO pin 4 and CLK to UNO pin 5. 
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4249
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Don, what is this absolute noob supposed to do at this point - delete that line of code?

No, you have to use print instead of println and then deal with going to a new line in a separate step by using cursor positioning.

Don
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well,  I am in way over my head - managed to get rid of the "ln" (which did not help) but have no idea how to do the rest

Can you recommend a resource where I might be able to learn some of this stuff? 

Getting pretty frustrating to have spent almost two full days trying to get an LCD to work

Compared the lcd sketch with the serial and cannot find any discrepancies but probably would not recognize one!

Will try lcd.setCursor(1,0) just to see what happens. Did not help - LCD just went blank
Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 72
Posts: 7171
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

try using pins 7,8,9, and some pins other than 10,11,12 for lcd. Your temperature sensor is using pins 11-13, possibly 10 too.
Logged


Pages: [1]   Go Up
Jump to: