Use of a ULN2429 Fluid Detector

Copyright, Towanda Malone and Peter H. Anderson
Dept of Electrical Engineering, Morgan State University
Baltimore, MD 21239, Oct 20, 96

Introduction.

This section deals with interfacing with an Allegro ULN2429A Fluid Detector. This device is available from Circuit Specialists ($2.20) or from Newark Electronics. A separate section discusses how to obtain Allegro integrated circuits.

Operation.

Note that the 2429 consists of a free running 2400 Hz oscillator, a detector-amplifier and a final Darlington output transistor.

A typical circuit is illustrated in Figure #1a.

When probe terminal B is open, no voltage is detected by the internal detector. Thus, the base of the output Darlington stage is near 0 and the output Darlington transistor is off (open).

However, when there is continuity between the oscillator at A and the detector-amplifier at B, a 3.0 volt square wave appears at terminal 12, which in the absence of the 10 uFd filter capacitor would cause the output transistor to turn on and off at nominally 2400 pulses per second. With the 10 uFd capacitor, the square wave is filtered and the base of the output Darlington rises to nominally 3.0 V and turns on the output transistor causing the voltage at output terminals 1 and 14 to drop below 1.5 V. Unfortunately, this is not low enough to assure a logic zero when interfacing with a TTL input on the parallel port. Interfacing with TTL inputs is discussed below.

Thus, in the arrangement in Figure #1a, the presence of a conductive fluid between probe points A and B causes the output transistor to turn on.

Another arrangement is shown in Figure #1b. When there is no conductive fluid between probe terminals A and B, the oscillator is directly connected to the detector and the output transistor is on. When conductive fluid is present, the detector's output is shunted to ground and the output transistor is off.

Aside from the logic inversion, there is a possible advantage in the arrangement in Figure #1b in that by having one of the probe terminals at ground, one can simply ground the vessel holding the fluid and then run only the B lead to detect the level as shown in Figure #2.

Notes.

The ULN2429A is used in automotive applications to detect coolant level. The automotive environment is rough on any electrical circuit and Allegro provided such features as reverse polarity protection and an on board regulator which permits operation over the range of 10 to 16 VDC.

The reason for using AC as opposed to DC on the probes is to prevent metal plating.

The output transistor is capable of continuously handling 700 mA. Thus, the IC is capable of driving a healthy lamp or relay. In order to enhance heat flow away from the package, copper alloy leads are used and Allegro also suggests connecting both grounds (terminals 3 and 4) and also using both terminals 1 and 14 in interfacing with the peripheral. Sort of a primitive heat sink!

There is no internal flyback diode to protect the output transistor from L-di/dt transients caused by switching current in an inductive load. An external diode should be used as shown in Figure #3.

Interfacing with TTL.

Note that the output of the 2429 is an open collector Darlington transistor. Thus, when the output transistor is on, the V_ce drop may be as high as 1.5 VDC. Thus, it may not be directly interfaced with TTL.

Figure #4 illustrates a number of techniques which might be used.

If a relay is required for another purpose, either a normally open or normally closed contact might be used as shown in Figure #4a.

Other approaches which might be used with or without a relay or lamp are the use of a single NPN transistor (Fig #4b), a 4N35 optocoupler (Fig #4c) or a 4049 CMOS buffer (Fig #4d).

Program.

A simple program which continually monitors the BSY lead and reports as to whether fluid is above or below a level is shown below. Of course, whether fluid being present results in a logic one or zero on the BSY input depends on your configuration of the 2429 and the nature of the interface between the Darlington output on the 2429 and the TTL input on the parallel port.

/* Program FLUID.C
**
** Continually reads BSY input and reports on level of conductive fluid.
**
** P. H. Anderson, MSU, 20 Oct 96
*/

#include <stdio.h>
#include <dos.h>

#define DATA 0x0378
#define STATUS DATA+1
#define CONTROL DATA+2

int check_fluid(void);

void main(void)
{
   while(1)  /* always */
   {
      if (check_fluid() == 1) /* depends on you application*/
      {
         printf("Fluid above level.\n");
         /* take suitable action */
      }
      else
      {
         printf("Fluid below level.\n");
         /* take suitable action */
      }
      sleep(10);  /* or do other tasks */
   }
}

int check_fluid(void)
/* returns the state of BUSY input */
{
   int in;
   in = ((inportb(STATUS)^0x80)>>7) &0x01;
   return(in);
}