<?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[Read SHT30 and SHT40 from ENVIII-HAT and ENVIV-UNIT at the same time]]></title><description><![CDATA[<p dir="auto">Is it possible to change the I2C address?</p>
<p dir="auto">I'm really interested to use a M5StickC Plus2 with an Unit and Hat sensor without any other hardware to read temperature</p>
<p dir="auto">Both sensors SHT30 and SHT40 uses the same address by default (0x44).</p>
<p dir="auto">I saw in the datasheet of the components that we can change de I2C address dynamically, but I've tried without any success.</p>
<p dir="auto">Also in the sht4x library has two address options</p>
<p dir="auto">#define SHT40_I2C_ADDR_44 0x44<br />
#define SHT40_I2C_ADDR_45 0x45</p>
<p dir="auto">Is there a way to do that?</p>
]]></description><link>https://community.m5stack.com/topic/6266/read-sht30-and-sht40-from-enviii-hat-and-enviv-unit-at-the-same-time</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 23:39:40 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6266.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 27 Mar 2024 14:47:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Read SHT30 and SHT40 from ENVIII-HAT and ENVIV-UNIT at the same time on Thu, 28 Mar 2024 14:21:18 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/ivanks" aria-label="Profile: Ivanks">@<bdi>Ivanks</bdi></a></p>
<p dir="auto">I think that is a perfectly valid solution. Thanks for sharing.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/24592</link><guid isPermaLink="true">https://community.m5stack.com/post/24592</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 28 Mar 2024 14:21:18 GMT</pubDate></item><item><title><![CDATA[Reply to Read SHT30 and SHT40 from ENVIII-HAT and ENVIV-UNIT at the same time on Thu, 28 Mar 2024 12:31:56 GMT]]></title><description><![CDATA[<p dir="auto">Nice, thank you guys for the considerations.</p>
<p dir="auto">For now the solution that I've found is to establish a connection once per sensor and end communication.</p>
<p dir="auto">I'm not sure if is a good practice with I2C communication, but is working for a simple using.<br />
Of course it has a little more delay in the measurements.</p>
<pre><code>  if (!sht3x.begin(&amp;Wire1, SHT3X_I2C_ADDR, 0, 26, 400000U)) {
    Serial.println("Couldn't find SHT3X");
    while (1) delay(1);
  }
  if (sht3x.update()) {
    Serial.print("SHT30 - Temperatura: ");
    Serial.print(sht3x.cTemp);
    Serial.print(" - Umidade: ");
    Serial.println(sht3x.humidity);

    //DISPLAY
    StickCP2.Display.fillRect(110, 30, 100, 30, BLACK);
    StickCP2.Display.setCursor(5, 30);
    StickCP2.Display.setTextColor(BLUE);
    StickCP2.Display.printf("SHT30: %.1f", sht3x.cTemp);
  }

  Wire.end();
  delay(1000);

  if (!sht4x.begin(&amp;Wire, SHT40_I2C_ADDR_44, 32, 33, 400000U)) {
    Serial.println("Couldn't find SHT4X");
    while (1) delay(1);
  }

  sht4x.setPrecision(SHT4X_HIGH_PRECISION);
  sht4x.setHeater(SHT4X_NO_HEATER);

  if (sht4x.update()) {
    Serial.print("SHT40 - Temperatura: ");
    Serial.print(sht4x.cTemp);
    Serial.print(" - Umidade: ");
    Serial.println(sht4x.humidity);

    //DISPLAY
    StickCP2.Display.fillRect(110, 60, 100, 30, BLACK);
    StickCP2.Display.setCursor(5, 60);
    StickCP2.Display.setTextColor(YELLOW);
    StickCP2.Display.printf("SHT40: %.1f", sht4x.cTemp);
  }
  Wire.end();
  delay(1000);
</code></pre>
]]></description><link>https://community.m5stack.com/post/24591</link><guid isPermaLink="true">https://community.m5stack.com/post/24591</guid><dc:creator><![CDATA[Ivanks]]></dc:creator><pubDate>Thu, 28 Mar 2024 12:31:56 GMT</pubDate></item><item><title><![CDATA[Reply to Read SHT30 and SHT40 from ENVIII-HAT and ENVIV-UNIT at the same time on Thu, 28 Mar 2024 07:42:27 GMT]]></title><description><![CDATA[<p dir="auto">would using pahub be helpfull? to "hide" unit address behind hub address?</p>
]]></description><link>https://community.m5stack.com/post/24588</link><guid isPermaLink="true">https://community.m5stack.com/post/24588</guid><dc:creator><![CDATA[robski]]></dc:creator><pubDate>Thu, 28 Mar 2024 07:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to Read SHT30 and SHT40 from ENVIII-HAT and ENVIV-UNIT at the same time on Wed, 27 Mar 2024 16:03:14 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/ivanks" aria-label="Profile: Ivanks">@<bdi>Ivanks</bdi></a></p>
<p dir="auto">you are corrrect, SHT30 has an ADDR pin which allows to change the I2C address:</p>
<p dir="auto"><em>The address of the sensor can be changed dynamically during operation by switching the level on the ADDR pin.</em></p>
<p dir="auto">However in the ENVIII hat the ADDR pin is connected to GND. See schematic <a href="https://docs.m5stack.com/en/hat/hat_envIII" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>. This means In order to change the I2C address you'd need to modify your ENVIII on a hardware level.</p>
<p dir="auto">In contrast, according to its datasheet, SHT40 doesn't have an ADDR pin - the I2C address is predefined and reflected in the part number (A -&gt; 0x44, B -&gt; 0x45)</p>
<p dir="auto"><em>Products Details<br />
SHT40-AD1B base RH&amp;T accur., 0x44 I2C addr.<br />
SHT40-BD1B base RH&amp;T accur., 0x45 I2C addr.</em></p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/24585</link><guid isPermaLink="true">https://community.m5stack.com/post/24585</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 27 Mar 2024 16:03:14 GMT</pubDate></item></channel></rss>