So...
I just picked up a new Arduino R3, a Protoshield v2, and a MLX90614 BAA (infrared thermometer)
I have all the latest software (as of 2013). I have this thing wired exactly as its wired in the blog post http://bildr.org/2011/02/mlx90614-arduino/ and for some reason can't get any feedback on the serial monitor on my laptop.
I open up the serial monitor once the board is booted up and all I get on the screen is " Setup..."
Just what's in the setup section... (Serial.println("Setup...");
Any ideas what is keeping me from temperature data from streaming on my monitor window??
I've checked the voltage and all the components on the board and they check okay.
#include <i2cmaster.h>
void setup(){
Serial.begin(9600);
Serial.println("Setup...");
i2c_init(); //Initialise the i2c bus
PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups
}
void loop(){
int dev = 0x5A<<1;
int data_low = 0;
int data_high = 0;
int pec = 0;
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x07);
// read
i2c_rep_start(dev+I2C_READ);
data_low = i2c_readAck(); //Read 1 byte and then send ack
data_high = i2c_readAck(); //Read 1 byte and then send ack
pec = i2c_readNak();
i2c_stop();
//This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps
double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614)
double tempData = 0x0000; // zero out the data
int frac; // data past the decimal point
// This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.
tempData = (double)(((data_high & 0x007F) << 8) + data_low);
tempData = (tempData * tempFactor)-0.01;
float celcius = tempData - 273.15;
float fahrenheit = (celcius*1.8) + 32;
Serial.print("Celcius: ");
Serial.println(celcius);
Serial.print("Fahrenheit: ");
Serial.println(fahrenheit);
delay(1000); // wait a second before printing again
}
Eventually I want to use this sensors data to provide feedback to this PID code I have currently working with a thermocouples analog feedback... Once I get it working.