Difference between revisions of "Component: Analogue Temp Sensors (Environmental)"
From Flowcode Help
Jump to navigationJump to searchLine 13: | Line 13: | ||
==Analogue Temp Sensors component== | ==Analogue Temp Sensors component== | ||
− | A range of the most popular temperature analogue sensors which are: AD22100, AD22103, LM135, LM235, LM335, 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, min and maximum temperatures If the temperature is outside the min and max values, then 999.9 will be displayed. | + | 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== | ==Component Pack== | ||
Line 20: | Line 20: | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 32: | Line 34: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 54: | Line 58: | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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 | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
|} | |} | ||
Line 63: | Line 80: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempIntFX10''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempIntFX10''' | ||
|- | |- | ||
− | | colspan="2" | | + | | 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 |
|- | |- | ||
|- | |- | ||
Line 76: | Line 93: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IntValueADC''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IntValueADC''' | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | The Integer ADC value of the sensor output volttage |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT | | 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 | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 89: | Line 119: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatF''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatF''' | ||
|- | |- | ||
− | | colspan="2" | Value of the temperature in deg F | + | | colspan="2" | Value of the temperature in deg F 999,9 = temperature outside of sensor range |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | | 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'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| 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 | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 102: | Line 145: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatC''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTempFloatC''' | ||
|- | |- | ||
− | | colspan="2" | Value of the temperature in deg C | + | | colspan="2" | Value of the temperature in deg C 999.9 = temperature outside of sensor range |
|- | |- | ||
|- | |- | ||
Line 124: | Line 167: | ||
|- | |- | ||
| colspan="2" | Select the required sensor. Custom allows you to enter parameters of an analogue sensor not covered. | | colspan="2" | Select the required sensor. Custom allows you to enter parameters of an analogue sensor not covered. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | ADC Properties | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-6-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-6-icon.png]] | ||
Line 149: | Line 196: | ||
|- | |- | ||
| colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. | | colspan="2" | 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%" | Total average samples | ||
+ | |- | ||
+ | | colspan="2" | The number of ADC samples taken. The higher the number the more stable the reading. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Sensor Characteristics | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
+ | | width="90%" | Temp compensation x10 | ||
+ | |- | ||
+ | | 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 | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
Line 159: | Line 220: | ||
|- | |- | ||
| colspan="2" | Offset is set for you automatically. It can only be adjusted when custom is selcted. | | colspan="2" | Offset is set for you automatically. It can only be adjusted when custom is selcted. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
Line 184: | Line 240: | ||
|- | |- | ||
| colspan="2" | 1 for a kelvin sensor. Can only be changed when custom is selected. | | colspan="2" | 1 for a kelvin sensor. Can only be changed when custom is selected. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Latest revision as of 17:22, 9 November 2022
Author | Medelec35 |
Version | 1.0 |
Category | Environmental |
Contents
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.
Analogue Sensors Example
Downloadable macro reference
![]() |
VoltageADC |
Calculates what the approximate voltage should be based on Vref, Scale factor, Offset. For TSIC301, based on Max temp and Min temp only. | |
![]() |
Return |
![]() |
IntValueADC |
The Integer ADC value of the sensor output volttage | |
![]() |
Return |
![]() |
GetTempStringF |
String value of integer temperature in degF to one decimal place. E.g 70.2 999,9 = temperature outside of sensor range | |
![]() |
Return |
![]() |
GetTempFloatF |
Value of the temperature in deg F 999,9 = temperature outside of sensor range | |
![]() |
Return |
![]() |
GetTempStringC |
String value of integer temperature in deg C to one decimal place. E.g 22.5 999,9 = temperature outside of sensor range | |
![]() |
Return |
![]() |
GetTempFloatC |
Value of the temperature in deg C 999.9 = temperature outside of sensor range | |
![]() |
Return |