YL-70 4-Channel Line Tracker Sensor Module

I needed a multichannel line tracker sensor module for an upcoming project. A quick search found several versions of infrared line tracker sensor modules that met or exceeded my demands, but I picked the cheap YL-70 4-channel line tracker module!

The YL-70 line tracker sensor module kit includes another small sensor module, the YL-73, which contains an infrared light emitting diode and an infrared phototransistor. A total of four similar sensor modules come with the kit.

YL-70

I found that the YL-70 module contains one LM339 quad voltage comparator IC (https://www.st.com/resource/en/datasheet/lm139.pdf) and four 10K trimpots. The trimpots set the threshold for the infrared proximity detection. There are five chip LEDs for status indications, as well.

See its key specifications below.

  • Operating voltage: 3.3V-5V DC
  • Operating Current: >1A
  • Detection distance: 1mm to 60cm Adjustable
  • Output signal: TTL level
  • Output Interface: 6-wire (VCC & GND = Power Supply Input, 1234 = Signal Output)
  • Input Interface (YL-73 x4): 3-Wire (VCC-GND-IN)

YL-73

The YL-73 module is in fact a simple infrared proximity detector.Each YL-73 module has a 5mm “clear-lens” infrared LED and a 5mm “black-epoxy” silicon phototransistor. The LED-shaped silicon phototransistor seems to be the most common PT333-3B (https://www.mouser.com/datasheet/2/143/PT333-3B-1663372.pdf).

This is the datasheet of a 5mm water clear infrared LED https://www.marutsu.co.jp/contents/shop/marutsu/datasheet/503IRC2V-2AD.pdf

Following a line/track is one of the easiest ways for a simple robotic vehicle to navigate successfully and accurately. The YL-70 4-channel line tracker sensor provides easy line tracking because the associated YL-73 line sensor is composed of an infrared light sender and a receiver. Each pair can sense the difference between a differently colored track and a field.

YL-70 + YL-73

The YL-70 module will give a HIGH output when YL-73 module detects a black line, and a LOW output in case of a white line (only if the trimpot configuration is set accordingly). Simply put, the rate of current flow through the phototransistor depends on the reflected light level, so that when YL-73 is over a bright white surface, YL-70 renders a logic-low output, and vice versa.

Note that, one of the five LEDs (D5) in the YL-70 module is the power supply indicator and the rest (D1 to D4) are signal indicators. Each signal LED illuminates as its corresponding channel output goes to a LOW state.

Below is the schematic of the YL-70 module I got from the web (no accuracy guarantee).

Each comparator of the LM339 is wired in non-inverting mode with an adjustable threshold, but without hysteresis (see below).

Next is the YL-73 schematic I drew after a thorough examination. I could not find it with a quick search, so I made my own (ha ha)!

Light Sender & Receiver/Detector

The Infrared LED converts electric current into infrared light and the phototransistor converts the photons impinging onto its base area into an effective base current that controls its collector current. Let’s look at the phototransistor.

Here, the phototransistor is connected in a common-emitter (CE) configuration with a load resistor at its collector. As the power of the light impinging on the phototransistor increases, the collector current increases, causing the collector voltage to drop due to the voltage drop across the load resistor. The collector current reaches an upper limit when the phototransistor enters its saturation region in which the collector-emitter voltage VCE reaches approximately 200mV and the remaining voltage drop from the 5V DC rail appears across the load resistor (any further increase in light power applied to the phototransistor will not increase the collector current any more beyond this point).

The load resistor/bias resistor (RL) will produce an output from a phototransistor, and it can be placed above (pull-up) or below (pull-down) the phototransistor. Here, the 4.7MΩ works to pull-up the voltage as light increases the output voltage drops.

ON Semiconductor’s (onsemi) phototransistor application note (https://www.onsemi.com/pub/Collateral/AN-3005-D.PDF) describe the two modes that phototransistors can be used in – switch mode and active mode. In principle, the mode is set by the value of the load resistor (RL) as follows:

  • Switch Mode: VCC < RL x ICC
  • Active Mode: VCC > RL x ICC

Where VCC is the supply voltage and ICC is the maximum prevised current.

In the switch mode (as in this case) the phototransistor is either “on or off,” and the “HIGH/LOW” output is useful for certain applications like object detection, encoder sensing, etc. The HIGH output voltage in the switching mode should equal the supply voltage (Vcc) while the LOW output voltage in the switching mode should be less than 0.8V.

Typically, a load resistor value greater than 5KΩ is adequate for the switch mode, I’m not sure why such a very high value load resistor (4.7MΩ) is used in this circuit. As it stands, the circuitry is likely to be sensitive to any stray light. With the phototransistor assumed as PT333-3B, the datasheet shows the typical on state collector current as about 3mA with 1 mw/cm2 of light shining on it. Giving a moderate margin, a 5KΩ pull-up resistor will be a good pick. Right?

Practical Experiments…

As the Y-70 is basically an infrared close proximity detector module, it can be used in many applications other than robotics. For example, you can use it to build a 4-channel automatic water faucet controller or a 4-channel touch-free electric switch box. I want to test these concepts, but am short on time.

I quickly rigged up a crude one-channel touch-free toggle switch using an Arduino Uno. This can be used to control external electric loads by waving your hand in front of the infrared sensor with the aid of a solid-state relay (SSR) or similar device.

I was able to run the setup smoothly with a 9V battery. Below is the code I used for that quick test.

[code]

int switchState = 0;

int switchPin = 13;

int sensorPin = 12;

int sensorNew;

int sensorOld = 1;

int dtime = 100;

void setup() {


pinMode(switchPin, OUTPUT);


pinMode(sensorPin, INPUT);

}

void loop() {


sensorNew = digitalRead(sensorPin);


if (sensorOld == 0 && sensorNew == 1) {


if (switchState == 0) {


digitalWrite(switchPin, HIGH);


switchState = 1;


}


else {


digitalWrite(switchPin, LOW);


switchState = 0;


}


}


sensorOld = sensorNew;


delay(dtime);

}

[/code]

Let’s recreate the touch free toggle switch in an elegant way with three more channels added to it. What do you think?

Leave a Comment