Jump to content

Component: Thermistor Template (Sensors): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 58: Line 58:
This example simply reads the value from the thermistor sensor component and outputs the value to an LCD as a temperature in degrees C.
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}}
{{Fcfile|EBM003 - Test Program.fcfx|EBM003 Example}}




Line 63: Line 65:
==Macro reference==
==Macro reference==


===GetIntegerTemperature===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 76: Line 79:




===SetChannel===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 94: Line 98:




===GetRealTemperature===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 107: Line 112:




===CalculateTemperature===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 125: Line 131:




===GetADCValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
Line 138: Line 145:




===SetTemperature===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-

Revision as of 11:52, 3 February 2023

Author Matrix
Version 1.0
Category 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.

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

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

GetIntegerTemperature

GetIntegerTemperature
Reads the ADC input and returns the calculated Temperature as Integer degrees C 
- INT Return


SetChannel

SetChannel
Set the ADC Channel 
- INT ChannelID
 
- VOID Return


GetRealTemperature

GetRealTemperature
Reads the ADC input and Returns the calculated Temperature as Float value in degrees C 
- FLOAT Return


CalculateTemperature

CalculateTemperature
Converts the input ADC value and returns the Temperature in tenths of degree C 
- UINT ADCValue
ADC Reading to be converted 
- INT Return


GetADCValue

GetADCValue
Returns the Raw ADC value from the Analogue Channel 
- UINT Return


SetTemperature

SetTemperature
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. 
- FLOAT Temperature
The temperature in C - restricted to -25 to +125 range 
- VOID Return



Property reference

Properties
ADC Channel
The ADC channel to which the thermistor circuit is connected. It is assumed that the thermistor is connected between the ADC pin and 0V, with a fixed resistor connected between the ADC pin and +V. 
Wiring
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. 
ADC Bit Resolution
 
Resistor Value
Value in Ohms of the pullup series resistor. i.e. The resistor is connected between the ADC pin and the positive supply rail. 
-25C Thermistor Value
Value in Ohms of the Thermistor at -25 deg C 
0C Thermistor Value
Value in Ohms of the Thermistor at 0 deg C 
25C Thermistor Value
Value in Ohms of the Thermistor at 25 deg C 
50C Thermistor Value
Value in Ohms of the Thermistor at 50 deg C 
75C Thermistor Value
Value in Ohms of the Thermistor at 75 deg C 
100C Thermistor Value
Value in Ohms of the Thermistor at 100 deg C 
125C Thermistor Value
Value in Ohms of the Thermistor at 125 deg C 
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. 
Acquisition cycles
Number of micro seconds to wait for the ADC input to charge before starting the analogue sample. 
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.