system
September 1, 2014, 7:21pm
1
Hello,
I am making a temperature gauge using a sainsmart 4x20 I2 C 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
Thermocouples are very sensitive, requiring a good amplifier with a cold-compensation reference. The MAX31855K does everything for you, and can be easily interfaced with any microcontroller, ...
Price: $14.95 USD
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);
}
mart256
September 1, 2014, 7:49pm
2
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.
Robin2
September 1, 2014, 8:30pm
3
Try it with all the LCD code commented out to try to isolate what might be causing the problem.
...R
system
September 1, 2014, 9:02pm
4
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.
system
September 2, 2014, 4:27am
5
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?