Arduino appears to be crashing.

Hello,

I am making a temperature gauge using a sainsmart 4x20 I2C LCD and an adafruit thermocouple amplifier.

http://www.sainsmart.com/sainsmart-iic-i2c-twi-serial-2004-20x4-lcd-module-shield-for-arduino-uno-mega-r3.html

Now, I get it wired up, boots up great, everything works for 30 seconds to 2 minutes, and then it just stops. Reading it in the serial monitor , it confirms that suspicion. The code is very simple, I cannot figure out why it would be crashing. Any thoughts?

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "Adafruit_MAX31855.h"

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

LiquidCrystal_I2C lcd(0x27,20,4); //Addr: 0x3F, 20 chars & 4 lines

// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);



void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(4, 0);
lcd.print("Humming Aero");
delay(500);
}
void loop() {
   double c = thermocouple.readFarenheit();
   Serial.println(c);
   lcd.setCursor(0, 1);
   if (isnan(c)) 
   {
     lcd.print("T/C Problem      ");
   } 
   else 
   {
     lcd.print("Water Temp = "); 
     lcd.print(c);
     lcd.print(" F  "); 
   }
delay(250);
}

How are you powering things up?

Can you try the same sketch but without the serial monitor code (disable serialprint and serialbegin). Maybe serial com is crashing.

Try it with all the LCD code commented out to try to isolate what might be causing the problem.

...R

Power comes from pc or usb battery pack. Tried disabling serial, didn't help. I'll try disabling the lcd next and just watching the serial monitor. Then I'll try dialing the thermocouple and just displaying a counter to the lcd or serial.

Well, It appears to be a problem with my LCD, because when I cut out the LCD code it never crashed and showed the serial feed on the PC.

The software could be stumbling over itself. You might try increasing the delay. Do you really need LCD readings every quarter of a second?