Hello,
I need to write some code for Omron DT6-1A-01 thermal MEMS sensor. I have almost zero skill in coding but i found some codes for these types of application with this sensors (but very few).
I would like to ask, if i need use pull ups resistors or not, how to modify existing code.
Program should work like this:
Sensor measure temp and LED will light up if temp is in some values interval.
Simple code looks like
#include “OmronD6T.h”
OmronD6T sensor;
void setup() {
Serial.begin(9600);
}
void loop() {
sensor.scanTemp();
Serial.println("-------------------------");
int x, y;
for (y = 0; y < 4; y++){
for (x = 0; x < 4; x++){
Serial.print(sensor.temp[y]);
Serial.print(’ ');
}
Serial.println("");
}
delay(1000);
}
Output is like
1100.90 -76.40 1284.90 1024.10
230.40 0.00 -2377.30 25.60
34.60 33.10 33.90 7.40
119.40 122.00 15.30 1404.00
but its always the same.
I also found some other codes but they dont work or im getting just 0 values.
I tried also code from this:
But i dont have that evaluation board and i want to use it with Arduino Uno.
Thanks for all your help and ideas.
Have a nice day!
Hello,
I tried that code and get this error:
Omron_D6FPH.h: No such file or directory
Diagram:
From sensor comes VCC, GND, SDA, SCL . I connected all these pins to UNO board like Vcc- 5V, GND - GND, SCL - SCL and SDA-SDA.
I can send photo if needed.
Thanks!
My component layout is same as in the schematic, first step for me is to get temp values from sensor. After that i will continue with next steps.
Thanks for your help
Hi,
I’m getting repeating numbers to, and I don’t have a module.
It seems to point to the fact that the DT6 is not responding.
Try this I2C scanner and see what the monitor displays.
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}