<?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[Micropython - SHT30 in BTC Base]]></title><description><![CDATA[<p dir="auto">If someone would try work with SHT30, I recommend:</p>
<p dir="auto"><a href="https://github.com/rsc1975/micropython-sht30" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/rsc1975/micropython-sht30</a></p>
<p dir="auto">but in this base you should propertly sel scl, sda pins and i2c addres SHT30 is 0x44.</p>
<p dir="auto">Code:<br />
from sht30 import SHT30<br />
sht30_sensor = SHT30(scl_pin=22, sda_pin=21, delta_temp=-3, i2c_address=0x44)<br />
temperature, humidity = sht30_sensor.measure()</p>
<p dir="auto">Also what i noticed that is showed temperature is higher than real. To correct it i use delta_temp.</p>
]]></description><link>https://community.m5stack.com/topic/2269/micropython-sht30-in-btc-base</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 08:41:17 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/2269.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Sep 2020 15:46:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Tue, 02 Mar 2021 18:36:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> said in <a href="/post/12712">Micropython - SHT30 in BTC Base</a>:</p>
<blockquote>
<p dir="auto">Micropython on the M5Paper is in early alpha because we pushed M5Stack to get it out before the holiday. I spent yesterday doing some testing and I cannot get any SHT30 devices to work no matter if its the internal SHT30 on the paper or the env2 unit.<br />
What lib are you using as I cant even get raw reg read and writes to work.</p>
</blockquote>
<p dir="auto">For now I have abandoned micro python and switched to (yuck) C and platformio.</p>
]]></description><link>https://community.m5stack.com/post/12760</link><guid isPermaLink="true">https://community.m5stack.com/post/12760</guid><dc:creator><![CDATA[sj3fk3]]></dc:creator><pubDate>Tue, 02 Mar 2021 18:36:53 GMT</pubDate></item><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Sun, 28 Feb 2021 13:38:59 GMT]]></title><description><![CDATA[<p dir="auto">Vielleicht hilft euch das weiter. Läuft auf einem M5Stick-C</p>
<p dir="auto"><a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow ugc">main.py</a></p>
<p dir="auto">import unit<br />
import machine<br />
import array<br />
import sht31</p>
<p dir="auto">from machine import I2C, Pin<br />
i2c = I2C(freq=100000, scl=Pin(32), sda=Pin(33) )<br />
sensor = sht31.SHT31(i2c, addr=0x44)</p>
<p dir="auto">while True:<br />
#Sensor SHT31-----------------------------------------------------------<br />
temp_humi = sensor.get_temp_humi()<br />
wait_ms(600)<br />
Temperatur = round(temp_humi[0],2)<br />
Feuchte = round(temp_humi[1],2)<br />
#Sensor SHT31-----------------------------------------------------------</p>
<p dir="auto"><a href="http://sht31.py" target="_blank" rel="noopener noreferrer nofollow ugc">sht31.py</a></p>
<p dir="auto">from machine import I2C<br />
import time</p>
<p dir="auto">R_HIGH   = const(1)<br />
R_MEDIUM = const(2)<br />
R_LOW    = const(3)</p>
<p dir="auto">class SHT31(object):<br />
"""<br />
Diese Klasse implementiert eine Schnittstelle zur SHT31 Temperatur und Luftfeuchtigkeit.<br />
Sensor von Sensirion.<br />
"""<br />
# Diese statische Karte hilft, den Heap und die Programmlogik sauber zu halten.<br />
_map_cs_r = {<br />
True: {<br />
R_HIGH : b'\x2c\x06',<br />
R_MEDIUM : b'\x2c\x0d',<br />
R_LOW: b'\x2c\x10'<br />
},<br />
False: {<br />
R_HIGH : b'\x24\x00',<br />
R_MEDIUM : b'\x24\x0b',<br />
R_LOW: b'\x24\x16'<br />
}<br />
}</p>
<pre><code>def __init__(self, i2c, addr=0x44):
    """
    Initialisiert ein Sensorobjekt auf dem angegebenen I2C-Bus, auf das von der
    angegebene Adresse.
    """
    if i2c == None or i2c.__class__ != I2C:
        raise ValueError('I2C-Objekt als Argument benÃ¶tigt!')
    self._i2c = i2c
    self._addr = addr

def _send(self, buf):
    """
    Sendet das angegebene Pufferobjekt Ã¼ber I2C an den Sensor.
    """
    self._i2c.writeto(self._addr, buf)

def _recv(self, count):
    """
    Lesen von Bytes vom Sensor Ã¼ber I2C. Die Anzahl der Bytes kann angegeben werden.
    als Argument.
    Liefert ein Bytearray fÃ¼r das Ergebnis.
    """
    return self._i2c.readfrom(self._addr, count)

def _raw_temp_humi(self, r=R_HIGH, cs=True):
    """
    Lesen Sie die Rohtemperatur und Luftfeuchtigkeit vom Sensor ab und Ã¼berspringen Sie CRC. ÃœberprÃ¼fung.
    Liefert ein Tupel fÃ¼r beide Werte in dieser Reihenfolge.
    """
    if r not in (R_HIGH, R_MEDIUM, R_LOW):
        raise ValueError('Falscher Wiederholbarkeitswert angegeben!')
    self._send(self._map_cs_r[cs][r])
    time.sleep_ms(50)
    raw = self._recv(6)
    return (raw[0] &lt;&lt; 8) + raw[1], (raw[3] &lt;&lt; 8) + raw[4]

def get_temp_humi(self, resolution=R_HIGH, clock_stretch=True, celsius=True):
    """
    Lesen Sie die Temperatur in Grad Celsius oder Fahrenheit und relativ dazu ab.
    Feuchtigkeit. AuflÃ¶sung und TaktverlÃ¤ngerung kÃ¶nnen festgelegt werden.
    Liefert ein Tupel fÃ¼r beide Werte in dieser Reihenfolge.
    """
    t, h = self._raw_temp_humi(resolution, clock_stretch)
    if celsius:
        temp = -45 + (175 * (t / 65535.0))
    else:
        temp = -49 + (315 * (t / 65535.0))
    return temp, 100 * (h / 65535.0)
</code></pre>
]]></description><link>https://community.m5stack.com/post/12719</link><guid isPermaLink="true">https://community.m5stack.com/post/12719</guid><dc:creator><![CDATA[Wolli01]]></dc:creator><pubDate>Sun, 28 Feb 2021 13:38:59 GMT</pubDate></item><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Sun, 28 Feb 2021 08:35:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kedulowt" aria-label="Profile: kedulowt">@<bdi>kedulowt</bdi></a> said in <a href="/post/9945">Micropython - SHT30 in BTC Base</a>:</p>
<blockquote>
<p dir="auto">temperature, humidity = sht30_sensor.measure()</p>
</blockquote>
<p dir="auto">I can't get this to work</p>
<pre><code class="language-Traceback">  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "sht30.py", line 40, in __init__
NameError: name 'I2C' isn't defined
&gt;&gt;&gt; 
</code></pre>
]]></description><link>https://community.m5stack.com/post/12713</link><guid isPermaLink="true">https://community.m5stack.com/post/12713</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 28 Feb 2021 08:35:58 GMT</pubDate></item><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Sun, 28 Feb 2021 08:12:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sj3fk3" aria-label="Profile: sj3fk3">@<bdi>sj3fk3</bdi></a> said in <a href="/post/12703">Micropython - SHT30 in BTC Base</a>:</p>
<blockquote>
<p dir="auto">I honestly don't understand M5Stack's way of working. There is this ENV2 with python support: <a href="https://docs.m5stack.com/#/en/unit/envII" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/#/en/unit/envII</a> it has a SHT30, but then you spend $80 on a M5Paper and you don't get python support for the SHT30. How hard is it to put in the the right lib.</p>
<p dir="auto">I know I can do it myself, but M5stack should have done this already :-/</p>
</blockquote>
<p dir="auto">Micropython on the M5Paper is in early alpha because we pushed M5Stack to get it out before the holiday. I spent yesterday doing some testing and I cannot get any SHT30 devices to work no matter if its the internal SHT30 on the paper or the env2 unit.<br />
What lib are you using as I cant even get raw reg read and writes to work.</p>
]]></description><link>https://community.m5stack.com/post/12712</link><guid isPermaLink="true">https://community.m5stack.com/post/12712</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sun, 28 Feb 2021 08:12:52 GMT</pubDate></item><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Sat, 27 Feb 2021 16:24:45 GMT]]></title><description><![CDATA[<p dir="auto">I honestly don't understand M5Stack's way of working. There is this ENV2 with python support: <a href="https://docs.m5stack.com/#/en/unit/envII" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.m5stack.com/#/en/unit/envII</a> it has a SHT30, but then you spend $80 on a M5Paper and you don't get python support for the SHT30. How hard is it to put in the the right lib.</p>
<p dir="auto">I know I can do it myself, but M5stack should have done this already :-/</p>
]]></description><link>https://community.m5stack.com/post/12703</link><guid isPermaLink="true">https://community.m5stack.com/post/12703</guid><dc:creator><![CDATA[sj3fk3]]></dc:creator><pubDate>Sat, 27 Feb 2021 16:24:45 GMT</pubDate></item><item><title><![CDATA[Reply to Micropython - SHT30 in BTC Base on Sun, 24 Jan 2021 15:31:51 GMT]]></title><description><![CDATA[<p dir="auto">It is a bit too early because MicroPython is still not there on M5Paper that I own, but as it uses the same SHT30, I also noticed some delta issue in temperature using Arduino.<br />
Is it a common thing with this component ?</p>
]]></description><link>https://community.m5stack.com/post/11962</link><guid isPermaLink="true">https://community.m5stack.com/post/11962</guid><dc:creator><![CDATA[TitiMoby]]></dc:creator><pubDate>Sun, 24 Jan 2021 15:31:51 GMT</pubDate></item></channel></rss>