Go Down

Topic: MAX44005EDT+ (Read 229 times) previous topic - next topic

Aguila

Dears,

A time ago I started with Arduino and making some small programs and projects. I bought the arduino Uno and from that time I am daily busy with it. After some time of discovering and playing and making the first "projects" it is time for some real stuff.
I am often busy with Leds and I would like to make something herefore.

A led has several specifications, and 1 of these is the temperature color. The most common I have, are the 3000 K and the 4000 K.
I would like to check with a sensor and an Arduino what is the temperature color, 3000K or 4000K.

I have 3 pieces of the MAX44005EDT+ And with this I would like to make the setup. The only thing is that it is with I2C, and this I have never used... until now.

The MAX44005EDT+ datasheet you can find here: http://datasheets.maximintegrated.com/en/ds/MAX44005.pdf


Can somebody help me with this, please?
The program has to do the following:  check the LED , measuring Temperature color, write it to the Arduino, Value is displayed.

Is this quite easy to do?

Many thanks in advance.

Aguila

#1
Mar 03, 2014, 11:24 pm Last Edit: Mar 03, 2014, 11:28 pm by Aguila Reason: 1
Am I correct that I need 12 registers?

Ambient CLEAR High byte  - 0x04.  -->  decimal: 4
Ambient CLEAR Low byte -     0x05   --> decimal: 5
Ambient Red High Byte -      0x06.   --> decimal: 6
Ambient Red Low Byte -        0x07.    --> decimal: 7
Ambient Green High Byte-    0x08.    --> decimal: 8
Ambient Green Low Byte -    0x09.   --> decimal: 9
Ambient Blue High Byte -     0x0A.    --> decimal: 10
Ambient Blue Low Byte -      0x0B.   --> decimal: 11
Ambient  Infrared Low Byte - 0x0C. --> decimal: 12
Ambient Infrared Low Byte - 0x0D  --> decimal: 13
Ambient IR COMP High Byte - 0x0E --> decimal: 14
Ambient IR COMP Low Byte - 0x0F  --> decimal: 15

Or do I need:
TEMP High Byte - 012. --> decimal: 18
TEMP Low Byte - 013.  --> decimal: 19

pylon

Quote
Or do I need:
TEMP High Byte - 012. --> decimal: 18
TEMP Low Byte - 013.  --> decimal: 19


No, that's the temperature, how hot the sensor is.

In color temperature the temperature is used figuratively, it's about what colored light a piece of some material emits if heated to that temperature. That's different from what we expect by the usual effect a white light has: a warm white has a low color temperature while a cool white has a high color temperature.

So you have to read the red, green and blue values and calculate the color temperature from the value you get. The mathematical details for this can be found here: http://en.wikipedia.org/wiki/Color_temperature.
You don't need the infrared or clear values for your application.

You read the registers with some code like this:

Code: [Select]
uint8_t read_register(uint8_t addr) {
  Wire.beginTransaction(0x44); // 0x44 is the device address on the I2C bus
  Wire.write(addr);
  int err = Wire.endTransaction();
  // handle error here
  err = Wire.requestFrom(addr, 1);
  // handle error here
  uint8_t value = Wire.read();
  return value;
}

Aguila

Thank you very much. I'll try this out.

Go Up