<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[TMT6000]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stress-nero" aria-label="Profile: stress-nero">@<bdi>stress-nero</bdi></a> said in <a href="/post/71156">TEMT6000</a>:</p>
<blockquote>
<p dir="auto">Hello first time user here,  I have been trying to build a 4in1 light, motion, tem/hum using a nano, temt6000, dht22, and sr501 using the examples and already made sketches i can combine everything, but i am not sure if i am entering the info for the  temt6000 correctly.  Can someone take a look please```<br />
Insert Code Here</p>
<pre><code class="lang-#define">
// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

#include &lt;SPI.h&gt;
#include &lt;MySensors.h&gt;  
#include &lt;DHT.h&gt;

#define CHILD_ID_HUM 0
#define CHILD_ID_TEMP 1
#define CHILD_ID_MOTION 2
#define CHILD_ID_LIGHT 3

#define LIGHT_SENSOR_ANALOG_PIN 0
int lastLightLevel;

#define HUMIDITY_SENSOR_DIGITAL_PIN 4

#define DIGITAL_INPUT_SENSOR 2   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)


DHT dht;
float lastTemp;
float lastHum;
boolean metric = false; 

unsigned long interval= 3000;//dht.getMinimumSamplingPeriod(); // the time we need to wait
unsigned long previousMillis=0; // millis() returns an unsigned long.
unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)

MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
MyMessage msgMot(CHILD_ID_MOTION, V_TRIPPED);
MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
uint16_t lastlux;

void setup()  
{ 
  dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 

 // metric = getConfig().isMetric;

 pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
 }

void presentation()  
{ 
  // Send the Sketch Version Information to the Gateway
  sendSketchInfo("4-1 Sensor", "1.0");

  // Register all sensors to gw (they will be created as child devices)
  present(CHILD_ID_HUM, S_HUM);
  present(CHILD_ID_TEMP, S_TEMP);
  present(CHILD_ID_MOTION, V_TRIPPED);
  present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
}

void loop()      
{  
  // Read digital motion value
  boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
   
// only run loop if time has passed. 
unsigned long currentMillis = millis(); // grab current time       

 // check if "interval" time has passed
 if ((unsigned long)(currentMillis - previousMillis) &gt;= interval) {

 
       send(msgMot.set(tripped?"1":"0")); 
              
  
      #ifdef MY_DEBUG
       Serial.print("Motion: ");
       Serial.println(tripped);
      #endif



 
  
  // Fetch temperatures from DHT sensor
  float temperature = dht.getTemperature();
  if (isnan(temperature)) {
      Serial.println("Failed reading temperature from DHT");
  } else if (temperature != lastTemp) {
    lastTemp = temperature;
    if (!metric) {
      temperature = dht.toFahrenheit(temperature);
    }
    send(msgTemp.set(temperature, 1));
    #ifdef MY_DEBUG
    Serial.print("T: ");
    Serial.println(temperature);
    #endif
  }
 
  // Fetch humidity from DHT sensor
  float humidity = dht.getHumidity();
  if (isnan(humidity)) {
      Serial.println("Failed reading humidity from DHT");
  } else if (humidity != lastHum) {
      lastHum = humidity;
      send(msgHum.set(humidity, 1));
      #ifdef MY_DEBUG
      Serial.print("H: ");
      Serial.println(humidity);
      #endif
  }   
 // Read lux from TEMT6000
  float lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN) *  9.;  // 1000/1024
  if (int(lightLevel - lastLightLevel) &gt; 10 || int(lastLightLevel - lightLevel) &gt; 10) {
      send(msg.setSensor(CHILD_ID_LIGHT).set(lightLevel,1));
      lastLightLevel = lightLevel;
 }

   // save the "current" time
   previousMillis = millis();

 }  

  // Sleep until interrupt comes in on motion sensor. Send update every two minute.
  //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);

}
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1499978827226-upload-a3bebffe-d25d-49db-8ffb-1a043392c708-resized.png" alt="0_1499978821740_upload-a3bebffe-d25d-49db-8ffb-1a043392c708" class=" img-fluid img-markdown" /></p>
</blockquote>
<p dir="auto">sorry for the double post.</p>
]]></description><link>https://forum.mysensors.org/topic/7152/tmt6000</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 17:54:48 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/7152.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Jul 2017 00:27:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TMT6000 on Fri, 14 Jul 2017 13:09:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stress-nero" aria-label="Profile: stress-nero">@<bdi>stress-nero</bdi></a> the light values was fixed bad jump wire position,<br />
![alt text](<img src="/assets/uploads/files/1500037746748-upload-bc52de37-cdbc-47f8-aed4-288746977651-resized.png" alt="0_1500037741362_upload-bc52de37-cdbc-47f8-aed4-288746977651" class=" img-fluid img-markdown" /> image url)</p>
]]></description><link>https://forum.mysensors.org/post/71184</link><guid isPermaLink="true">https://forum.mysensors.org/post/71184</guid><dc:creator><![CDATA[stress nero]]></dc:creator><pubDate>Fri, 14 Jul 2017 13:09:12 GMT</pubDate></item><item><title><![CDATA[Reply to TMT6000 on Fri, 14 Jul 2017 13:06:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mfalkvidd" aria-label="Profile: mfalkvidd">@<bdi>mfalkvidd</bdi></a> it's a ambient light sensor.  I was going to use a esp8266 with these to make a 5in1 node inspired by a video i saw with just header wires , but decided to use arduino nano instead. What i posted seems to work ok but being brand new i figure i would let someone else take a look and see if everything was ok with what i have so far or if i could make it better.<br />
<a href="https://www.sparkfun.com/products/8348" rel="nofollow ugc">https://www.sparkfun.com/products/8348</a></p>
]]></description><link>https://forum.mysensors.org/post/71183</link><guid isPermaLink="true">https://forum.mysensors.org/post/71183</guid><dc:creator><![CDATA[stress nero]]></dc:creator><pubDate>Fri, 14 Jul 2017 13:06:34 GMT</pubDate></item><item><title><![CDATA[Reply to TMT6000 on Fri, 14 Jul 2017 12:54:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stress-nero" aria-label="Profile: stress-nero">@<bdi>stress-nero</bdi></a> sorry I don't even know what a tmt6000 is.</p>
]]></description><link>https://forum.mysensors.org/post/71182</link><guid isPermaLink="true">https://forum.mysensors.org/post/71182</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Fri, 14 Jul 2017 12:54:45 GMT</pubDate></item><item><title><![CDATA[Reply to TMT6000 on Fri, 14 Jul 2017 12:38:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mfalkvidd" aria-label="Profile: mfalkvidd">@<bdi>mfalkvidd</bdi></a>  the one in development when i posted i did not realize that it was under development, and can you help me sorting the tmt6000 sersor out for the sketch.</p>
]]></description><link>https://forum.mysensors.org/post/71179</link><guid isPermaLink="true">https://forum.mysensors.org/post/71179</guid><dc:creator><![CDATA[stress nero]]></dc:creator><pubDate>Fri, 14 Jul 2017 12:38:01 GMT</pubDate></item><item><title><![CDATA[Reply to TMT6000 on Fri, 14 Jul 2017 07:15:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stress-nero" aria-label="Profile: stress-nero">@<bdi>stress-nero</bdi></a> what is the purpose of the double post? Which one should I delete?</p>
]]></description><link>https://forum.mysensors.org/post/71170</link><guid isPermaLink="true">https://forum.mysensors.org/post/71170</guid><dc:creator><![CDATA[mfalkvidd]]></dc:creator><pubDate>Fri, 14 Jul 2017 07:15:08 GMT</pubDate></item></channel></rss>