Difference between revisions of "Component: Analogue Temp Sensors (Environmental)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Medelec35
 
| Medelec35
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Environmental
 
| Environmental
 
|}
 
|}
  
  
 +
==Analogue Temp Sensors component==
 +
A range of the most popular temperature analogue sensors which are: AD22100, AD22103, LM135, LM235, LM335, LM34, LM35, LM60, MCP9700, MCP9701, TC1047, TMP35, TMP36, TMP37 & TSIC301. Uses a single ADC pin which will allow you to display the temperature in C or F.  If your sensor is not listed, there is a Custom option.  You will be able to enter the  scale factor, offset voltage, Temperature Compensation, min and maximum temperatures If the temperature is outside the min and max values, then 999.9 will be displayed.
  
==[[File:Component Icon 69a2ca78_26f3_47df_a402_b5a7c1ff73f2.png|Image]] Analogue Temp Sensors component==
+
==Component Pack==
A range of the most popular temperature analogue sensors which are:
 
AD22100, AD22103, LM135, LM235, LM335, LM35, LM36, LM37, LM60, MCP9700., MCP9701, TC1047, TMP35, TMP36, TMP37 & TSIC301.
 
Uses a single ADC pin which will allow you to display the temperature in C or F.
 
If your sensor is not listed, there is a Custom option.
 
You will be able to enter the  scale factor, offset voltage, min and maximum temperatures
 
If the temperature is outside the min and max values, then 999.9 will be displayed.
 
  
==Examples==
+
FREE
''<span style="color:red;">No additional examples</span>''
 
  
 +
==Detailed description==
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>VoltageADC</tt></u></span>===
 
Calculates what the approximate voltage should be based on Vref, Scale factor, Offset.
 
  
For TSIC301, based on Max temp and Min temp only.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetTempFloatF</tt></u></span>===
 
Value of the temperature in deg F
 
  
'''Parameters'''
+
''No detailed description exists yet for this component''
  
:''This macro has no parameters''
+
==Examples==
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetTempFloatC</tt></u></span>===
 
Value of the temperature in deg C
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
+
Example Program showing how to show the temperature in Celsius and Fahrenheit and expected ADC pin voltage on an LCD.
 +
{{Fcfile|Analogue_Sensors_Example.fcfx|Analogue Sensors Example}}
  
 +
==Downloadable macro reference==
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''VoltageADC'''
 +
|-
 +
| colspan="2" | Calculates what the approximate voltage should be based on Vref, Scale factor, Offset. For TSIC301, based on Max temp and Min temp only. &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
==Simulation macro reference==
 
  
''This component does not contain any simulation macros''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempIntCX10'''
 +
|-
 +
| colspan="2" | Value of integer temperature in deg C x10  E.g 22.5C will give the result of 225 This allows more contol if using integers to save memory 9999 = temperature outside of sensor range &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
==Property reference==
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
<span style="font-weight: normal;"><u>Select Sensor</u></span>
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempIntFX10'''
 +
|-
 +
| colspan="2" | Value of integer temperature in deg F x10  E.g 62.5F will give the result of 625 This allows more contol if using integers to save memory 9999 = temperature outside of sensor range&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''SensorType''.
 
  
''<span style="color:red;">No additional information</span>''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IntValueADC'''
 +
|-
 +
| colspan="2" | The Integer ADC value of the sensor output volttage &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempStringF'''
 +
|-
 +
| colspan="2" | String value of integer temperature in degF to one decimal place. E.g 70.2 999,9 = temperature outside of sensor range&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Single analog pin'' and can be referenced with the variable name ''adc_base1::channel''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatF'''
 +
|-
 +
| colspan="2" | Value of the temperature in deg F 999,9 = temperature outside of sensor range&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
Analogue Input Channel - Which pin is the analogue input connected to?
 
  
<span style="font-weight: normal;"><u>Vref (mV)</u></span>
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempStringC'''
 +
|-
 +
| colspan="2" | String value of integer temperature in deg C to one decimal place. E.g 22.5 999,9 = temperature outside of sensor range&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''VRef''.
 
  
''<span style="color:red;">No additional information</span>''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatC'''
 +
|-
 +
| colspan="2" | Value of the temperature in deg C 999.9 = temperature outside of sensor range&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
  
<span style="font-weight: normal;"><u>VRef option</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''adc_base1::vrefop''.
+
==Property reference==
  
Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
VDD - Defines the microcontrollers power supply pin as the max reference,
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Conversion speed</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Select Sensor
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''adc_base1::convspd''.
+
|-
 
+
| colspan="2" | Select the required sensor. Custom allows you to enter parameters of an analogue sensor not covered.&nbsp;
Clock setting to select how fast the ADC peripheral will perform an ADC conversion.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
The FRC setting is based on a RC time base and so will vary with temperature and pressure.
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | ADC Properties
 
+
|-
Other settings are generally based on divisions of the master clock.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]]
<span style="font-weight: normal;"><u>Acquisition cycles</u></span>
+
| width="90%" | Channel
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''adc_base1::actime''.
+
| colspan="2" | Analogue Input Channel - Which pin is the analogue input connected to?&nbsp;
 
+
|-
Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Vref (mV)
<span style="font-weight: normal;"><u>Scale factor (mV x100)</u></span>
+
|-
 
+
| colspan="2" | For a more accurate reading, enter the exact referance voltage.  &nbsp;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Resolution''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
for a scale factor of 22mv/C or 22mV/F it's 2200
+
| width="90%" | VRef option
 
+
|-
Scale factor is set for you automatically.
+
| colspan="2" | Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage.&nbsp;
 
+
|-
It can only be adjusted with the Custom option.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Conversion speed
<span style="font-weight: normal;"><u>Offset (mV)</u></span>
+
|-
 
+
| colspan="2" | Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock.&nbsp;
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Offset''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
Offset is set for you automatically.
+
| width="90%" | Acquisition cycles
 
+
|-
It can only be adjusted with the Custom option.
+
| colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Tot Avage Samples</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Total average samples
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''TotAvSamples''.
+
|-
 
+
| colspan="2" | The number of ADC samples taken. The higher the number the more stable the reading. &nbsp;
''<span style="color:red;">No additional information</span>''
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Sensor Characteristics
 
+
|-
<span style="font-weight: normal;"><u>Max Temp</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''Max0''.
+
| width="90%" | Temp compensation x10
 
+
|-
Max Temp the sensor can reach is set for you automatically.
+
| colspan="2" | Set value to compensate for sensor and other vairations. E.g. -10 = Set the temperature 1 degrees lower 5 =  Set the temperature 0.5 degrees higher&nbsp;
 
+
|-
It can only be adjusted with the Custom option.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Scale factor (mV x100)
<span style="font-weight: normal;"><u>Min Temp</u></span>
+
|-
 
+
| colspan="2" | for a scale factor of 22mv/C or 22mV/F it's 2200. Scale factor is set for you automatically. It can only be adjusted when custom is selcted. &nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''Min0''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
Max Temp the sensor can reach is set for you automatically.
+
| width="90%" | Offset (mV)
 
+
|-
It can only be adjusted with the Custom option.
+
| colspan="2" | Offset is set for you automatically. It can only be adjusted when custom is selcted.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Label</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Max Temp
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
|-
 
+
| colspan="2" | Max Temp the sensor can reach is set for you automatically. It can only be adjusted when custom is selcted.&nbsp;
A text label to help you identify the component on the panel.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
<span style="font-weight: normal;"><u>temperature</u></span>
+
| width="90%" | Min Temp
 
+
|-
This property is of type ''Floating point'' and can be referenced with the variable name ''temperature''.
+
| colspan="2" | Max Temp the sensor can reach is set for you automatically. It can only be adjusted when custom is selcted.&nbsp;
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Centigrade
 +
|-
 +
| colspan="2" | 0 for a fahrenheit sensor. 1 for a centigrade sensor. Can only be changed when custom is selected.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 +
| width="90%" | Kelvin
 +
|-
 +
| colspan="2" | 1 for a kelvin sensor. Can only be changed when custom is selected.&nbsp;
 +
|}

Latest revision as of 17:22, 9 November 2022

Author Medelec35
Version 1.0
Category Environmental


Analogue Temp Sensors component

A range of the most popular temperature analogue sensors which are: AD22100, AD22103, LM135, LM235, LM335, LM34, LM35, LM60, MCP9700, MCP9701, TC1047, TMP35, TMP36, TMP37 & TSIC301. Uses a single ADC pin which will allow you to display the temperature in C or F. If your sensor is not listed, there is a Custom option. You will be able to enter the scale factor, offset voltage, Temperature Compensation, min and maximum temperatures If the temperature is outside the min and max values, then 999.9 will be displayed.

Component Pack

FREE

Detailed description

No detailed description exists yet for this component

Examples

Example Program showing how to show the temperature in Celsius and Fahrenheit and expected ADC pin voltage on an LCD. FC6 Icon.png Analogue Sensors Example

Downloadable macro reference

Fc9-comp-macro.png VoltageADC
Calculates what the approximate voltage should be based on Vref, Scale factor, Offset. For TSIC301, based on Max temp and Min temp only.  
Fc9-f32-icon.png - FLOAT Return


Fc9-comp-macro.png GetTempIntCX10
Value of integer temperature in deg C x10 E.g 22.5C will give the result of 225 This allows more contol if using integers to save memory 9999 = temperature outside of sensor range  
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetTempIntFX10
Value of integer temperature in deg F x10 E.g 62.5F will give the result of 625 This allows more contol if using integers to save memory 9999 = temperature outside of sensor range 
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png IntValueADC
The Integer ADC value of the sensor output volttage  
Fc9-s16-icon.png - INT Return


Fc9-comp-macro.png GetTempStringF
String value of integer temperature in degF to one decimal place. E.g 70.2 999,9 = temperature outside of sensor range 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetTempFloatF
Value of the temperature in deg F 999,9 = temperature outside of sensor range 
Fc9-f32-icon.png - FLOAT Return


Fc9-comp-macro.png GetTempStringC
String value of integer temperature in deg C to one decimal place. E.g 22.5 999,9 = temperature outside of sensor range 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png GetTempFloatC
Value of the temperature in deg C 999.9 = temperature outside of sensor range 
Fc9-f32-icon.png - FLOAT Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Select Sensor
Select the required sensor. Custom allows you to enter parameters of an analogue sensor not covered. 
Fc9-conn-icon.png ADC Properties
Fc9-type-6-icon.png Channel
Analogue Input Channel - Which pin is the analogue input connected to? 
Fc9-type-21-icon.png Vref (mV)
For a more accurate reading, enter the exact referance voltage.  
Fc9-type-16-icon.png VRef option
Defines what is used as the ADC maximum reference. ADC Range = GND to VRef Voltage VDD - Defines the microcontrollers power supply pin as the max reference, VREF+ Pin - Dedicated pin on the microcontroller to allow for a variable reference voltage. 
Fc9-type-16-icon.png Conversion speed
Clock setting to select how fast the ADC peripheral will perform an ADC conversion. The FRC setting is based on a RC time base and so will vary with temperature and pressure. Other settings are generally based on divisions of the master clock. 
Fc9-type-14-icon.png Acquisition cycles
Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. 
Fc9-type-21-icon.png Total average samples
The number of ADC samples taken. The higher the number the more stable the reading.  
Fc9-conn-icon.png Sensor Characteristics
Fc9-type-14-icon.png Temp compensation x10
Set value to compensate for sensor and other vairations. E.g. -10 = Set the temperature 1 degrees lower 5 = Set the temperature 0.5 degrees higher 
Fc9-type-21-icon.png Scale factor (mV x100)
for a scale factor of 22mv/C or 22mV/F it's 2200. Scale factor is set for you automatically. It can only be adjusted when custom is selcted.  
Fc9-type-21-icon.png Offset (mV)
Offset is set for you automatically. It can only be adjusted when custom is selcted. 
Fc9-type-14-icon.png Max Temp
Max Temp the sensor can reach is set for you automatically. It can only be adjusted when custom is selcted. 
Fc9-type-14-icon.png Min Temp
Max Temp the sensor can reach is set for you automatically. It can only be adjusted when custom is selcted. 
Fc9-type-14-icon.png Centigrade
0 for a fahrenheit sensor. 1 for a centigrade sensor. Can only be changed when custom is selected. 
Fc9-type-14-icon.png Kelvin
1 for a kelvin sensor. Can only be changed when custom is selected.