Home»Blog»Industrial Electronics»Simple Line Follower Robot Circuit using LM324

Simple Line Follower Robot Circuit using LM324

The article explains a simple line follower robot circuit, also known as line tracker vehicle, using just a couple of op amps from the IC LM324 and a few other components, without using complex Arduino or microcontrollers.

What is a Line Follower Robot Vehicle

线路追随者机器人车辆是一种自动引导车辆(AGV)的形式,它通过检测到地面上的白线或嵌入地面而运行。来自检测器的信号命令电动车轮自动根据线路转动并进行调整,给人以车辆遵循线路的印象。因此,名称线跟随者。

Basically the detectors are in the form ofphoto resistors such as LDRsor semiconductors light detectors such as照片二极管或照片晶体管

A couple of suchlight detectors使用从白线中检测出反射的光并开关基于晶体管的电路或基于操作放大器的比较器,然后根据地面上的白线的转弯和曲线控制机器人车辆的车轮电动机。

使用窗口比较器

In the proposed line follower robot vehicle circuit, we have used a couple ofop amp comparatorswas engaging the motors into the balancing act.

The op amps are rigged as windowcompartaors。顾名思义,窗口比较器将检测器的输入信号与构成“窗口”阈值的两个极端电压引用进行比较。只要输入信号级别在此“窗口”参考阈值中,OP放大器的输出在其输出范围内保持较高的逻辑。

However, in an event the input signal tends to cross the reference thresholds, the relevant op amp output turns low, resulting in opposing outputs from the op amps. This unbalance prompts the output devices to correct the situation by switching of the loads appropriately.

How the Circuit Works

Referring to the circuit diagram of the line follower robot vehicle below, we can see two op amps from the IC LM324 configured as window compartaors.

The op amps can be from the IC LM358 or LM324

The upper op amp is wired to control the upper threshold limit, while the lower op amp is connected to control the lower threshold limit.

OP AMP A1的反转输入和OP AMP A2的无反转输入用固定的参考电压夹紧

OP AMP A1的无反转输入以及OP AMP A2的反转输入被绑定在一起,并用于感测来自光检测器的输入信号的变化。

The two Light Dependent Resistors, LDR1 and LDR2 which act like light sensitive devices are positioned as light detectors, such that they receive the reflected light from the white line uniformly on them.

只要LDR上的光足够高且均匀,A1的PIN3仍高于其PIN2,因为LDR1与正线相连。这会导致其输出升高。

同样,pin6 A2举行低于其平快due to the LDR2 connection with the ground line, and this enables the output of A2 to stay high.

换句话说,当异地恋并不是均匀地点燃,the non-inverting (+) inputs of the both the op amps are held higher than their inverting (-) inputs causing their outputs to go high.

在两个输出高的情况下,晶体管驱动程序保持相应的电动机均匀运行,这相应地允许车辆在直线上平稳运行。

机器人车辆如何遵循线路

When a curving white line is encountered, one of the LDRs deviates from the line causing a difference in light at point A of the circuit. This subsequently causes the relevant op amp output to go low and a momentary stoppage of the relevant motor.

In this situation, the other side motor which is still operational forces the robot vehicle to turn towards the bending angle of the line, which brings the shaded LDR back in the illuminated region of the white line. When this happens both the motors again become operational enabling the robot vehicle to run normally.

The above automatic ON/OFF switching across the left/right motors in response to light variations from the bending white lines forces the robot vehicle to keep adjusting and maneuvering in accordance with the white line.

How to Build the Robot Vehicle

In one of my earlier posts we learned how asimple remote controlled vehicle只需使用几个连接到矩形板的后边缘的电动机以及板前边缘的虚拟轮毂制造。

对于拟议的线路机器人电路,我们对车辆采用了类似的结构,如上图所示。

该布置看起来很简单,后轮与电动机连接在一起,这些电动机由OP AMP输出的晶体管驱动程序控制。

When the robot vehicle deviates from the line, the difference in the light level on the LDRs switches OFF one of the op amps, halting the relevant motor.

这迫使相反的侧电动机运行,转向停止电动机的侧面,这意味着如果左侧电动机是刹车,机器人车辆将被迫向左转,并在同一方向上调整弯曲线。

This also suggests that the left/right motor integration with the op amp outputs should be appropriately done such that bending direction of the line and the motor which is being stopped are on the same side of the vehicle.

如何定位LDR

Since the two LDRs (LDR1 and LDR2) are supposed to sense the reflected light from the white line uniformly, their orientation should be perpendicular to the length of the line, as shown below.

在这里,我们已经假设机器人车辆从右至左运行,沿着同一路径上的一条线路。

LDRS总宽度应落在线的宽度之内。

The LDRs and the LED should be installed at the bottom surface of the vehicle, and preferably at the rear side, just under the rear wheel set.

The indicated LED is a white LED with a series 1K resistor. It must be positioned close to the LDRs and at the center, ensuring that the light from the LDR don't reach the LDRs directly, instead the light should reach the LDRs by reflection from the white line under them.

电机规格

电动机可以是任何永久性磁铁拉丝型,但应配备齿轮盒,以确保车辆的移动速度适当缓慢而稳定。

The power rating of the motor should be as per the load which the robot vehicle is supposed to carry. This can be tested through some practical experimentation.

How to Set Up

为了设置此线路的追随者机器人车辆电路,您必须安排一小条白线在平坦的表面上涂上涂漆,或一条粘在平坦表面上的白色胶带。

Position the system (without wheels) over the line, as indicated in the previous diagram, such that theLDRs and the LED正确调整了行宽度内。

Switch ON power, the white LED should illuminate the area under it brightly. Adjust the two presets until the both the motors are switched ON simultaneously.

Now shift the unit slightly on the right so that the LDR1 moves out of the white line.

The left motor should stop. If it doesn't then adjust the P1 until the left motor just stops.

Next, move the unit slightly on the left so that the LDR2 moves out of the white line. This should halt the right side motor. If it doesn't then adjust the 10k preset until the right side motor just stops.

This will complete the set up procedures and now you can install the wheels on the motors and use this guided vehicle to automatically follow a laid down track on the ground.

白线与黑线

The proposed line follower system is based on a white line embedded on the ground, instead of a black line. The advantage of using a white line instead of a black line are as follows:

White line looks more elegant and decent compared to black line.

White line based line follower can work even in total darkness or dim ambient lights.Black light based designs normally require an external illumination to keep the vehicle operational.

A white line based AGV works more accurately regardless of the tile color, except for tiles which are extremely white or equivalent to the color of the white line.

Converting the Vehicle into a Black Line Follower

Despite of the above advantages, if the user prefers the robot vehicle to follow a black line, then the system could be easily transformed to do so through the a few quick modifications in the proposed design.

The user just to interchange or swap the input pin connections of the op amps with the presets, and remove the LED associated with the LDRs.

Another Simple Line Follower Circuit

The op amp U1a flip flops its output from positive to negative and vice versa, in response to changing light levels across the two LDRs.

该响应被U1B OP放大器放大,并馈送到驱动器OP AMPS U1C,U1D。

当从LDR1(R1)上反射的线反射到U1C时,U1D的非反转输入会产生正信号,这会导致其输出变为正。

This positive from their outputs causes Q1 to switch ON since it is an NPN, and this turns ON the connected relay, which in turn causes the relevant motor on relay K1 to turn off, so that the vehicle can twist itself momentarily and correct its orientation until a uniform light is received on the LDRs.

On the other hand, if the opposite happens that is if LDR2 (R2) gets more light from the ground due to a disorientation of the vehicle, or maybe due to the line itself making a curve, this results in a negative voltage to be delivered on the non-inverting inputs of the U1c, and U1d, whose outputs now turn negative.

The negative logic is now responded by the PNP transistor but NPN transistor stays unbiased and does not conduct.

The PNP relay conducts and stops the relevant connected motor in order to ensure that the vehicle twists itself and corrects the orientation until both the LDRs have equal light on them.

Another White Line Follower Circuit (Steering Control)

施加用于检查白线的传感器是使用几个针对线条两侧的轻度依赖电阻(LOR)构建的,以确保每个LDR都看着地面的半白半深度。白线通过灯泡点亮,以确保LDR具有相对较低的电阻。

如果汽车或车辆从中心线上移开,则一号LDR将目睹更高的“白色”百分比,导致其抵抗力按比例下降。由于两个LDR在整个电源电压上都连接到串联连接,因此这意味着LDR交界处的电压会随着车辆的行驶而变化,同时遵循扭曲的白线。

This varying voltage is compared with the setting of the preset RVI through transistors Q1 and Q2. The error signal thus generated adjusts the servo motor rotational direction accordingly which attempts to compensate the error, ensuring the robot vehicle adjusts itself and follows the white track correctly.

电阻R10提供了负反馈,以最大程度地减少“开环增益”,Whike通过电容器C1提供动态反馈,该电容器C1可将其定位为减少过冲。

Remember that the servo motor shown in the above figure is supposed to be configured with a steering mechanism of the vehicle, so that the steering is appropriately adjusted by the motor for keeping the vehicle correctly focused on the white line.

PCB Designs

Leave a Comment

Baidu