IR sensor

Posted on
  • Dear Forum,

    I am building a temperature measurement and occupant sensing device with omron IR sensors.
    http://www.omron.com/ecb/products/sensor­/11/d6t.html

    I know this sensor can be used with Arduino, and am considering Arduino with a data logging shield. https://www.adafruit.com/products/1141

    However, I really like node.js and have a modeling software application already running node so am considering going with espruino so that I can integrate the two projects.

    I am wondering, [sorry for the newb questions!] will this sensor work with the espruino board?
    Is there good averaging or other calculation libraries that might be re-used for this?

    I am also looking to measure heat flux and thermocouple surface temperature in the same device, involving some amplification.

    Humidity, Barometric Pressure, and Altitude will also be measured.

    I can easily find some of this for Arduino, while other elements will need to be developed regardless.

    I guess my question is, does this seem like a good fit for espruino?


    1 Attachment

    • d6t.jpg
  • Yup, that sensor will work with Espruino.

    I don't see a description of the I2C interface in the datasheet that I was able to find - you will need to write the module for it. Luckily writing modules for Espruino is a lot less painful than writing libraries for Arduino (just recently have been doing some deeper things with Arduino that make me appreciate Espruino more). I could comment on how bad the module will be to write if you could point me to the datasheet that explains how to talk to it over I2C.

    What do you mean by averaging/calculation libraries?

    We've got a module for one of the Maxim thermocouple controllers, and the ever-popular BMP180 (temp + pressure) and a couple of temp+humidity sensors - you can take a look on the modules page. The original Espruino Board has a builtin uSD card slot. The Pico can take an external SD reader module (of the kind available for a like $2 or less on ebay). So other than needing to write a module for the sensor, you're good to go on the sensors.

    That's a neat sensor - how much do they cost?

  • DrAzzy,

    First- thanks for the quick and kind reply. It makes a newb feel good about choosing to know that the community is open and receptive.

    Regarding writing the module- I have purchased one of the sensors, and plan on getting the other once I get something working. I contacted the manufacture and was told they would get back to me on the 10th. Given the message I got was in Japanese I am not so sure how well the tech support will be. With that in mind, is there any way you could be more implicit for "the datasheet that explains how to talk to it over I2C"

    Here is what I can find that seems like what you are looking for:

    Output specifications: Digital values that correspond to the object temperature (Tx) and reference temperature (Ta) are output from a serial communications port.
    Output form: Binary code (10 times the detected temperature (°C))

    Also I have found the following documents:
    Specification:
    https://www.components.omron.com/compone­nts/web/PDFLIB.nsf/0/FF9EBCACCEA85DCD862­57A4F005D00A4/$file/D6T_1112.pdf
    Application note: This seems to have the information you are looking for on page 8, table 6: http://media.digikey.com/pdf/Data%20Shee­ts/Omron%20PDFs/D6T44L_8L_Appl_Note.pdf
    How to read dates: http://media.digikey.com/pdf/Other%20Rel­ated%20Documents/Omron%20Other%20Doc/Omr­on_Date_Code.pdf

    Thanks, yes the cost is certainly attractive, about $50 that is. For my application I am measuring phase change materials in buildings and the loads that effect them and am making a wall mounted unit that contains one of the "square" view sensors facing the zone to sense occupancy and one "rectangle" view sensor that is faced sideways towards the wall. Also, the devise shall have other sensors such as pressure + temperature, humidity + temperature, light, motion, CO2, surface temperature, and heat flux. From what I gather I will need to write a module for each of these if there is not already a module in place. With a 3d printed hexagonal case I think it should cost less then $500 in parts and sell for about $1,200 per assembled unit.

    I code a bit, but also have some programmers I pay to work on a node.js project and am looking to understand what I am asking for and how much work I need to plan on to make this product a reality.

    Thanks for any help or comments--

    Kindest of regards

  • The app note seems like what you need. Specifically:

    int D6T_getvalue()
    {
     I2C_start();
     I2C_send1( 0x14 , 0x4C ); // 14h = { 0Ah(Addr7) : Write(0b) }
     I2C_repeatstart();
     I2C_getx( 0x15 , readbuff , 35 ); // 15h = { 0Ah(Addr7):Read },35 = 2*(1+16)+1
     I2C_stop();
     If(!D6T_checkPEC(readbuff,34)){
     return - 1; // error
     }
     tPTAT = 256*readbuff[1] + readbuff[0];
     tP[0] = 256*readbuff[3] + readbuff[2];
     tP[1] = 256*readbuff[5] + readbuff[4];
     tP[2] = 256*readbuff[7] + readbuff[6];
     tP[3] = 256*re adbuff[9] + readbuff[8];
     tP[4] = 256*readbuff[11] + readbuff[10];
     tP[5] = 256*readbuff[13] + readbuff[12];
     tP[6] = 256*readbuff[15] + readbuff[14];
     tP[7] = 256*readbuff[17] + readbuff[16];
     tP[8] = 256*readbuff[19] + readbuff[18];
     tP[9] = 256*readbuff[21] + readbuff[20];
     tP[10] = 256*readbuff[23] + readbuff[22];
     tP[11] = 256*readbuff[25] + readbuff[24];
     tP[12] = 256*readbuff[27] + readbuff[26];
     tP[13] = 256*readbuff[29] + readbuff[28];
     tP[14] = 256*readbuff[31] + readbuff[30] ;
     tP[15] = 256*readbuff[33] + readbuff[32];
     tPEC = readbuff[34];
     return 1;
    } 
    

    So it looks pretty straightforward - just sending a few bytes down I2C, reading the result back, and converting it to 16 bit. It should just be a few lines.

    Having said that it seems that it might use I2C repeated start, which I'm not sure works on Espruino just yet. There's a bug open for it. It's something I am planning to soon fix though, I'm just a bit short on time right now!

    It may be that it's not needed, but without a module to test with I can't be sure.

  • Thanks again, I got my espruino and flashed it. Ill try and get this sensor working and will let you know how I get on.

    Thanks again for your help

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

IR sensor

Posted by Avatar for user53599 @user53599

Actions