Difference between revisions of "Component: Temp / Humidity (SHT21) (Environmental)"

From Flowcode Help
Jump to navigationJump to search
 
(13 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
  
==Temp / Humidity component==
+
==Temp / Humidity (SHT21) component==
 
Humidity and temperature sensor using an SHT21 IC connected via I2C. On screen GUI allows temperature and humidity values to be simulated, and will show all I2C communication in a console window.
 
Humidity and temperature sensor using an SHT21 IC connected via I2C. On screen GUI allows temperature and humidity values to be simulated, and will show all I2C communication in a console window.
 +
 +
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Humidity_SHT21.fcfx FC_Comp_Source_Humidity_SHT21.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Humidity_SHT21.fcfx FC_Comp_Source_Humidity_SHT21.fcfx]
  
 
==Detailed description==
 
==Detailed description==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 24: Line 48:
  
 
==Examples==
 
==Examples==
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 33: Line 75:
  
  
==Downloadable macro reference==
 
  
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
==Macro reference==
 +
 +
===GetHumidityData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureReal'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityData'''
 
|-
 
|-
| colspan="2" | Return temperature reading as a float value in degrees C 
+
| colspan="2" | Returns the raw register pair value 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetHumidityInt===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureData'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityInt'''
 
|-
 
|-
| colspan="2" | Returns the raw register pair value 
+
| colspan="2" | returns the relative Humidity reading as an integer value 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetHumidityReal===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityReal'''
 
|-
 
|-
| colspan="2" | Return temperature reading as an integer value in degrees C 
+
| colspan="2" | returns the Humidity reading as a float value 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetTemperatureData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureData'''
 
|-
 
|-
| colspan="2" | returns the relative Humidity reading as an integer value 
+
| colspan="2" | Returns the raw register pair value 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetTemperatureInt===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityReal'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureInt'''
 
|-
 
|-
| colspan="2" | returns the Humidity reading as a float value 
+
| colspan="2" | Return temperature reading as an integer value in degrees C 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -  
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetTemperatureReal===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidityData'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperatureReal'''
 
|-
 
|-
| colspan="2" | Returns the raw register pair value 
+
| colspan="2" | Return temperature reading as a float value in degrees C 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 124: Line 185:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 145: Line 204:
 
|-
 
|-
 
| colspan="2" | Pin used for SDA (data signal) 
 
| colspan="2" | Pin used for SDA (data signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | SDA Remap Pin
 +
|-
 +
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Line 150: Line 214:
 
|-
 
|-
 
| colspan="2" | Pin used for SCL (clock signal) 
 
| colspan="2" | Pin used for SCL (clock signal) 
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | SCL Remap Pin
 +
|-
 +
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 166: Line 235:
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  a 10ms delay between an I2C stop event and the next I2C start event.  Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  I2C communications.  
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Scope Traces
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
 
| colspan="2" | Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Console Data
 
|-
 
| colspan="2" | Selects if the console data is automatically generated or not 
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | API
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
 
|-
 
|-
 
|-
 
|-

Latest revision as of 10:26, 20 October 2023

Author Matrix TSL
Version 2.0
Category Environmental


Temp / Humidity (SHT21) component

Humidity and temperature sensor using an SHT21 IC connected via I2C. On screen GUI allows temperature and humidity values to be simulated, and will show all I2C communication in a console window.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Humidity_SHT21.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Humidity_SHT21.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples








Macro reference

GetHumidityData

Fc9-comp-macro.png GetHumidityData
Returns the raw register pair value 
Fc9-u16-icon.png - UINT Return


GetHumidityInt

Fc9-comp-macro.png GetHumidityInt
returns the relative Humidity reading as an integer value 
Fc9-s16-icon.png - INT Return


GetHumidityReal

Fc9-comp-macro.png GetHumidityReal
returns the Humidity reading as a float value 
Fc9-f32-icon.png - FLOAT Return


GetTemperatureData

Fc9-comp-macro.png GetTemperatureData
Returns the raw register pair value 
Fc9-u16-icon.png - UINT Return


GetTemperatureInt

Fc9-comp-macro.png GetTemperatureInt
Return temperature reading as an integer value in degrees C 
Fc9-s16-icon.png - INT Return


GetTemperatureReal

Fc9-comp-macro.png GetTemperatureReal
Return temperature reading as a float value in degrees C 
Fc9-f32-icon.png - FLOAT Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the component ready for I2C communications 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulation Comms