Show Posts
Pages: 1 2 [3] 4 5 6
31  Using Arduino / Sensors / Re: Problem with Reading/Writing to the EEPROM of a MLX90614 on: April 29, 2011, 06:19:13 pm
I finally solved the problem, now everything is working:

Code:
#include <i2cmaster.h>

void setup()
{
Serial.begin(9600);
Serial.println("This program will change the EEPROM settings of");
Serial.println("your MLX90614-DCI sensor to work best with the");
Serial.println("Cheap-Thermocam. PRESS ANY KEY TO CONTINUE.");
Serial.println("");
Serial.println("Created by Max Ritter - www.cheap-thermocam.tk");
Serial.println("");
while (Serial.available() == 0) {
}
Serial.println("----------Let's begin!----------");
Serial.println("");
i2c_init();
PORTC = (1 << PORTC4) | (1 << PORTC5);

int dev = 0x00;
unsigned int data_l = 0;
unsigned int data_h = 0;
int pec = 0;
float data_t = 0;
float emissivity = 0;

//WRITE TO EEPROM, FIRST: ERASE OLD STUFF
Serial.println("*1: Erasing old EEPROM settings");
Serial.println("");
Serial.println("Erasing filter settings..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x25);
i2c_write(0x00); //Erase low byte (write 0)
i2c_write(0x00); //Erase high byte (write 0)
i2c_write(0x83); //Send PEC
//For PEC Calculation have a look at : http://smbus.org/faq/crc8Applet.htm
//In this case the PEC calculates from 250000 (=0x83)
i2c_stop();
delay(5000);

Serial.println("Erasing maximum temperature setting..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x20);
i2c_write(0x00);
i2c_write(0x00);
i2c_write(0x43);
i2c_stop();
delay(5000);

Serial.println("Erasing minimum temperature setting..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x21);
i2c_write(0x00);
i2c_write(0x00);
i2c_write(0x28);
i2c_stop();
delay(5000);

//WRITE TO EEPROM, THE NEW STUFF!
Serial.println("");
Serial.println("*2: Write new settings to EEPROM");
Serial.println("");
Serial.println("Writing new filter settings..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x25); //Register Address to write to
i2c_write(0x74); //New filter settings (B374)
i2c_write(0xB3);
i2c_write(0x65); //Send PEC
i2c_stop();
delay(5000);

Serial.println("Writing new maximum temperature setting..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x20);
i2c_write(0xFF);
i2c_write(0xFF);
i2c_write(0x67);
i2c_stop();
delay(5000);

Serial.println("Writing new minimum temperature setting..");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x21);
i2c_write(0x5B);
i2c_write(0x4F);
i2c_write(0x59);
i2c_stop();

Serial.println("");
Serial.println("----------Finish!----------");
}
void loop()
{
}


The code changes the filter settings of the MLX90614-DCI to the minimum value of 49ms (100% FIR) and extends the standard temperature range from -20 - 120 degree to -70 - 370 °.

@ Henkka:
Great that you also try to build a IR camera. Limiting the scanning range to ínteressting areas will be a possible soon. I will build a portable version of this cheap-thermocam which can be used standalone without any computer and in this step I will include the function. The latest information are always at www.cheap-thermocam.tk  smiley-wink
32  Using Arduino / Storage / Create Images on a SD Card on: April 21, 2011, 11:38:50 am
Hello guys,
my question is whether it's possible to create any kind of image (png, raw, jpg or another format) with the arduino and then save it on an attached SD card.
So for example I want to make an image with 12x12 pixels, tell the arduino which pixels are red/blue/green and then save that created picture on the card.
I searched a lot on the Internet but haven't found anything yet..
Thanks for your help !
Greetings,
Max
33  Using Arduino / Sensors / Re: Problem with Reading/Writing to the EEPROM of a MLX90614 on: April 14, 2011, 03:03:16 pm
I still haven't managed it to get the sketch above working :-(
can anybody pls help me ?
34  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 18, 2011, 11:29:22 am
Cool!

Is this sensitive enough to see any stars in the sky (other than our sun)?

Is this sensitive enough to see any stars in the sky (other than our sun) in the daytime?

Never thought about that.. I will try and post results within the next week
35  Using Arduino / Sensors / Re: IR Temperature Readings and Combustion Sensor on: March 16, 2011, 03:41:54 pm
Here you are: www.cheap-thermocam.tk
36  Using Arduino / Sensors / Re: Problem with Reading/Writing to the EEPROM of a MLX90614 on: March 16, 2011, 12:41:22 pm
Use 'bitwise AND" and "bitwise OR" operators to clear the fields you want to set and set the values.

Code:
/Simple program to read/write to the EEPROM (or read RAM) of the MLX90614 IR Sensor (in my case
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); 
i2c_rep_start(dev+I2C_READ);
unsigned int register = i2c_readAck(); //Read low byte and then send ack
register |= i2c_readAck() << 8; //Read high byte and then send ack
pec = i2c_readNak();
i2c_stop();

// Set the register to: 0b100xxxxx100xxxxx  (where 'x' means 'do not modify)
register &= 0b0001111100011111;  // Clear all bits in the fields to be modified.
register |= 0b1000000010000000;  //Set bits in those fields to 1 where needed


//WRITE TO EEPROM, THE NEW STUFF!

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); //Register Address to write to
i2c_write(register);
i2c_write(register >> 8);
i2c_write(0xCC); //Send PEC
i2c_stop();


Thanks a lot for your work ! Unfortunately, it's not working correctly but I don't know whats the reason...
Heres the full code:
Code:
#include <i2cmaster.h>

void setup()
{
Serial.begin(9600);
i2c_init();                             //Initialise i2c bus
PORTC = (1 << PORTC4) | (1 << PORTC5);  //enable pullups

int dev = 0x5A<<1; // I use the general address. If I specify the address
                //(0x05<<1), the code doesn't work, don't know why... yet.
unsigned int value = 0;
int pec = 0;
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x25); 
i2c_rep_start(dev+I2C_READ);
value = i2c_readAck(); //Read low byte and then send ack
value |= i2c_readAck() << 8; //Read high byte and then send ack
pec = i2c_readNak();
i2c_stop();
// Set the register to: 0b100xxxxx100xxxxx  (where 'x' means 'do not modify)
wert &= 0b0001111100011111;  // Clear all bits in the fields to be modified.
wert |= 0b1000000010000000;  //Set bits in those fields to 1 where needed


//WRITE TO EEPROM, THE NEW STUFF!

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x25); //Register Address to write to
i2c_write(value);
i2c_write(value >> 8);
i2c_write(0xCC); //Send PEC
i2c_stop();
}

void loop()
{
}

Anybody finds a mistake ?
37  Using Arduino / Sensors / Problem with Reading/Writing to the EEPROM of a MLX90614 on: March 16, 2011, 08:42:08 am
Hello together,
I am stuck with the following problem and really need help from the community:
I have connected a Melexis MLX90614 Infrared Sensor to the Arduino to get temperature data.
Now i want to reduce the response time of the sensor by changing some values in the EEPROM.
According to this document http://www.melexis.com/Assets/Understanding-MLX90614-on-chip-digital-signal-filters-5272.aspx, I have to change bits 0-2 and 8-10 from a 16 bit column in the EEPROM ConfigRegister1. The other bits should not be changed, so the programm should read the register, make the alterations, then write the register value back, preserving the value in bits 3-7.

I found this sketch that modifies the emission rate of the MLX90614, i think this is very close to what I need:

Code:
/Simple program to read/write to the EEPROM (or read RAM) of the MLX90614 IR Sensor (in my case
//the MLX90614ESF-AAA). Example below erases the emissivity coefficient and then writes E = 1.
//Written be a total beginner, probably includes errors, and can definitely be
//improved on in many ways... /Lo-fi, 2011.

#include <i2cmaster.h>

void setup()
{
Serial.begin(9600);
Serial.println("----------Let's begin!----------");
i2c_init();                             //Initialise i2c bus
PORTC = (1 << PORTC4) | (1 << PORTC5);  //enable pullups
}

void loop()
{
int dev = 0x00; // I use the general address. If I specify the address
                //(0x05<<1), the code doesn't work, don't know why... yet.
unsigned int data_l = 0;
unsigned int data_h = 0;
int pec = 0;

float data_t = 0;
float emissivity = 0;

//READ EEPROM/RAM

Serial.println("*1: Read EEPROM address:");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24);  //0x004 and 0x04 etc reads the same address in the RAM,
                  //add 2(0) for EEPROM, eg. 0x24 (emissivity correction
                  //coefficient in EEPROM).

i2c_rep_start(dev+I2C_READ);
data_l = i2c_readAck(); //Read 1 byte and then send ack
data_h = i2c_readAck(); //Read 1 byte and then send ack
pec = i2c_readNak();
i2c_stop();

Serial.print("Data Low: ");
Serial.println(data_l);

Serial.print("Data High: ");
Serial.println(data_h);

Serial.print("Data combined: ");
data_t = (((data_h) << 8) + data_l);
Serial.println(data_t);

Serial.print("Emissivity: ");
emissivity = ((data_t) / 65535);
Serial.println(emissivity);

delay(5000);

//WRITE TO EEPROM, FIRST: ERASE OLD STUFF

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); //Register Address to write to

i2c_write(0x00); //Erase low byte (write 0)
i2c_write(0x00); //Erase high byte (write 0)
i2c_write(0xE8); //Send PEC
i2c_stop();

Serial.println("*2: Erasing old emissivity factor (writing 0).");
delay(5000);

//CHECK IF THE EEPROM VALUE HAS BEEN ERASED

Serial.println("*3: Check if the old emissivity coefficient was erased:");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24);  //See above comment.

i2c_rep_start(dev+I2C_READ);
data_l = i2c_readAck(); //Read 1 byte and then send ack
data_h = i2c_readAck(); //Read 1 byte and then send ack
pec = i2c_readNak();
i2c_stop();

Serial.print("Data Low: ");
Serial.println(data_l);

Serial.print("Data High: ");
Serial.println(data_h);

Serial.print("Data combined: ");
data_t = (((data_h) << 8) + data_l);
Serial.println(data_t);

Serial.print("Emissivity: ");
emissivity = ((data_t) / 65535);
Serial.println(emissivity);
delay(5000);

//WRITE TO EEPROM, THE NEW STUFF!

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); //Register Address to write to

i2c_write(0xFF); //New emissivity factor, Ef=1
i2c_write(0xFF); //New emissivity factor, Ef=1
i2c_write(0xCC); //Send PEC
i2c_stop();

Serial.println("*4: Write new E to EEPROM (E = 1.0).");
delay(5000);
Serial.println("----------The process starts over again----------");
delay(5000);
}

The only thing i know so far is that I have to change i2c_write(0x24);  to i2c_write(0x25); and that I need to send the following 16 Bits to this register:
1;0;0;R;R;R;R;R;1;0;0;R;R;R;R;R
R stands for read, so that the sketch first reads whats the existing value and then uses it.

Can anybody please help me with the adaption of the code ? Thanks a lot in advantage  smiley
38  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 15, 2011, 07:18:33 pm
Well, it says it uses a 2-wire interface, so you could probably use the Wire library on the Arduino to program it; page 6 details how to set ConfigRegister1, you basically send 11 bits of data (0-10) to address 0x05, which I guess is the address of the device on the 2-wire bus. The directions are a little vague; it sounds like you are -not- supposed to change bits 3-7, only bits 0-2 and bits 8-10, in order to change the settings. So you have to read the register, make the alterations, then write the register value back, preserving the value in bits 3-7.

Ok thanks. I understand this but code realisation is to difficult for me  smiley-confuse
I found this sketch that modifies the emission rate, i think this is very close to what I need:

Code:
/Simple program to read/write to the EEPROM (or read RAM) of the MLX90614 IR Sensor (in my case
//the MLX90614ESF-AAA). Example below erases the emissivity coefficient and then writes E = 1.
//Written be a total beginner, probably includes errors, and can definitely be
//improved on in many ways... /Lo-fi, 2011.

#include <i2cmaster.h>

void setup()
{
Serial.begin(9600);
Serial.println("----------Let's begin!----------");
i2c_init();                             //Initialise i2c bus
PORTC = (1 << PORTC4) | (1 << PORTC5);  //enable pullups
}

void loop()
{
int dev = 0x00; // I use the general address. If I specify the address
                //(0x05<<1), the code doesn't work, don't know why... yet.
unsigned int data_l = 0;
unsigned int data_h = 0;
int pec = 0;

float data_t = 0;
float emissivity = 0;

//READ EEPROM/RAM

Serial.println("*1: Read EEPROM address:");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24);  //0x004 and 0x04 etc reads the same address in the RAM,
                  //add 2(0) for EEPROM, eg. 0x24 (emissivity correction
                  //coefficient in EEPROM).

i2c_rep_start(dev+I2C_READ);
data_l = i2c_readAck(); //Read 1 byte and then send ack
data_h = i2c_readAck(); //Read 1 byte and then send ack
pec = i2c_readNak();
i2c_stop();

Serial.print("Data Low: ");
Serial.println(data_l);

Serial.print("Data High: ");
Serial.println(data_h);

Serial.print("Data combined: ");
data_t = (((data_h) << 8) + data_l);
Serial.println(data_t);

Serial.print("Emissivity: ");
emissivity = ((data_t) / 65535);
Serial.println(emissivity);

delay(5000);

//WRITE TO EEPROM, FIRST: ERASE OLD STUFF

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); //Register Address to write to

i2c_write(0x00); //Erase low byte (write 0)
i2c_write(0x00); //Erase high byte (write 0)
i2c_write(0xE8); //Send PEC
i2c_stop();

Serial.println("*2: Erasing old emissivity factor (writing 0).");
delay(5000);

//CHECK IF THE EEPROM VALUE HAS BEEN ERASED

Serial.println("*3: Check if the old emissivity coefficient was erased:");
i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24);  //See above comment.

i2c_rep_start(dev+I2C_READ);
data_l = i2c_readAck(); //Read 1 byte and then send ack
data_h = i2c_readAck(); //Read 1 byte and then send ack
pec = i2c_readNak();
i2c_stop();

Serial.print("Data Low: ");
Serial.println(data_l);

Serial.print("Data High: ");
Serial.println(data_h);

Serial.print("Data combined: ");
data_t = (((data_h) << 8) + data_l);
Serial.println(data_t);

Serial.print("Emissivity: ");
emissivity = ((data_t) / 65535);
Serial.println(emissivity);
delay(5000);

//WRITE TO EEPROM, THE NEW STUFF!

i2c_start_wait(dev+I2C_WRITE);
i2c_write(0x24); //Register Address to write to

i2c_write(0xFF); //New emissivity factor, Ef=1
i2c_write(0xFF); //New emissivity factor, Ef=1
i2c_write(0xCC); //Send PEC
i2c_stop();

Serial.println("*4: Write new E to EEPROM (E = 1.0).");
delay(5000);
Serial.println("----------The process starts over again----------");
delay(5000);
}

The only thing I know so far (after 2 hours of research..) is that I have to change i2c_write(0x24);  to i2c_write(0x25); and that I need to send the following 16 Bits to this register:
1;0;0;R;R;R;R;R;1;0;0;R;R;R;R;R
R stands for read, so that the sketch first reads whats the existing value and then uses it.

Can anybody please help me with the adaption of the code ? Thanks a lot in advantage  smiley
39  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 13, 2011, 06:19:56 pm
@cr0sh: thanks for the good explanation smiley
i dont think that moving the servo is a real problem because the limitation at speed at the moment comes from the infrared sensor. faster ones are more expensive and thats not the goal.
 i use the mlx90614 with a response time of 100ms which is at the standard configuration minimum.
today i found out that you can reduce the settle time to 37ms by adjusing some settings in eeprom of the mlx90614. that would make the whole process almost three times faster.
here is the document: http://www.melexis.com/Assets/Understanding-MLX90614-on-chip-digital-signal-filters-5272.aspx
my problem is that i dont know how to configure the sensor without this evaluation board (it costs about 250 dollar -.-)
can somebody help ?
40  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 13, 2011, 05:29:30 pm
Your homepage is annoying, all those pop-ups...
Here's the direct youtube-link for the video: http://www.youtube.com/watch?feature=player_embedded&v=fVilpSSpkDc

I don't know if there's more advantages for moving the mirror only, but the fact that there less mass to be moved for servos. Your version moves softly, and it doesn't seem to suffering about the device on it.

Cheers,
Kari

Annoying ? I don't get popups and I haven't implemented any, maybe they come from the hoster .tk and I can't see them because of Adblock..
I tried the mirror version but however, it's not working with my infrared sensor at all... Otherwise it would have been a good idea.
41  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 13, 2011, 03:22:57 pm
Homemade IRST, that's pretty cool.
Did you consider scanning a mirror rather than the infra-red sensor?

Excellent point, very small mirror will do the job!

Cheers,
Kari

Do you mean i should focus the sensor on a movable mirror instead of moving the whole sensor ?
42  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 12, 2011, 09:23:00 pm
The homepage is now online !

-> www.cheap-thermocam.tk
43  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 09, 2011, 02:04:18 pm
Thanks to Groove & Targettio for the positive feedback.
It's my first project withh the arduino or any other microcontroller at all, so it wasn't easy for me to learn all the required skills.
The Arduino transmits the measured temperature of each point via the usb serial port to the JAVA programm, where they are all saved and processed.
It would also be possible to save them on a SD Card to make the device independent from the PC while measuring (plus adding a lipo or so for energy supply), but that makes the whole project more expensive.

Heh, what I ment, is it serial data, analog or something else?
I formatted my question badly.

Cheers,
Kari


The sensor is a MLX90614 from Melexis (a special version with a teduced field of view), so I used one of the already existing code examples (http://interface.khm.de/index.php/lab/experiments/infrared-thermometer-mlx90614/) as a basis to talk to this ir sensor.
44  Community / Exhibition / Gallery / Re: Cheap-Thermocam | Thermal Imaging for around 100$ on: March 08, 2011, 06:48:41 am
What sort of information you get out from the device? That is so simple idea, but it never crossed my mind.

Cheers,
Kari

The Arduino transmits the measured temperature of each point via the usb serial port to the JAVA programm, where they are all saved and processed.
It would also be possible to save them on a SD Card to make the device independent from the PC while measuring (plus adding a lipo or so for energy supply), but that makes the whole project more expensive.
45  Community / Exhibition / Gallery / Cheap-Thermocam V2 | A cheap thermographic camera for everyone ! on: March 07, 2011, 06:20:40 pm
Cheap-Thermocam V2 | A cheap thermographic camera for everyone !




After some time of research I want to share with you my latest project called "Cheap-Thermocam".

The Cheap-Thermocam is a low-cost thermographic image scanner. With it you can analyse your house, electrical devices, etc. and identify for example thermal lacks.

Current FIR cameras on the market cost more than 2000€. My idea was it to reduce costs by using one single non-contact temperature sensor to create a thermographic image. This is done by moving the sensor with two servos over the target area. The popular arduino is used to control that procedure. All data is stored on a SD card. The thermal image can be created on any computer and combined with a normal optical image from a smartphone or a usual camera.

You can buy the newest version 2 either as a kit or pre-assembled. If you want to build the old version by yourself, you also find the instructions and software downloads on my website.

www.cheap-thermocam.com
Pages: 1 2 [3] 4 5 6