Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

Measurement Computing Data Acquisition Knowledgebase

Welcome Guest ( )

Temperature two-point controller

Expand / Collapse

Temperature two-point controller

There are many types of control systems.  A control system manages and regulates the behavior of a device or a system.  Types of control systems are open-loop, closed-loop, logic, two-point, linear, proportional, and PID.  This article discusses the two-point controller.  A two-point controller is also known as a Bang-Bang controller or On-off controller. 

A two-point controller is a closed loop system meaning, based upon a measured parameter of the system, it is compared to an operator specified set point parameter.  If the measured parameter is not equal to the set point, an action is taken in the form of turning something on or off. The idea here is bring the measured parameter more closely inline with the set point.  

To operate a two point temperature controller, you need a data acquisition device capable of measuring temperature and one digital output bit.  Measurement Computing offers many such devices such as the E-TC, TC-32, USB-TC/TEMP, USB-5201/3, the USB-2408 and USB-2416.

Devices such as the E-TC, TC-32, USB-5201, USB-5203, WEB-TC or WEB-TEMP can run autonomously meaning, by using InstaCal they can be configured to set the sensor type, temperature limits and alarms (to control the digital IO).  Once powered up without the computer, these devices measure temperature and make decisions regarding the digital logic state of a particular digital bit. Note: USB-5201/3 have additional start up options.

These devices, including the USB-2408 series or USB-2416 series, can be operated by a User created program created with C++, C# or VB.NET. Additionally higher level programs can also be used such as DASYLab or LabVIEW.

Some devices have an option for analog output as well as digital output, they can be used for more complex control systems such as proportional and PID, but that won't be covered here.

An example of a two point controller is the thermostat or HVAC controller you have in your home.  You set the temperature or threshold. When set for heat, if the temperature drops below the threshold, the home heating system turns on until the temperature equals or exceeds the threshold and at that point the system turns back off.  

Depending upon the age of the thermostat or HVAC controller, there may or may not be a timing element. In older homes, the thermostat is controlled by bimetal strip with a glass bulb in which there is a small amount of mercury or a small copper ball.  The bimetal strip is calibrated to temperature.  When the temperature goes down, the bimetal strip flexes in a direction allowing the mercury/ball to make contact with 2 electrodes, closing a circuit and turning on the boiler or furnace.  More modern thermostats and HVAC controllers use temperature sensors such as thermistors, semiconductors, or thermocouples.  Not only are they safer (than mercury) they are easier to use in analog or digital circuitry. They also use some sort of timer or time base so as to know how often to take readings.  

Home heating systems usually run on 24 VAC.  This is because the control signal can be more than 10 feet from the heating system.  A DC signal can show signs of attenuation when running the signal through more than 10 feet of wire.  AC voltages can travel much further, but it doesn’t have to be as dangerous as using 120 or 240 VAC.  24 VAC is the standard.  FYI, most doorbells run on 24 VAC.  You can run the wire as far as you need, and there is no degradation to the signal.  

Using E-TC, TC-32, USB-5201, USB-5203, WEB-TC or WEB-TEMP and InstaCal as an autonomous two-point controller

For these devices, you can configure them to work autonomously meaning you can set them up in InstaCal with temperature thresholds (alarms) for digital IO on or off, and then position them to run remotely.  All you need is their power supply.   These device's digital outputs operate 5V or 3.3V with various amperage specs.

Here is a table summary:

Device name




5 V TTL Logic

Sink/Source 24 mA


0 V to 5 V (internal pull up by default)

0 v to 15 V using external pull up.

Open drain output

Sink 100 mA max (continuous) / bit


5 V TTL Logic

Sink/Source 2.5 mA/bit


5 V TTL Logic

Sink/Source 2.5 mA/bit


Switch selectable 5 V or 3.3 V

Sink/Source 2.5 mA/bit


Switch selectable 5 V or 3.3 V

Sink/Source 2.5 mA/bit

InstaCal refers to these settings as alarms, and that is one use.  Another use is to use them to operate a closed loop system using any of these devices as a two point controller.  As stated many HVAC systems require a 24 VAC signal to be operated.  Here you see in most cases, the alarm (digital out) signal is a 5 V TTL logic signal, with low current.  In all cases, none of the above can output an AC voltage.  To remedy this, you can add a transistor driver and/or relay or TRIAC to control an HVAC or any other required control signal.

If you wanted to use channel 0 of an E-TC to monitor a room’s temperature and control a heater to keep that room at 25 °C, you can configuration the Alarm dialog box like this:

Here we see Channel 0’s alarm set to enabled.  It is set to turn on when a threshold is exceeded, and the output will use active high logic.
The threshold is set using the second option; to turn on the alarm when the measured temperature goes below 25 °C, and to turn off when the measured value goes above 26 °C.
Once the unit is configured, click OK, and close InstaCal.  

Below is a schematic for how you might wire an E-TC to a type T thermocouple, solid state relay and heater.

Writing an application to operate as a two-point controller.

For the purposes of discussion, I will demonstrate using a thermocouple input on an E-TC utilizing a T type thermocouple. For control I will use a digital output to control a fictional 120 VAC heater.  The application will be created first in DASYLab, then LabVIEW, and finally in VB.NET.

The E-TC and external wiring to the heater:

Two Point Controller in DASYLab.

DASYLab has a built in module for 2 point control as part of all versions except DASYLab Lite. Here is what a basic two point control worksheet would look like:

And the Layout:

This is the basics of implementing a 2 point control.  There are some additional settings and options used here, but I wanted to keep focus on the process itself.  For more, please see the attached worksheet.

2 point controller in LabVIEW:

LabVIEW does not have a specific 2 point control vi, but it can easily be resolved using a Less than/Equal vi as the decision maker.  Here is what a basic 2 point controller would look like in LabVIEW:

And the Front Panel:

This is the basic 2 point control implementation.  From the front panel, you can adjust the set point, and monitor the performance of the system.  

Two point controller using Universal Library

Writing a program in Visual Basic .NET using the Universal Library provides greater flexibility.  In DASYLab and LabVIEW, there are a few more things going on that you don’t see.  Things handled by the DASYLab and LabVIEW environments such as finding the device and the handling of errors.  For device discovery, all the user needs do is pick the device from the list provided.  In syntax programming for a VB app, the programmer and user can be the same person, and so the programmer/user has to generate all the code, or get it from another example app.  The programmer will usually write the code segment once, and use it in as many places as possible making slight changes along the way.  This is exactly what I have done here.  So though I wrote the device discovery and error handling routines, I’m not going to show them here, but that code can be examined and freely used, please see the attachment.  Another thing not being shown is the code behind the LED, thermometer, and strip chart.  I created these objects as a way to make the data read and generated in my sample programs easier understand.  So, again, I am not going to show the code behind them, but if you want to use them, they are free to use for your own use.
Here is the routine in the Timer_tick event used to loop through reading the thermocouple, determine if the 2 point controller should be on or off, and operate the digital bit controlling the relay and heater.

Dim ETC_Temperature As Double

ulstat = Daqboard.TIn(0, MccDaq.TempScale.Fahrenheit, ETC_Temperature, MccDaq.ThermocoupleOptions.WaitForNewData)
If ulstat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then
    Exit Sub
End If

Thermometer1.TempValue = ETC_Temperature
lblTemp.Text = ETC_Temperature.ToString("#0.000")

If (ETC_Temperature < (130 - vsSetPoint.Value)) Then
    ulstat = Daqboard.DBitOut(MccDaq.DigitalPortType.AuxPort, 0, MccDaq.DigitalLogicState.High)
    Led1.Value = True
    ulstat = Daqboard.DBitOut(MccDaq.DigitalPortType.AuxPort, 0, MccDaq.DigitalLogicState.Low)
    Led1.Value = False
End If

If ulstat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then
    Exit Sub
End If

And the form view:

This is the basic 2 point control implementation in Visual Basic.NET.  From the Form view, you can adjust the set point, and monitor the performance of the system.


As you can see, using Measurement Computing temperature measurement devices and software products provide many ways to resolve the need to implement a two point temperature controller.  Pick the combination of hardware and software meeting your needs.
If you need better temperature control than a two point limit, then perhaps you need a proportional controller or PID controller. But that’s a topic for another knowledgebase article.

DASYLab:  twopointcontroller.DSB
LabVIEW:  Two Point Controller.llb

Rate this Article:

Attachments (47.13 KB, 29 views)

Two Point Controller.llb Two Point Controller.llb (45.75 KB, 25 views)

twopointcontroller.DSB twopointcontroller.DSB (251.06 KB, 28 views)

Add Your Comments

For comments email

Article ID: 50631

Last Modified:2/7/2017 9:55:21 AM

Article has been viewed 193 times.