Component: Thermistor (Sensors)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.1 (Release)
Category Sensors


Image Thermistor component

A generic thermistor component that can be used to simulate and create code for any thermistor with a known temperature/resistance curve. Thermistor is connected in a simple potential divider circuit - thermistor between ADC input and 0V, and a fixed resistor between ADC and the positive supply. Default calibration is for the EBM003 module.

Examples

No additional examples


Downloadable macro reference

GetIntegerTemperature

Reads the ADC input and returns the calculated Temperature as Integer degrees C

Parameters

This macro has no parameters


Return value

INT


GetRealTemperature

Reads the ADC input and Returns the calculated Temperature as Float value in degrees C

Parameters

This macro has no parameters


Return value

FLOAT


CalculateTemperature

Converts the input ADC value and returns the Temperature in tenths of degree C

Parameters

UINT ADCValue
ADC Reading to be converted


Return value

INT


GetADCValue

Returns the Raw ADC value from the Analogue Channel

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

SetChannel

Set the ADC Channel

Parameters

INT ChannelID


Return value

This call does not return a value


SetMinMax

Set the minimum and maximum temperature values that can be shown and set on the thermometer readout.

Parameters

FLOAT Min
Minimum Value
FLOAT Max
Maximum Value


Return value

This call does not return a value


SetTemperature

Sends the given temperature to the display, and calculates the internal values used by the simulated read macros.

Parameters

FLOAT Temperature
Zero to one value - representing min-max of the sensor.


Return value

This call does not return a value



Property reference

ADC Channel

This property is of type Single analog pin and can be referenced with the variable name 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

This property is of type Fixed list of ints and can be referenced with the variable name Thermistor_base1::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

This property is of type Unsigned integer and can be referenced with the variable name ADC_BITS.

No additional information


Resistor Value

This property is of type Unsigned integer and can be referenced with the variable name RESISTOR.

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

This property is of type Unsigned integer and can be referenced with the variable name M25.

Value in Ohms of the Thermistor at -25 deg C

0C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P0.

Value in Ohms of the Thermistor at 0 deg C

25C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P25.

Value in Ohms of the Thermistor at 25 deg C

50C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P50.

Value in Ohms of the Thermistor at 50 deg C

75C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P75.

Value in Ohms of the Thermistor at 75 deg C

100C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P100.

Value in Ohms of the Thermistor at 100 deg C

125C Thermistor Value

This property is of type Unsigned integer and can be referenced with the variable name P125.

Value in Ohms of the Thermistor at 125 deg C

Label

This property is of type Line of text and can be referenced with the variable name label.

A text label to help you identify the component on the panel.

Min. Temp.

This property is of type Floating point and can be referenced with the variable name min_temp.

Minimum termperature that can be set or displayed on the thermometer slider.

Max. Temp.

This property is of type Floating point and can be referenced with the variable name max_temp.

Maximum termperature that can be set or displayed on the thermometer slider.

Scale divisions

This property is of type Unsigned integer and can be referenced with the variable name scale_divisions.

Number of numbered divisions shown on the thermometer scale.