Using the DT8x Series Intelligent Data Loggers from dataTaker
It is often necessary to control external relays when working with a DT8x series data logger to control high current/high voltage devices. There are 2 components to setting up the data logger to control a relay: the electrical interface between the logger and the relay, and the programming to trigger the relay. This tech note will guide the reader through both requirements to complete this setup.
The data loggers provide 1 electromechanical relay that is capable of switching up to 30VDC at 1Amp, but if more than 1 output or higher voltages or currents are required, external relays must be used. To control the external relays, the logger provides 8 digital outputs (4 for the DT82x series). It’s important to understand that these 8 (4) outputs are not identical; digital outputs 1-4 (1-3 for the DT82e) are current sinking inputs which can switch up to 30VDC at 100mA, while digital outputs 5-8 (4 for the DT82E) are TTL logic level outputs which provide 0 or 3.3VDC for the ‘off’ or ‘on’ states respectively.
Digital Outputs 1-4
The sinking digital outputs 1-4 can be connected directly to the coil of a relay that draws a maximum current of 100mA at a maximum voltage of up to 30 VDC. In this case, the positive output of an external power supply is connected to one side of the relay coil, the other side of the coil is connected to the digital input of the data logger, and the negative side of the power supply is connected to the digital ground of the data logger. To activate the relay, the digital output is set to 0 using a command such as 1DSO=0 and to turn the relay off, 1DSO=1. The 1DSO=0 command turns on the FET connected to 1D which allows current to flow through the relay coil and activate it. Also, please note the “freewheeling” diode connected across the coil of the relay. This diode is very important as it protects the digital outputs from the inductive voltage spike generated by the coil windings when the relay is switched off. Some relays provide this diode internally, but if it is not present, an external diode such as a 1N914 should be added, as without it the digital outputs of the data logger may be damaged.
Digital Outputs 5-8
Control of a relay using digital outputs 5-8 is a bit more complicated as they are not suitable to directly drive the relay coil. To utilize these outputs, an external driver must be used between the data logger and the relay. The simplest method is to use an external transistor driver. Note that in this case the programming is opposite the first 4 digital outputs; to turn the relay on, use the command 5DSO=1 and to turn it off, use 5DSO=0. Also, notice that this configuration also requires the external diode to protect
the driver transistor from the inductive voltage spike. If more than one relay needs to be controlled, the ULN2803 Darlington Driver IC provides 8 transistor drivers than can source up to 500mA.
The most common application is to control the switching of the relays via an alarm statement, but other applications may require manual control; for example to turn a relay on or off at a specified time.
In this case, an alarm limit is setup and the built-in output functions are used to turn the digital output for the associated relay on and off. Note that using this method will also automatically turn the relay off when the alarm condition is false. If this automatic resetting of the relay is not desired, a manual command can be used to turn on the relay.
The manual command can also be used if hysteresis is required where separate alarm commands are used to turn the relay on and off at different set points to avoid the potential for rapid oscillations that might occur with the previous method when the measured value is close to the limit value.
The Control function can be used to manually turn a relay on. For example, Schedule_2 can be set to run once an hour and turn the relay attached to digital output 1 on for 10 seconds, and then turn it off by using the ability of the logger to generate a digital pulse of user-specified duration. Manual control of the digital outputs can be used to implement more complex relay switching where simple alarm functions will not do what’s necessary.