Difference: TheI2CBusAndTheSHT30TemperatureAndHumiditySensor (1 vs. 13)

Revision 132022-06-16 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 24 to 24
  The most interesting documents are

Changed:
<
<
>
>
 

Using a driver from github

This time we are going to be lazy (?) and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py.

Revision 122022-06-16 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 22 to 22
  sht30-1.png
Changed:
<
<
This time we are going to be lazy (?) and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py. The most interesting documents are

>
>
The most interesting documents are

 
Added:
>
>

Using a driver from github

This time we are going to be lazy (?) and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py.

  Clone the sht30 repository:

Revision 112021-03-04 - IsaacArmahMensah

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 44 to 44
 I will give no further explication on how to use the driver other than what is given in the README.md file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs? Try the code snippets given in the README.md file and make sure they do work.

Exercise 3: Can you do better? (Bonus point)

Changed:
<
<
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python? Make a list of all functions the SHT30 provides and mark down, which of them are accessible by Sanchez’ driver. Can you write a driver that implements all functions the SHT30 provides?
>
>
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python? Make a list of all functions the SHT30 provides and mark down, which of them are accessible by Sanchez’ driver. Can you write a driver that implements all functions the SHT30 provides?
  Solving this exercise requires quite some effort but you will learn how to read and analyze a data sheet and how to convert its information into working code. Finally you can integrate your code into MicroPython and make it available to others.

Revision 102020-08-09 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 48 to 48
  Solving this exercise requires quite some effort but you will learn how to read and analyze a data sheet and how to convert its information into working code. Finally you can integrate your code into MicroPython and make it available to others.
Added:
>
>
The exercise sheet in odt format:

https://iotworkshop.africa/pub/IoT_Course_English/TheI2CBusAndTheSHT30TemperatureAndHumiditySensorexercise_5.odt

 -- Uli Raich - 2020-05-14

Comments

Line: 59 to 63
 
META FILEATTACHMENT attachment="sht30.py.txt" attr="" comment="" date="1589470176" name="sht30.py.txt" path="sht30.py.txt" size="6612" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30-1.png" attr="" comment="" date="1589741978" name="sht30-1.png" path="sht30-1.png" size="172283" user="UliRaich" version="1"
META FILEATTACHMENT attachment="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" attr="" comment="" date="1590095287" name="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" path="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" size="342656" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="exercise_5.odt" attr="" comment="" date="1596963299" name="exercise_5.odt" path="exercise_5.odt" size="237436" user="UliRaich" version="1"

Revision 92020-07-14 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 44 to 44
 I will give no further explication on how to use the driver other than what is given in the README.md file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs? Try the code snippets given in the README.md file and make sure they do work.

Exercise 3: Can you do better? (Bonus point)

Changed:
<
<
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python? Solving this exercise requires quite some effort but you will learn how to read and analyze a data sheet and how to convert its information into working code. Finally you can integrate your code into MicroPython and make it available to others.
>
>
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python? Make a list of all functions the SHT30 provides and mark down, which of them are accessible by Sanchez’ driver. Can you write a driver that implements all functions the SHT30 provides?

Solving this exercise requires quite some effort but you will learn how to read and analyze a data sheet and how to convert its information into working code. Finally you can integrate your code into MicroPython and make it available to others.

  -- Uli Raich - 2020-05-14

Revision 82020-06-08 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 31 to 31
  git clone https://github.com/rsc1975/micropython-sht30.git
Changed:
<
<
In order not to interfere with the SHT30 driver already installed in the MicroPython binary please rename sht30.py to mysht30.py. Then upload the driver to the ESP32 /lib directory:
>
>
Upload the driver to the ESP32 /lib directory:
 
Changed:
<
<
ampy put mysht30.py /lib/mysht30.py
>
>
ampy put sht30.py /lib/sht30.py
  Now you can import the class with:
Changed:
<
<
from mysht30 import SHT30
>
>
from sht30 import SHT30
  Once this is done you can try the examples from the repository README.md.

Revision 72020-05-24 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 41 to 41
  Once this is done you can try the examples from the repository README.md.
Changed:
<
<
I will give no further explication on how to use the driver other than what is given in the README.mf file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?
>
>
I will give no further explication on how to use the driver other than what is given in the README.md file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs? Try the code snippets given in the README.md file and make sure they do work.
 

Exercise 3: Can you do better? (Bonus point)

Changed:
<
<
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python?
>
>
Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python? Solving this exercise requires quite some effort but you will learn how to read and analyze a data sheet and how to convert its information into working code. Finally you can integrate your code into MicroPython and make it available to others.
  -- Uli Raich - 2020-05-14

Revision 62020-05-21 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 24 to 24
  This time we are going to be lazy (?) and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py. The most interesting documents are

Added:
>
>
 

Clone the sht30 repository:

Line: 55 to 56
 
META FILEATTACHMENT attachment="SHT30Datasheet.pdf" attr="" comment="" date="1589469480" name="SHT30Datasheet.pdf" path="SHT30Datasheet.pdf" size="941854" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30.py.txt" attr="" comment="" date="1589470176" name="sht30.py.txt" path="sht30.py.txt" size="6612" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30-1.png" attr="" comment="" date="1589741978" name="sht30-1.png" path="sht30-1.png" size="172283" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" attr="" comment="" date="1590095287" name="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" path="Sensirion_Humidity_Sensors_SHT3x_Application_Note_Alert_Mode_DIS.pdf" size="342656" user="UliRaich" version="1"

Revision 52020-05-19 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 40 to 40
  Once this is done you can try the examples from the repository README.md.
Changed:
<
<
I will give no further explication on how to use the driver than what is given in the README.mf file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?
>
>
I will give no further explication on how to use the driver other than what is given in the README.mf file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?

Exercise 3: Can you do better? (Bonus point)

Sensirion provides a driver written in C for the STM32-Discovery board (Sample Code Humidity Sensor SHT3x). Can you port this driver to the ESP32 and translate it into Python?

  -- Uli Raich - 2020-05-14

Revision 42020-05-18 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 26 to 26
 
Changed:
<
<
I will give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?
>
>
Clone the sht30 repository:
 
Changed:
<
<
The driver is already hard-coded in the MicroPython binary and does not need to be uploaded to the ESP32 to be used.
>
>
git clone https://github.com/rsc1975/micropython-sht30.git

In order not to interfere with the SHT30 driver already installed in the MicroPython binary please rename sht30.py to mysht30.py. Then upload the driver to the ESP32 /lib directory:

ampy put mysht30.py /lib/mysht30.py

Now you can import the class with:

from mysht30 import SHT30

Once this is done you can try the examples from the repository README.md.

I will give no further explication on how to use the driver than what is given in the README.mf file. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?

  -- Uli Raich - 2020-05-14

Revision 32020-05-17 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Changed:
<
<
While the DHT11 uses a proprietary protocol the SHT30 make use of a standardized protocol: the I2C protocol, invented by Philips at the beginning of the 1980's. To get you going with I2C please have a look at https://learn.sparkfun.com/tutorials/i2c/all where the protocol is nicely described. You can find all the details about the SHT30 in its data sheet:

https://iotworkshop.africa/pub/IoT_Course_English/TheI2CBusAndTheSHT30TemperatureAndHumiditySensor/SHT30Datasheet.pdf

>
>
While the DHT11 uses a proprietary protocol the SHT30 make use of a standardized protocol: the I2C protocol, invented by Philips at the beginning of the 1980's. To get you going with I2C please have a look at https://learn.sparkfun.com/tutorials/i2c/all where the protocol is nicely described.
 

Exercise 1: I2C Bus Scan

I2C is supported by a driver in the MicroPython binary.

Added:
>
>
The ESP32 has 2 hardware I2C interfaces (bus 0 and bus 1) with GPIO 21 connected to SDA and GPIO 22 connected to SCL of bus1.
 Write a script that scans the I2C bus and prints all available I2C addresses in the following form:

i2cscan.png

Line: 20 to 20
  First of all let's have a look at the SHT30 documentation.
Changed:
<
<
This time we are going to be lazy and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py. The most interesting documents are

>
>
sht30-1.png

This time we are going to be lazy (?) and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py. The most interesting documents are

 
Changed:
<
<
I will give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications?
>
>
I will give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications? Do you find bugs?
  The driver is already hard-coded in the MicroPython binary and does not need to be uploaded to the ESP32 to be used.
Line: 37 to 39
 
META FILEATTACHMENT attachment="i2cscan.png" attr="" comment="" date="1589468508" name="i2cscan.png" path="i2cscan.png" size="41381" user="UliRaich" version="1"
META FILEATTACHMENT attachment="SHT30Datasheet.pdf" attr="" comment="" date="1589469480" name="SHT30Datasheet.pdf" path="SHT30Datasheet.pdf" size="941854" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30.py.txt" attr="" comment="" date="1589470176" name="sht30.py.txt" path="sht30.py.txt" size="6612" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="sht30-1.png" attr="" comment="" date="1589741978" name="sht30-1.png" path="sht30-1.png" size="172283" user="UliRaich" version="1"

Revision 22020-05-17 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

Line: 18 to 18
 

Exercise 2: Read out the SHT30

Changed:
<
<
This time we are going to be lazy and just use a pure Python driver written by 'Roberto Sánchez which I attached to this exercise sheet.
>
>
First of all let's have a look at the SHT30 documentation.
 
Changed:
<
<
https://iotworkshop.africa/pub/IoT_Course_English/TheI2CBusAndTheSHT30TemperatureAndHumiditySensor/sht30.py.txt
>
>
This time we are going to be lazy and just use a pure Python driver written by 'Roberto Sánchez which you can find on github at https://github.com/rsc1975/micropython-sht30/blob/master/sht30.py. The most interesting documents are

 
Changed:
<
<
I will however give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver.
>
>
I will give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver. Does it work out of the box or do we have to make some modifications?
  The driver is already hard-coded in the MicroPython binary and does not need to be uploaded to the ESP32 to be used.

Revision 12020-05-14 - UliRaich

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="Exercises"

Exercise 5: The I2C bus and the SHT30 Temperature and Humidity Sensor

Introduction

While the DHT11 uses a proprietary protocol the SHT30 make use of a standardized protocol: the I2C protocol, invented by Philips at the beginning of the 1980's. To get you going with I2C please have a look at https://learn.sparkfun.com/tutorials/i2c/all where the protocol is nicely described. You can find all the details about the SHT30 in its data sheet:

https://iotworkshop.africa/pub/IoT_Course_English/TheI2CBusAndTheSHT30TemperatureAndHumiditySensor/SHT30Datasheet.pdf

Exercise 1: I2C Bus Scan

I2C is supported by a driver in the MicroPython binary.

Write a script that scans the I2C bus and prints all available I2C addresses in the following form:

i2cscan.png

In the example above only the SHT30 with its address B: 0x45 is connected to the I2C bus.

Exercise 2: Read out the SHT30

This time we are going to be lazy and just use a pure Python driver written by 'Roberto Sánchez which I attached to this exercise sheet.

https://iotworkshop.africa/pub/IoT_Course_English/TheI2CBusAndTheSHT30TemperatureAndHumiditySensor/sht30.py.txt

I will however give no further explication on how to use the driver. Please read the source code and find out yourself which methods are implemented and how to use the driver.

The driver is already hard-coded in the MicroPython binary and does not need to be uploaded to the ESP32 to be used.

-- Uli Raich - 2020-05-14

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="i2cscan.png" attr="" comment="" date="1589468508" name="i2cscan.png" path="i2cscan.png" size="41381" user="UliRaich" version="1"
META FILEATTACHMENT attachment="SHT30Datasheet.pdf" attr="" comment="" date="1589469480" name="SHT30Datasheet.pdf" path="SHT30Datasheet.pdf" size="941854" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30.py.txt" attr="" comment="" date="1589470176" name="sht30.py.txt" path="sht30.py.txt" size="6612" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback