Difference between revisions of "Component: Thermistor Template (Sensors)"
From Flowcode Help
Jump to navigationJump to search(16 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {| style="width:50%" | |
− | |||
− | {| | ||
|- | |- | ||
− | | width="20%" style="color: gray;" | Author | + | | width="20%" style="color:gray;" | Author |
| Matrix | | Matrix | ||
|- | |- | ||
− | | width="20%" style="color: gray;" | Version | + | | width="20%" style="color:gray;" | Version |
− | | | + | | 2.0 |
|- | |- | ||
− | | width="20%" style="color: gray;" | Category | + | | width="20%" style="color:gray;" | Category |
| Sensors | | Sensors | ||
|} | |} | ||
+ | ==Thermistor Template component== | ||
+ | Base component for creating thermistors. Has no GUI - this would be added by concrete examples using this basem which may or may not expose the propertes. | ||
− | == | + | ==Version information== |
− | |||
− | |||
− | + | Library Version, Component Version, Date, Author, Info | |
+ | 5, 2.0, 19-07-24, BR, Added compatibility for external ADC | ||
+ | 5, 2.0, 19-07-24, BR, Allowed full bit depth usage of the internal ADC | ||
− | + | ==Detailed description== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ''No detailed description exists yet for this component'' | ||
− | + | ==Examples== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | This example simply reads the value from the thermistor sensor component and outputs the value to an LCD as a temperature in degrees C. | ||
+ | {{Fcfile|EBM003 - Test Program.fcfx|EBM003 Example}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==Macro reference== | ||
− | ''' | + | ===CalculateTemperature=== |
+ | {| 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;" | '''CalculateTemperature''' | ||
+ | |- | ||
+ | | colspan="2" | Converts the input ADC value and returns the Temperature in tenths of degree C | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | ADCValue | ||
+ | |- | ||
+ | | colspan="2" | ADC Reading to be converted | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
− | |||
+ | ===GetADCValue=== | ||
+ | {| 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;" | '''GetADCValue''' | ||
+ | |- | ||
+ | | colspan="2" | Returns the Raw ADC value from the Analogue Channel | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | ===GetIntegerTemperature=== | ||
+ | {| 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;" | '''GetIntegerTemperature''' | ||
+ | |- | ||
+ | | colspan="2" | Reads the ADC input and returns the calculated Temperature as Integer degrees C | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
− | |||
− | |||
− | + | ===GetRealTemperature=== | |
+ | {| 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;" | '''GetRealTemperature''' | ||
+ | |- | ||
+ | | colspan="2" | Reads the ADC input and Returns the calculated Temperature as Float value in degrees C | ||
+ | |- | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
− | |||
− | + | ===SetADCValue=== | |
+ | {| 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;" | '''SetADCValue''' | ||
+ | |- | ||
+ | | colspan="2" | Used to set the ADC value when an external ADC is being used. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | AdcValue | ||
+ | |- | ||
+ | | colspan="2" | Value of the external ADC. e.g. 0-255 for an 8-bit ADC | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | + | ===SetChannel=== | |
+ | {| 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;" | '''SetChannel''' | ||
+ | |- | ||
+ | | colspan="2" | Set the ADC Channel | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | ChannelID | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | '' | + | ===SetTemperature=== |
+ | {| 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;" | '''SetTemperature''' | ||
+ | |- | ||
+ | | colspan="2" | Simulation macro that sets the internal ADC value to the appropriate value for a given temperature. This allows all internal systems of the sensor to be simulated. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Temperature | ||
+ | |- | ||
+ | | colspan="2" | The temperature in C - restricted to -25 to +125 range | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | ==Property reference== | ||
− | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |
− | + | |- | |
− | + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | |
− | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | |
− | Value in Ohms of the pullup series resistor. i.e. The resistor is connected between the ADC pin and the | + | |- |
− | + | |- | |
− | positive supply rail. | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | + | | width="90%" | ADC Configuration | |
− | + | |- | |
− | + | | colspan="2" | | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-6-icon.png]] | |
− | Value in Ohms of the Thermistor at -25 deg C | + | | width="90%" | ADC Channel |
− | + | |- | |
− | + | | colspan="2" | Analogue Input Channel - Which pin is the analogue input connected to? | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | VRef option | |
− | Value in Ohms of the Thermistor at 0 deg C | + | |- |
− | + | | 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. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Conversion speed | |
− | + | |- | |
− | Value in Ohms of the Thermistor at 25 deg C | + | | 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. |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | |
− | + | | width="90%" | Acquisition cycles | |
− | + | |- | |
− | + | | colspan="2" | Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. | |
− | Value in Ohms of the Thermistor at 50 deg C | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Wiring | |
− | + | |- | |
− | + | | colspan="2" | Specifies the arrangement of the Thermistor and Fixed Resistor. Pull Down - Thermistor connected between ADC pin and GND, fixed resistor between ADC pin and VCC. Pull Up - Thermistor connected between ADC pin and VCC, fixed resistor between ADC pin and GND. | |
− | + | |- | |
− | Value in Ohms of the Thermistor at 75 deg C | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
− | + | | width="90%" | Resistor Value | |
− | + | |- | |
− | + | | colspan="2" | Value in Ohms of the pullup series resistor. i.e. The resistor is connected between the ADC pin and the positive supply rail. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | |
− | Value in Ohms of the Thermistor at | + | | width="90%" | -25C Thermistor Value |
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at -25 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 0C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 0 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 25C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 25 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 50C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 50 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 75C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 75 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 100C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 100 deg C | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | 125C Thermistor Value | ||
+ | |- | ||
+ | | colspan="2" | Value in Ohms of the Thermistor at 125 deg C | ||
+ | |} | ||
− | + | ==Component Source Code== | |
− | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Thermistor_base.fcfx FC_Comp_Source_Thermistor_base.fcfx] | |
− | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Thermistor_base.fcfx FC_Comp_Source_Thermistor_base.fcfx] |
Latest revision as of 14:41, 19 July 2024
Author | Matrix |
Version | 2.0 |
Category | Sensors |
Contents
Thermistor Template component
Base component for creating thermistors. Has no GUI - this would be added by concrete examples using this basem which may or may not expose the propertes.
Version information
Library Version, Component Version, Date, Author, Info 5, 2.0, 19-07-24, BR, Added compatibility for external ADC 5, 2.0, 19-07-24, BR, Allowed full bit depth usage of the internal ADC
Detailed description
No detailed description exists yet for this component
Examples
This example simply reads the value from the thermistor sensor component and outputs the value to an LCD as a temperature in degrees C.
EBM003 Example
Macro reference
CalculateTemperature
![]() |
CalculateTemperature |
Converts the input ADC value and returns the Temperature in tenths of degree C | |
![]() |
ADCValue |
ADC Reading to be converted | |
![]() |
Return |
GetADCValue
![]() |
GetADCValue |
Returns the Raw ADC value from the Analogue Channel | |
![]() |
Return |
GetIntegerTemperature
![]() |
GetIntegerTemperature |
Reads the ADC input and returns the calculated Temperature as Integer degrees C | |
![]() |
Return |
GetRealTemperature
![]() |
GetRealTemperature |
Reads the ADC input and Returns the calculated Temperature as Float value in degrees C | |
![]() |
Return |
SetADCValue
![]() |
SetADCValue |
Used to set the ADC value when an external ADC is being used. | |
![]() |
AdcValue |
Value of the external ADC. e.g. 0-255 for an 8-bit ADC | |
![]() |
Return |
SetChannel
![]() |
SetChannel |
Set the ADC Channel | |
![]() |
ChannelID |
![]() |
Return |
SetTemperature
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Thermistor_base.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Thermistor_base.fcfx