Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Sensors / Problem interfacing with VC0706 JPEG Serial Camera on: August 13, 2013, 05:03:59 pm
Problem interfacing with VC0706 JPEG Serial Camera

Hello guys,
I just received a couple of VC0706 JPEG Serial Cameras and want to interface with them. Here is the product link: http://www.aliexpress.com/item/Free-shipping-JPEG-Color-Camera-Infrared-232-Serial-Port-Camera-Module-XR-CP3-VIMICRO-VC0706-Full/783442600.html
For the first test, I want to connect this camera to my computer and read out some information / images with the enclosed CommTool.
I followed this instruction: http://learn.adafruit.com/ttl-serial-camera/using-comm-tool, wired the circuit up like on the image there and opened the Serial Port with a baud of 38400 (default speed for my unit).



But every time I click on "Get version", it says timeout.
I also tried the arduino library, but as expected, I does not work either.
What am I missing ?
My unit has the following specifications:
Baud Rate: 38400 bps
Picture: VGA
Electronic Level: COMS
Video Format: PAL(R5 NULL)
Power: DC 5V

Could the problem come from the electronical level ? This one uses CMOS, not TTL as the unit from Adafruit. If yes, is there a possibility to convert the signals to TTL ? (logical level is 3.3V)
Thanks for any kind of help, I am really stuck here  smiley-cry
2  Using Arduino / General Electronics / Problem interfacing with VC0706 JPEG Serial Camera on: August 13, 2013, 10:01:43 am
Hello guys,
I just received a couple of VC0706 JPEG Serial Cameras and want to interface with them. Here is the product link: http://www.aliexpress.com/item/Free-shipping-JPEG-Color-Camera-Infrared-232-Serial-Port-Camera-Module-XR-CP3-VIMICRO-VC0706-Full/783442600.html
For the first test, I want to connect this camera to my computer and read out some information / images with the enclosed CommTool.
I followed this instruction: http://learn.adafruit.com/ttl-serial-camera/using-comm-tool, wired the circuit up like on the image there and opened the Serial Port with a baud of 38400 (default speed for my unit).



But every time I click on "Get version", it says timeout.
I also tried the arduino library, but as expected, I does not work either.
What am I missing ?
My unit has the following specifications:
Baud Rate: 38400 bps
Picture: VGA
Electronic Level: COMS
Video Format: PAL(R5 NULL)
Power: DC 5V

Could the problem come from the electronical level ? This one uses CMOS, not TTL as the unit from Adafruit. If yes, is there a possibility to convert the signals to TTL ? (logical level is 3.3V)
Thanks for any kind of help, I am really stuck here  smiley-cry

3  Using Arduino / Storage / Re: Issue with creating bmp file on SD card on: July 14, 2013, 10:26:34 am
Found the solution  smiley I forgot to shift the High Byte right by 8-bit ^^
Now it works and I can even create bmp image with 640x480 on the sd card.
They can than be viewed later on a LCD Display with the bmp print function of the UTFT lib.
Awesome !
4  Using Arduino / Storage / Issue with creating bmp file on SD card on: July 14, 2013, 09:24:18 am
Hello together !
For my newest project, I want to create a bmp file on an SD card to store measured temperatures from an IR sensor converted to RGB colors inside (thermal image).
For unknown reason, it does not work as I do expect. The arduino creates the bmp file, but instead of the Red Color I want to write in for test purposes, the whole image is black.
So I think the RGB conversion from RGB888 to RGB565 and then from RGB 565 to RGB555 seems to have an issue.

Code:
#include <SD.h>

//Refer to http://www.fastgraph.com/help/bmp_header_format.html
const char bmp_header[54]=
{
      0x42, 0x4D, 0x36, 0x58, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,
      0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x58, 0x02, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0xC4, 0x0E, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
  
#define SD_CS 10

void setup()
{
  Serial.begin(9600);
  //Initialize SD Card
  if (!SD.begin(SD_CS))
  {
    while (1); //If failed, stop here
  }
  char str[] = "TEST.BMP";
  GrabImage(str);
}

void GrabImage(char* str)
{
  File outFile;
  byte VH,VL;
  int i,j = 0;
  
  //Create the File
  outFile = SD.open(str,FILE_WRITE);
  if (! outFile) return;

  //Write the BMP header
  for( i = 0; i < 54; i++)
  {
    char ch = bmp_header[i];
    outFile.write((uint8_t*)&ch,1);
  }
  
  //Test color, Red in RGB888
  byte r = 255;
  byte g = 0;
  byte b = 0;
  //Convert RGB888 to RGB565
  unsigned short rgb =  ((((r>>3)<<11) | ((g>>2)<<5) | (b>>3))) ;

  //Write 320x240x2 byte to the File
  for(i = 0; i < 240; i++){
    for(j = 0; j < 320; j++){
      VH = rgb & 0xFF00; //Mask the High Byte
      VL = rgb & 0x00FF; //Mask the Low Byte
      //RGB565 to RGB555 Conversion
      VL = (VH << 7) | ((VL & 0xC0) >> 1) | (VL & 0x1f);
      VH = VH >> 1;
      //Write image data to file, low byte first
      outFile.write(VL);
      outFile.write(VH);
  }
  }
  //Close the file  
  outFile.close();
  return;
}

void loop()
{
}



I would be very happy about any kind of help !
Thanks,
Max
5  Community / Exhibition / Gallery / Re: Cheap-Thermocam V2 | A cheap thermographic camera for everyone ! on: May 20, 2013, 12:44:12 pm
Thanks for the help but the sensor is still silent.



When I change the place of SDA and SCL I get a response
bient temperature: -273.16
Object temperature: -273.16
Ambient temperature: -273.16
Object temperature: -273.16
Ambient temperature: -273.16
I get the same thing when there is no sensor.
Maybe there is still what the realties ideas?
If you'd buy a new sensor. Just here in Ukraine they are at $ 120 )))



Thats shit. Sorry, but currently I have no idea what could be the reason smiley-sad
From where did you order the sensor ? If it is not working, you should ask for a new one there.
However, I can order a MLX90614-DCI for you too. I get it for 30€ including taxes and shipping.
6  Using Arduino / Storage / Re: Read float from SD card with Fat16 Lib on: May 20, 2013, 12:41:01 pm
store float values (temperatures) to a SD Card. One per line and with 2 fractional digits.
Now I want to read them out again

Code:
/*
  Serial.println();
  // copy file to serial port
 /code]

So how can I convert the uint8_t Array to a float variable ?

[/quote]

Why is there an array? You should be able to simply write the floats to the card and then read them straight back.

[code]//  Read temps off SD.
 
#include <SD.h>
File myFile;

void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing SD card...");
   pinMode(53, OUTPUT);// pin 10 on Uno
   
  if (!SD.begin(4)) {
    Serial.print("initialization failed!");
    return;
  }
  Serial.println(" done.");

  myFile = SD.open("log.txt", FILE_WRITE);
  if (myFile) {
    Serial.print("Checking the file, no write...");
    myFile.close();
    Serial.println("done.");
  } else {
    Serial.println("error opening");
  }
 
  myFile = SD.open("log.txt");// re-open the file for reading:
  if (myFile) {
    Serial.println("log.txt:");   
    while (myFile.available()) {// read until EOF
    Serial.write(myFile.read());
    }
    myFile.close();
  } else {
    Serial.println("error opening log.txt");
  }
}

void loop()
{
}
[/code]

Thanks Nick_Pyner, but I finally managed it on my own.
Just a single conversion to double was required. I am not using the official SD lib because the Fat16lib is much smaller and for my Project, code size is a very important aspect.

Code:
while((file.read(buf, sizeof(buf)) >0) && (count <= 3071)){
    double temp = atof((char*)buf);
  }   
7  Using Arduino / Storage / Read float from SD card with Fat16 Lib on: May 19, 2013, 05:36:04 pm
Hello guys, I Need your help !
I use the fat16 lib to store float values (temperatures) to a SD Card. One per line and with 2 fractional digits.
Now I want to read them out again and store them into float variables.
I use this code to read out data in general:

Code:
/*
 * This sketch reads and prints the file
 * PRINT00.TXT created by fat16print.pde or
 * WRITE00.TXT created by fat16write.pde
 */
#include <Fat16.h>
#include <Fat16util.h> // use functions to print strings from flash memory

SdCard card;
Fat16 file;

// store error strings in flash to save RAM
#define error(s) error_P(PSTR(s))

void error_P(const char*  str) {
  PgmPrint("error: ");
  SerialPrintln_P(str);
  if (card.errorCode) {
    PgmPrint("SD error: ");
    Serial.println(card.errorCode, HEX);
  }
  while(1);
}

void setup(void) {
  Serial.begin(9600);
  Serial.println();
  PgmPrintln("type any character to start");
  while (!Serial.available());
  Serial.println();
 
  // initialize the SD card
  if (!card.init()) error("card.init");
 
  // initialize a FAT16 volume
  if (!Fat16::init(&card)) error("Fat16::init");
 
  // open a file
  if (file.open("PRINT00.TXT", O_READ)) {
    PgmPrintln("Opened PRINT00.TXT");
  } else if (file.open("WRITE00.TXT", O_READ)) {
    PgmPrintln("Opened WRITE00.TXT");   
  } else{
    error("file.open");
  }
  Serial.println();
 
  // copy file to serial port
  int16_t n;
  uint8_t buf[7];// nothing special about 7, just a lucky number.
  while ((n = file.read(buf, sizeof(buf))) > 0) {
    for (uint8_t i = 0; i < n; i++) Serial.write(buf[i]);
  }
   PgmPrintln("\nDone");
}

void loop(void) {}

So how can I convert the uint8_t Array to a float variable ?
Thanks for your help smiley
8  Community / Exhibition / Gallery / Re: Cheap-Thermocam V2 | A cheap thermographic camera for everyone ! on: May 17, 2013, 09:10:06 am
I have not worked sensor ((tried everything that you can!
There is some way to test it on the performance?
My board  Arduino Mega 2560
When I look through a serial port of the sensor is silent. White screen and all.
 smiley-sad smiley-sad

I have not worked sensor ((tried everything that you can!
There is some way to test it on the performance?
My board  Arduino Mega 2560
When I look through a serial port of the sensor is silent. White screen and all.
 smiley-sad smiley-sad

Try this code: http://cheap-thermocam.bplaced.net/MLX90614_new.zip
It is a re-implementation of the code with a new I2C library.
Take care that the Pins for I2C are different on the arduino mega. They are located on digital pin 20 (SDA) and 21 (SCL).
9  Community / Exhibition / Gallery / Re: Cheap-Thermocam V2 | A cheap thermographic camera for everyone ! on: April 15, 2013, 09:17:15 am
maxbot, fyi, trend 'worry free' anti virus blocks me going to your website, it's marked as malicious

Thanks for for reporting me that situation. Of course, my website does not contain any kind of malicious software. I have no idea how Trend Micro comes to their block..
I requested a reclassification on their website and hope they fix that soon.
10  Community / Exhibition / Gallery / Re: Cheap-Thermocam V2 | A cheap thermographic camera for everyone ! on: April 14, 2013, 12:07:12 pm
The website has been updated and version 2 is now finally there smiley
11  Community / Exhibition / Gallery / Re: Cheap-Thermocam | A cheap thermographic camera for everyone ! on: February 19, 2013, 09:54:42 am
Great project!! Just finished building mine for a school project (research lab wouldn't loan me the FLIR camera). Max I noticed you removed the pull-up resistor note on your website - don't know if this was on purpose, but I connected the sensor directly to A4 & A5 and it's working without a problem.

I used the EEPROM update, it too worked without any problems. The surface temperatures I am getting seem accurate. This sketch is also a good way to be sure that you have the sensor connected properly - If it doesn't read the inital values, check your connections. Just unplug the 'duino before uploading the new values if you don't want them.

In reference to dvernor's question, I was having some trouble with the Java software too. I could get it to calibrate but when I started the scan, the program would hang. Uninstalling 64-bit Java and using 32-bit fixed it; working great now.

Other troubleshooting item - when I started the Java program for the first time, to calibrate, the arrow buttons didn't respond - I found that it was just out of range, if you press a button in the same direction for long enough the servos eventually respond...

Thank you for sharing all of your hard work on this!

Thanks for your feedback smiley Yes I removed the resistors in the schematic because I noticed they are not required to get the sensor to work. Unfortunately, the rxtx and civil lib do not work with 64 bit systems so a 32bit java is necessary at least.. The thing with servos is a bit confusing because the arduino sketch has standard values for the servos in it (in case you start the program first time) and those should be definitely in the servo's range. I hope this is a one time error and it works now for you smiley-wink
12  Community / Exhibition / Gallery / Re: Cheap-Thermocam | A cheap thermographic camera for everyone ! on: February 18, 2013, 01:28:27 am
Hello,
Great project .
Can I get the source code of the arduino. i would like to make some experiments, and learn how the program works.

Avinoam

The source code is available for download at the website www.cheap-thermocam.tk
If anyone can help me I would greatly appreciate it, I am having trouble getting the Java application to open.  When I run the cmd prompt it returns the following

java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Kenny\Desktop\JAVA\lib\win32-x86\rxtxSerial.dll: The specified procedure could not be found thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Kenny\Desktop\JAVA\lib\win32-86\rxtxSerial.dll: The specified procedure could not be found
     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
     at java.lang.ClassLoader.loadLibrary1(Unknown Source)
     at java.lang.ClassLoader.loadLibrary0(Unknown Source)
     at java.lang.ClassLoader.loadLibrary(Unknown Source)
     at java.lang.Runtime.loadLibrary0(Unknown Source)
     at java.lang.System.loadLibrary(Unknown Source)
     at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
     at com.centralnexus.thermal.StartMenu.findCOMPorts(StartMenu.java:280)
     at com.centralnexus.thermal.StartMenu.<init>(StartMenu.java:124)
     at com.centralnexus.thermal.StartMenu.main(StartMenu.java:467)

Any help would be greatly appreciated!!!!  Thanks!
 

Not quite sure about this... What OS are you using ? Have you installed the 32-bit version of java and uninstalled any 64 bit version ?

Hello

what is the usage of laser in the thermal camera.

The laser is needed to match the sensors position with the optical image and to show you the current area measured
13  Community / Exhibition / Gallery / Re: Arduino and MLX90620 16X4 pixel IR thermal array on: January 04, 2013, 02:34:45 pm
Thanks a lot for your work, IlBaboomba !
I finished my code in a short time and all the recommendations you made are completely right.
Am I allowed to replace the code in my first post with yours ?
14  Using Arduino / General Electronics / Re: Connecting to a MLX90620 on: October 08, 2012, 02:47:59 pm
I got the MLX90620 working with the arduino, you can find the sketch and circuit diagramm here: http://arduino.cc/forum/index.php/topic,126244.msg949212.html#msg949212
15  Community / Exhibition / Gallery / Arduino and MLX90620 16X4 pixel IR thermal array on: October 08, 2012, 02:40:06 pm
Hello guys,
I want to share with you the code and wiring circuit to get the new MLX90620 working with the arduino. Like the well-known MLX90614, the sensor detects thermal radiation and measures temperatures without making contact with the object. The advantage of this sensor is that it can read 64 pixels at the same time VERY fast and accurate. For the price and size, it is a great thermal sensor.

Specifications of the sensor:
- Small size, cost effective 16X4 pixel, thermal array
- Active thermopile pixel technology for fast readout Easy to integrate
- Factory calibrated in wide temperature range: -40 to 85 °C for sensor temperature and -20 to 300 °C for object temperature. 2 Field Of View options: 60X15degrees or 40X10degrees
- High speed I2C digital interface for fast data transfer
- Programmable frame rate 0.5 to 64Hz.

Price:
45€ / 60$ for the 60° version -> http://www.futureelectronics.com/en/technologies/semiconductors/analog/sensors/temperature/Pages/5020660-MLX90620ESF-BAB-000-TU.aspx?IM=0
47€ / 65$ for the 40° version -> http://www.futureelectronics.com/en/Technologies/Product.aspx?ProductID=MLX90620ESFBAD000TUMELEXIS7020660&IM=0

Wiring:
You connect the MLX90620 to 3.3V over a diode, to break it down to the required 2.6V.
GND to GND, SCA to PIN 4 and SCL to PIN 5. Check out the official datasheet concerning the pin connections on the sensor.

Source Code - thanks to IlBaboomba for his various improvements:
Code:
/*
 * Attention! I commented out the alpha_ij array, so if you're going to compile the sketch you'll get for sure an error.
 * You should replace all 64 values with the alpha_ij calculated using the values stored in your MLX90620's EEPROM.
 * I suggest you to make an EEPROM dump, print it on the Serial port and store it in a file. From there, with the help of a spreadsheet (Libreoffice, Google Docs, Excel...) calculate your own alpha_ij values.
 * Please also pay attention to your emissivity value: since in my case it was equal to 1, to save SRAM i cut out that piece of calculation. You need to restore those lines if your emissivity value is not equal to 1.
 */

#include <i2cmaster.h>

int freq = 16;  //Set this value to your desired refresh frequency

int IRDATA[64];
byte CFG_LSB, CFG_MSB, PTAT_LSB, PTAT_MSB, CPIX_LSB, CPIX_MSB, PIX_LSB, PIX_MSB;
int PIX, v_th, CPIX;
float ta, to, emissivity, k_t1, k_t2;
float temperatures[64];
int count=0;
unsigned int PTAT;
int a_cp, b_cp, tgc, b_i_scale;

int a_ij[64];
int b_ij[64];
//float alpha_ij[64] = {1.591E-8, 1.736E-8, 1.736E-8, 1.620E-8, 1.783E-8, 1.818E-8, 1.992E-8, 1.748E-8, 1.864E-8, 2.056E-8, 2.132E-8, 2.033E-8, 2.097E-8, 2.324E-8, 2.388E-8, 2.161E-8, 2.155E-8, 2.394E-8, 2.353E-8, 2.068E-8, 2.353E-8, 2.633E-8, 2.708E-8, 2.394E-8, 2.499E-8, 2.778E-8, 2.731E-8, 2.580E-8, 2.539E-8, 2.796E-8, 2.871E-8, 2.598E-8, 2.586E-8, 2.801E-8, 2.830E-8, 2.633E-8, 2.609E-8, 2.894E-8, 2.924E-8, 2.633E-8, 2.464E-8, 2.778E-8, 2.894E-8, 2.673E-8, 2.475E-8, 2.737E-8, 2.796E-8, 2.679E-8, 2.394E-8, 2.708E-8, 2.714E-8, 2.644E-8, 2.347E-8, 2.563E-8, 2.493E-8, 2.388E-8, 2.179E-8, 2.440E-8, 2.504E-8, 2.295E-8, 2.033E-8, 2.283E-8, 2.295E-8, 2.155E-8};  //<-- REPLACE THIS VALUES WITH YOUR OWN!
//float v_ir_off_comp[64];  //I'm going to merge v_ir_off_comp calculation into v_ir_tgc_comp equation. It's not required anywhere else, so I'll save 256 bytes of SRAM doing this.
float v_ir_tgc_comp[64];
//float v_ir_comp[64]; //removed to save SRAM, in my case v_ir_comp == v_ir_tgc_comp



void config_MLX90620_Hz(int Hz){
  byte Hz_LSB;
  switch(Hz){
    case 0:
      Hz_LSB = B00001111;
      break;
    case 1:
      Hz_LSB = B00001110;
      break;
    case 2:
      Hz_LSB = B00001101;
      break;
    case 4:
      Hz_LSB = B00001100;
      break;
    case 8:
      Hz_LSB = B00001011;
      break;
    case 16:
      Hz_LSB = B00001010;
      break;
    case 32:
      Hz_LSB = B00001001;
      break;
    default:
      Hz_LSB = B00001110;
  }
  i2c_start_wait(0xC0);
  i2c_write(0x03);    
  i2c_write((byte)Hz_LSB-0x55);
  i2c_write(Hz_LSB);  
  i2c_write(0x1F);  
  i2c_write(0x74);  
  i2c_stop();
}

void read_EEPROM_MLX90620(){
  byte EEPROM_DATA[256];
  i2c_start_wait(0xA0);    
  i2c_write(0x00);
  i2c_rep_start(0xA1);
  for(int i=0;i<=255;i++){
    EEPROM_DATA[i] = i2c_readAck();
  }
  i2c_stop();
  varInitialization(EEPROM_DATA);
  write_trimming_value(EEPROM_DATA[247]);
}

void write_trimming_value(byte val){
  i2c_start_wait(0xC0);
  i2c_write(0x04);
  i2c_write((byte)val-0xAA);
  i2c_write(val);  
  i2c_write(0x56);  
  i2c_write(0x00);  
  i2c_stop();
}

void calculate_TA(){
  ta = (-k_t1 + sqrt(square(k_t1) - (4 * k_t2 * (v_th - (float)PTAT))))/(2*k_t2) + 25; //it's much more simple now, isn't it? :)
}

void calculate_TO(){
  float v_cp_off_comp = (float) CPIX - (a_cp + (b_cp/pow(2, b_i_scale)) * (ta - 25)); //this is needed only during the to calculation, so I declare it here.
  
  for (int i=0; i<64; i++){
    v_ir_tgc_comp[i] = IRDATA[i] - (a_ij[i] + (float)(b_ij[i]/pow(2, b_i_scale)) * (ta - 25)) - (((float)tgc/32)*v_cp_off_comp);
    //v_ir_comp[i]= v_ir_tgc_comp[i] / emissivity; //removed to save SRAM, since emissivity in my case is equal to 1.
    //temperatures[i] = sqrt(sqrt((v_ir_comp[i]/alpha_ij[i]) + pow((ta + 273.15),4))) - 273.15;
    temperatures[i] = sqrt(sqrt((v_ir_tgc_comp[i]/alpha_ij[i]) + pow((ta + 273.15),4))) - 273.15; //edited to work with v_ir_tgc_comp instead of v_ir_comp
  }
}


void read_IR_ALL_MLX90620(){
  i2c_start_wait(0xC0);
  i2c_write(0x02);      
  i2c_write(0x00);    
  i2c_write(0x01);      
  i2c_write(0x40);      
  i2c_rep_start(0xC1);
  for(int i=0;i<=63;i++){
    PIX_LSB = i2c_readAck();
    PIX_MSB = i2c_readAck();
    IRDATA[i] = (PIX_MSB << 8) + PIX_LSB;
  }
  i2c_stop();
}

void read_PTAT_Reg_MLX90620(){
  i2c_start_wait(0xC0);
  i2c_write(0x02);
  i2c_write(0x90);
  i2c_write(0x00);
  i2c_write(0x01);
  i2c_rep_start(0xC1);
  PTAT_LSB = i2c_readAck();
  PTAT_MSB = i2c_readAck();
  i2c_stop();
  PTAT = ((unsigned int)PTAT_MSB << 8) + PTAT_LSB;
}

void read_CPIX_Reg_MLX90620(){
  i2c_start_wait(0xC0);
  i2c_write(0x02);
  i2c_write(0x91);
  i2c_write(0x00);
  i2c_write(0x01);
  i2c_rep_start(0xC1);
  CPIX_LSB = i2c_readAck();
  CPIX_MSB = i2c_readAck();
  i2c_stop();
  CPIX = (CPIX_MSB << 8) + CPIX_LSB;
}

void read_Config_Reg_MLX90620(){
  i2c_start_wait(0xC0);
  i2c_write(0x02);
  i2c_write(0x92);
  i2c_write(0x00);
  i2c_write(0x01);
  i2c_rep_start(0xC1);
  CFG_LSB = i2c_readAck();
  CFG_MSB = i2c_readAck();
  i2c_stop();
}

void check_Config_Reg_MLX90620(){
  read_Config_Reg_MLX90620();
  if ((!CFG_MSB & 0x04) == 0x04){
    config_MLX90620_Hz(freq);
  }
}

void varInitialization(byte EEPROM_DATA[]){
  v_th = (EEPROM_DATA[219] <<8) + EEPROM_DATA[218];
  k_t1 = ((EEPROM_DATA[221] <<8) + EEPROM_DATA[220])/1024.0;
  k_t2 =((EEPROM_DATA[223] <<8) + EEPROM_DATA[222])/1048576.0;
  
  a_cp = EEPROM_DATA[212];
  if(a_cp > 127){
    a_cp = a_cp - 256;
  }
  b_cp = EEPROM_DATA[213];
  if(b_cp > 127){
    b_cp = b_cp - 256;
  }
  tgc = EEPROM_DATA[216];
  if(tgc > 127){
    tgc = tgc - 256;
  }

  b_i_scale = EEPROM_DATA[217];

  emissivity = (((unsigned int)EEPROM_DATA[229] << 8) + EEPROM_DATA[228])/32768.0;

  for(int i=0;i<=63;i++){
    a_ij[i] = EEPROM_DATA[i];
    if(a_ij[i] > 127){
      a_ij[i] = a_ij[i] - 256;
    }
    b_ij[i] = EEPROM_DATA[64+i];
    if(b_ij[i] > 127){
      b_ij[i] = b_ij[i] - 256;
    }
  }
}

void Temperatures_Serial_Transmit(){
  for(int i=0;i<=63;i++){
    Serial.println(temperatures[i]);
  }
}

void setup(){
  pinMode(13, OUTPUT);
  Serial.begin(115200);
  i2c_init();
  PORTC = (1 << PORTC4) | (1 << PORTC5);
  delay(5);
  read_EEPROM_MLX90620();
  config_MLX90620_Hz(freq);
}

void loop(){
  if(count ==0){ //TA refresh is slower than the pixel readings, I'll read the values and computate them not every loop.
    read_PTAT_Reg_MLX90620();
    calculate_TA();
    check_Config_Reg_MLX90620();
  }
  count++;
  if(count >=16){
    count = 0;
  }
  read_IR_ALL_MLX90620();
  read_CPIX_Reg_MLX90620();
  calculate_TO();
  Temperatures_Serial_Transmit();
}

You also need the I2CMaster library from here: http://www.cheap-thermocam.bplaced.net/software/I2Cmaster.rar (SCL_CLOCK has already been set to 400000)
This sketch transfers all 64 pixels to the computer over the serial window. For information about which pixel correspond to which position, check out the MLX90620 datasheet: http://www.melexis.com/Asset/Datasheet-IR-thermometer-16X4-sensor-array-MLX90620-DownloadLink-6099.aspx

I originally intended to integrate this sensor into my Cheap-Thermocam project www.cheap-thermocam.com), but it did not make it at the end.
Pages: [1] 2 3 ... 6