Programming OMRON - D6T MEMS Thermal Sensor as people counter

Hello
guys

Im using OMRON - D6T MEMS Thermal Sensor and for my project and it capable of counting the number of people inside the room, but the problem the code isn't provided by the company so Id like to ask you guys if you can provide me with the code.

Thank you all

Id like to ask you guys if you can provide me with the code.

No. You need to provide, at a minimum, a link to the hardware in question.

Thank you for reply this is the datasheet for the component

en-d6t.pdf (772 KB)

That data sheet appears to be next to useless. It claims that the device is a serial device, but says nothing about voltages (TTL or RS232), baud rate, etc.

It does mention SDA and SCL, which are I2C terms. and mentions pullup resistors, but says nothing about size.

Hopefully, someone else will have used one of these devices, or knows more about I2C that I do.

anyways thank you pauls for reply I appreciate it

Just came across this. I am also working on this thing. Thought it will be of help to you.

http://www.mouser.com/pdfdocs/D6T01_ThermalIRSensorWhitepaper.pdf

I found this Jap website that has code for any 5V Arduino board. The author includes a Processing code for those who wants visual effect.

I have tried the programme on my Arduino Due but am still receiving 0.0 from the readings.
Please reply if you are successful in getting a reading.

Hi!, I am also working with this sensor. It was difficult because there's not much info about this in the internet (unless you are japanese) :slight_smile:
Here's my code, I hope it can help you. I connected a 20x4 LCD to the arduino, so it could print the 16 temperatures in a matrix. It works really nice...

#include <Wire.h>
#include <WireExt.h>
#include <LiquidCrystal.h>

//Pin config
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

#define D6T_addr 0x0A
#define D6T_cmd 0x4C
 
int rbuf[35];
int tdata[16];
float t_PTAT;

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  lcd.begin(20, 4);
  pinMode(13, OUTPUT);
}
 
void loop()
{
  int i;

      Wire.beginTransmission(D6T_addr);
      Wire.write(D6T_cmd);
      Wire.endTransmission();
 
      if (WireExt.beginReception(D6T_addr) >= 0) {
        i = 0;
        for (i = 0; i < 35; i++) {
          rbuf[i] = WireExt.get_byte();
        }
        WireExt.endReception();
 
        t_PTAT = (rbuf[0]+(rbuf[1]<<8))*0.1;
        for (i = 0; i < 16; i++) {
          tdata[i]=(rbuf[(i*2+2)]+(rbuf[(i*2+3)]<<8))*0.1;
        } 
      }
  
          lcd.clear();
          lcd.setCursor(0, 0);
          lcd.print(tdata[0],1);
          lcd.setCursor(5,0);
          lcd.print(tdata[1],1);
          lcd.setCursor(10,0);
          lcd.print(tdata[2],1);
          lcd.setCursor(15,0);
          lcd.print(tdata[3],1);
          
          lcd.setCursor(0,1);
          lcd.print(tdata[4],1);
          lcd.setCursor(5,1);
          lcd.print(tdata[5],1);
          lcd.setCursor(10,1);
          lcd.print(tdata[6],1);
          lcd.setCursor(15,1);
          lcd.print(tdata[7],1);

          lcd.setCursor(0,2);
          lcd.print(tdata[8],1);
          lcd.setCursor(5,2);
          lcd.print(tdata[9],1);
          lcd.setCursor(10,2);
          lcd.print(tdata[10],1);
          lcd.setCursor(15,2);
          lcd.print(tdata[11],1);
          
          lcd.setCursor(0, 3);
          lcd.print(tdata[12],1);
          lcd.setCursor(5,3);
          lcd.print(tdata[13],1);
          lcd.setCursor(10,3);
          lcd.print(tdata[14],1);
          lcd.setCursor(15,3);
          lcd.print(tdata[15],1);
          delay(100);          
}

I had to install the <WireExt.h> library. I found it on a jap website, but I don't remeber exactly where, you have to install it due to the number of bytes this sensor works with. (The Wire.h library works with only 32 bytes, but this sensor works with 35 so that's why you need it)

Hi just a question, I realized the Sensor doesn't come with the Cable Harness. Is it a must to purchase it? Or can I use the sensor without the cable harness? What does the cable harness do anyways?

Gabyua:
I had to install the <WireExt.h> library. I found it on a jap website, but I don't remeber exactly where, you

Hi @Gabyua,

I'm currently working on a school project & it requires me to detect the presence of a person. I did a research and figured the D6T sensor best suit my options. However, it is costly & I am afraid it might be a waste if I bought it using my budget but do not know how to properly program it. Can I use your code instead? I have the Arduino IDE but my proj do not require LCD so I'm wondering what codes do i need to take away? Also, how do I attain the WireExt.h lib? I can't seem to see it anywhere on the net. It always end up in this link http://fenrir.naruoka.org/download/autopilot/external/camera_breakout/arduino_library/WireExt/
Do I have to create one on my arduino library folder? How do I do that? Really hope you can help me in this!

Hi Gabya and James,
did anyone manage to compile and build the WireExt.h library for this?
would be great to download a library and get the code running.
thanks

i went through your code for detecting human presence by d6t sensor. It is working but i am having a problem to set the range of temperature. As i am working on a project to automatically power off the lights when there is no one present in the room...So how can i set the standard for the same.. Can u please tell me how you detected it... Reply asap

Gabyua Thank you for the great code! I didn't have a 20x4 LCD to rig up so I just changed it to a Serial Monitor output which I'm going to analyze now in Matlab.

For anyone else who doesn't have an LCD output, here is the modified code I'm using to send it to Serial.

// Code from Arduino Forum https://forum.arduino.cc/index.php?topic=217394.0
// Modified to a Serial Output

#include <Wire.h>
#include <WireExt.h>

#define D6T_addr 0x0A // Address of OMRON D6T is 0x0A in hex
#define D6T_cmd 0x4C // Standard command is 4C in hex

int rbuf[35]; // Actual raw data is coming in as 35 bytes. Hence the needed for WireExt so that we can handle more than 32 bytes
int tdata[16]; // The data comming from the sensor is 16 elements, in a 16x1 array
float t_PTAT;

void setup()
{
 Wire.begin();
 Serial.begin(9600);

 pinMode(13, OUTPUT);
}

void loop()
{
 int i;

     Wire.beginTransmission(D6T_addr);
     Wire.write(D6T_cmd);
     Wire.endTransmission();

     if (WireExt.beginReception(D6T_addr) >= 0) {
       i = 0;
       for (i = 0; i < 35; i++) {
         rbuf[i] = WireExt.get_byte();
       }
       WireExt.endReception();

       t_PTAT = (rbuf[0]+(rbuf[1]<<8))*0.1; // Unclear what this is used for. It's not called elsewhere
       for (i = 0; i < 16; i++) {
         tdata[i]=(rbuf[(i*2+2)]+(rbuf[(i*2+3)]<<8))*0.1;
       } 
     }
 
        
     // Data is captured into tdata. This should be a 16x1 data. For now we can output as a csv string which we can import to Matlab to sequence
     for (i=0; i<16; i++) {
       Serial.print(tdata[i]);
       Serial.print(",");
     }
     Serial.print("\n");
     
         delay(100);          
}

Hi there, has anyone an wire connection diagram voor connecting the omron to the arduino ?

I have used this code.I have added <WireExt.h>file to libraries.But I am getting this error
#include <avr/io.h>. Should I include avr/io.h file to library or the Atmel ATSAM3XSL board library which I am using.
#include <avr/io.h>

// Code from Arduino Forum Programming OMRON - D6T MEMS Thermal Sensor as people counter - Programming Questions - Arduino Forum
// Modified to a Serial Output

#include <Wire.h>
#include <WireExt.h>

#define D6T_addr 0x0A // Address of OMRON D6T is 0x0A in hex
#define D6T_cmd 0x4C // Standard command is 4C in hex

int rbuf[35]; // Actual raw data is coming in as 35 bytes. Hence the needed for WireExt so that we can handle more than 32 bytes
int tdata[16]; // The data comming from the sensor is 16 elements, in a 16x1 array
float t_PTAT;

void setup()
{
Wire.begin();
Serial.begin(9600);

pinMode(13, OUTPUT);
}

void loop()
{
int i;

Wire.beginTransmission(D6T_addr);
Wire.write(D6T_cmd);
Wire.endTransmission();

if (WireExt.beginReception(D6T_addr) >= 0) {
i = 0;
for (i = 0; i < 35; i++) {
rbuf = WireExt.get_byte();

  • }*
  • WireExt.endReception();*
    t_PTAT = (rbuf[0]+(rbuf[1]<<8))*0.1; // Unclear what this is used for. It's not called elsewhere
  • for (i = 0; i < 16; i++) {*
    tdata_=(rbuf[(i2+2)]+(rbuf[(i2+3)]<<8))0.1;_
    _
    }_
    _
    }*_

* // Data is captured into tdata. This should be a 16x1 data. For now we can output as a csv string which we can import to Matlab to sequence*
* for (i=0; i<16; i++) {*
_ Serial.print(tdata*);
Serial.print(",");
}
Serial.print("\n");*_

* delay(100); *
}
*I have used this code.I have added <WireExt.h>file to libraries.But I am getting this error *
#include <avr/io.h>. Should I include avr/io.h file to library or the Atmel ATSAM3XSL board library which I am using.
* #include <avr/io.h>*

But I am getting this error

What error? Post the EXACT error message!

Pound
your
enter
key
once
in
a
while,
too.

And, read the damned stickies at the top of the forum. Left shifting by smiley face does NOT work.

Hello.
I have a quick question about Omron D6T-8L-06 sensor. Can I connect this sensor in arduino sheild?
Please replay my message ASAP.
Thanks.

Nicsandiland:
Hi Gabya and James,
did anyone manage to compile and build the WireExt.h library for this?
would be great to download a library and get the code running.
thanks

Follow this tutorial:

Cheers,
Karen

Hi all,
I'm from vietnam. Now, I'm using D6T thermal sensor to work graduate's project, but I don't know to buy sensor on website truth for ship about VietNam. I need help from everyone, please!
Anyone can contact with me: damanhduchdkg23081995@gmail.com
Thank all so much!

I need help from everyone, please!

How is THAT a programming issue?