MICROCONTROLLER ROBOT & EXPERIMENT BOARD
วงจรหุ ่ น ยนต์ เ ดิ น ตามเส้ น ชุ ด นี ้ เ ป็ น วงจรพื ้ น ฐานอี ก วงจรหนึ ่ ง ที ่ ใ ช้ ก ารตรวจจั บ พื ้ น ที ่ ส ี ข าว หรื อ
สี ด ำ เพื ่ อ ควบคุ ม การทำงานให้ ห ุ ่ น ยนต์ เ คลื ่ อ นที ่ ไ ปตามเส้ น ที ่ เ ราต้ อ งการ ข้ อ ดี ข องวงจรนี ้ ค ื อ ใช้ ไอซี
แบบออปแอมป์ เ ป็ น ตั ว ควบคุ ม มอเตอร์ ดั ง นั ้ น การทำงานจะดี ก ว่ า แบบใช้ ท รานซิ ส เตอร์ และยั ง ได้ ศ ึ ก ษา
การทำงานของไอซี แ บบออปแอมป์ อ ี ก ด้ ว ย
ข้ อ มู ล ด้ า นเทคนิ ค
-ไฟเลี ้ ย งวงจร : 4.5V AA 3 ก้ อ น อั ล คาไลน์ (äÁè Á Õ ã ¹ªØ ´ )
-กิ น กระแสสู ง สุ ด ประมาณ 100 mA
-สามารถปรั บ ความไวในการตรวจจั บ ได้
-ขนาดแผ่ น วงจรพิ ม พ์ ชุ ด เซ็ น เซอร์ : 2.36 x 0.60 นิ ้ ว
-ขนาดแผ่ น วงจรพิ ม พ์ ชุ ด ควบคุ ม : 2.18 x 2.10 นิ ้ ว
-ขนาดหุ ่ น ยนต์ ท ั ้ ง หมด : 5.20 x 4.80 x 2.80 นิ ้ ว
การทำงานของวงจร วงจรนี ้ แ ยกการทำงานออกเป็ น 2 ส่ ว น ด้ ว ยกั น คื อ ส่ ว นของวงจรตรวจจั บ แสง
และวงจรควบคุ ม มอเตอร์
การทำงานของวงจรตรวจจั บ แสง ตั ว เซ็ น เซอร์ จ ะทำหน้ า ที ่ ร ั บ แสงจากการสะท้ อ นของแสงสี ข าว
และสี ด ำ การสะท้ อ นแสงจากพื ้ น สี ข าวจะสะท้ อ นมากกว่ า พื ้ น สี ด ำ เมื ่ อ เซ็ น เซอร์ ท ั ้ ง สองตั ว ตรวจจั บ พื ้ น
สี ข าวมอเตอร์ จ ะทำงานจะทำให้ ม อเตอร์ ท ั ้ ง สองทำงานหุ ่ น ยนต์ ก ็ จ ะเดิ น หน้ า และถ้ า เซ็ น เซอร์ ด ้ า นใด
ตรวจจั บ พื ้ น สี ด ำได้ มอเตอร์ ด ้ า นนั ้ น จะหยุ ด ทำงานส่ ว นมอเตอร์ อ ี ก ด้ า นจะทำงาน จึ ง ทำให้ ห ุ ่ น ยนต์ ม ี ก าร
เลี ้ ย วไปด้ า นที ่ เ ซ็ น เซอร์ ต รวจจั บ ได้
การทำงานของวงจรตรวจจั บ แสง จะแยกออกเป็ น สองด้ า นคื อ ด้ า นซ้ า ยและด้ า นขวา ด้ า นซ้ า ยจะ
ประกอบด้ ว ย LED L , PHOTO L ส่ ว นด้ า นขวา ประกอบด้ ว ย LED R , PHOTO R ซึ ่ ง ลั ก ษณะการ
ทำงานทั ้ ง ด้ า นซ้ า ยและด้ า นขวาจะทำงานเหมื อ นกั น ฉะนั ้ น จะอธิ บ ายการทำงานเพี ย งด้ า นเดี ย ว
เริ ่ ม จาก VR1K ทำหน้ า ที ่ ค วบคุ ม กระแสที ่ ไ หลผ่ า นทรานซิ ส เตอร์ TR1 และ LED ทั ้ ง ด้ า นซ้ า ยและ
ด้ า นขวา ถ้ า เราปรั บ VR1K ให้ ก ระแสไหลผ่ า น TR1 มาก LED ก็ จ ะสว่ า งมาก และถ้ า เราปรั บ ให้ ก ระแส
ไหลผ่ า นน้ อ ย LED จะสว่ า งน้ อ ย ในส่ ว นของการตรวจจั บ แสงจะใช้ โ ฟโต้ ท รานซิ ส เตอร์ ในการตรวจ
จั บ ด้ า นขวา ใช้ PHOTO R และ ด้ า นซ้ า ยใช้ PHOTO L ในการตรวจจั บ แสง การทำงานของ โฟโต้
ทรานซิ ส เตอร์ ถ้ า ตั ว โฟโต้ ท รานซิ ส เตอร์ ไ ด้ ร ั บ แสงมาก กระแสที ่ ไ หลผ่ า นตั ว โฟโต้ ท รานซิ ส เตอร์ ก็ จ ะ
มากด้ ว ย ซึ ่ ง แสงที ่ ส ่ อ งมาที ่ ต ั ว โฟโต้ ท รานซิ ส เตอร์ ไ ด้ ม าจากการสะท้ อ นพื ้ น ที ่ ม ี ส ี ข าวและสี ด ำ ถ้ า รั บ แสง
สะท้ อ นจากพื ้ น สี ข าวจะมี ค วามเข้ ม ของแสงสู ง ตั ว โฟโต้ ท รานซิ ส เตอร์ จ ะนำกระแสได้ ด ี ก ว่ า การสะท้ อ น
แสงจากพื ้ น สี ด ำ ในส่ ว นเอาท์ พ ุ ต ของโฟโต้ ท รานซิ ส เตอร์ จะถู ก ส่ ง ไปเข้ า วงจรควบคุ ม มอเตอร์ ต ่ อ ไป
การทำงานในส่ ว นควบคุ ม มอเตอร์ จะแยกออกเป็ น สองด้ า นคื อ ด้ า นซ้ า ยและด้ า นขวา ด้ า นซ้ า ยจะ
ประกอบด้ ว ย IC1/1 และ TR2 ส่ ว นด้ า นขวา ประกอบด้ ว ย IC1/2 และ TR3 ซึ ่ ง ลั ก ษณะการทำงานทั ้ ง
ด้ า นซ้ า ย และด้ า นขวาจะทำงานเหมื อ นกั น ฉะนั ้ น จะอธิ บ ายการทำงานเพี ย งด้ า นเดี ย วเท่ า นั ้ น
การทำงานในส่ ว นเซ็ น เซอร์ แรงดั น ที ่ ส ่ ง เข้ า มาจากโฟโต้ ท รานซิ ส เตอร์ จะถู ก ส่ ง เข้ า ขา + ของ
ออปแอมป์ เพื ่ อ ทำการเปรี ย บเที ย บแรงดั น กั บ ขา - ของออปแอมป์ เอาท์ พ ุ ต ของการเปรี ย บเที ย บจะส่ ง
เข้ า ขาเบส ของ TR เพื ่ อ ทำการขยายกระแส และขั บ มอเตอร์ ต ่ อ ไป สำหรั บ VR ที ่ เ อาท์ พ ุ ต ของออป
แอมป์ จะเป็ น ตั ว ปรั บ แรงดั น ที ่ จ ่ า ยให้ ท รานซิ ส เตอร์ เพื ่ อ ควบคุ ม ความเร็ ว ของมอเตอร์ ใ ห้ ห มุ น ได้ ต ามที ่
ต้ อ งการ
การประกอบวงจร จะมี แ ผ่ น วงจรอยู ่ 2 ชุ ด คื อ ชุ ด แรกเป็ น ชุ ด เซ็ น เซอร์ จะมี LED และตั ว โฟโต้
ทรานซิ ส เตอร์ ทั ้ ง สองตั ว ลั ก ษณะจะเหมื อ นกั น ให้ ส ั ง เกต ตั ว โฟโต้ ท รานซิ ส เตอร์ จ ะมี ท ่ อ หดสี ด ำ การใส่
โฟโต้ จ ะต้ อ งหั น ตั ว ถั ง ให้ ต รงกั บ รู ป ในแผ่ น ปริ ้ น ต์ ส่ ว นตั ว LED สี ใ ส ให้ ส ั ง เกตขายาว และดู ก ารใส่ ท ี ่ ร ู ป
ที ่ 3 ในส่ ว นของ LED
ชุ ด ที ่ ส องเป็ น ชุ ด ควบคุ ม มอเตอร์ การประกอบให้ เ ริ ่ ม จากอุ ป กรณ์ ท ี ่ ต ั ว ที ่ ม ี ค วามสู ง น้ อ ยที ่ ส ุ ด ก่ อ น
โดยเริ ่ ม จากไดโอด ตั ว ต้ า นทาน และ ไล่ ค วามสู ง ไปเรื ่ อ ยๆ สำหรั บ อุ ป กรณ์ ท ี ่ ม ี ข ั ้ ว เช่ น ไดโอด คาปาซิ
เตอร์ แบบอิ เ ล็ ค โตไลต์ และ LED จะต้ อ งดู ข ั ้ ว ให้ ถ ู ก ต้ อ งก่ อ นใส่ ท ุ ก ครั ้ ง วิ ธ ี ก ารดู ข ั ้ ว และการใส่ อ ุ ป กรณ์ น ั ้ น
ได้ แ สดงไว้ ใ นรู ป ที ่ 3 สำหรั บ VRL และ VRR ใช้ ค ่ า 100K หรื อ 104 ส่ ว น VML และ VMR ใช้ ค ่ า 10K
หรื อ 103
ในการบั ด กรี ใ ห้ ใ ช้ ห ั ว แร้ ง ขนาดไม่ เ กิ น 40 วั ต ต์ และการบั ด กรี จะต้ อ งบั ด กรี ด ้ ว ยความระมั ด ระวั ง
อย่ า ให้ บ ั ด กรี ข ้ า มจุ ด บั ด กรี เมื ่ อ บั ด กรี เ สร็ จ แล้ ว ให้ ต รวจสอบดู จ ุ ด บั ด กรี แ ละการใส่ อ ุ ป กรณ์ ใ ห้ ถ ู ก ต้ อ งอี ก
ครั ้ ง ถ้ า แน่ ใ จว่ า ถู ก ต้ อ งให้ ต ่ อ สายแพร 4 เส้ น เข้ า กั บ ชุ ด เซ็ น เซอร์ โดยดู ต ำแหน่ ง สายของ L R ให้ ถ ู ก ต้ อ ง
สำหรั บ การประกอบตั ว หุ ่ น ยนต์ ให้ ท ำการประกอบตามคู ่ ม ื อ แผ่ น ที ่ ส อง
การทดสอบวงจร เมื ่ อ ประกอบทั ้ ง หมดเสร็ จ แล้ ว ให้ ป รั บ เกื อ กม้ า ทั ้ ง หมดให้ อ ยู ่ ต ำแหน่ ง กึ ่ ง กลาง
ปรั บ สวิ ต ซ์ เ ลื ่ อ นมาทาง OFF และใส่ ถ ่ า น AA 3 ก้ อ น แล้ ว ปรั บ สวิ ต ซ์ เ ลื อ นมาทาง ON เพื ่ อ จ่ า ยไฟให้
วงจร LED G1 และ LED G2 จะติ ด
1 ทดลองปรั บ ที ่ ว อลลุ ่ ม VR1K หมุ น ไปทางซ้ า ยสุ ด LED ทั ้ ง สองตั ว ที ่ แ ผ่ น ปริ ้ น ต์ เ ซ็ น เซอร์ จ ะต้ อ ง
ดั บ และค่ อ ยๆ ปรั บ มาทางขวา LED ที ่ เ ซ็ น เซอร์ ท ั ้ ง สองตั ว จะค่ อ ยๆสว่ า งขึ ้ น ตามการปรั บ หลั ง จากนั ้ น
ให้ ป รั บ วอลลุ ่ ม VR1K มาทางขวาสุ ด LED ที ่ เ ซ็ น เซอร์ ท ั ้ ง สองตั ว จะสว่ า งสุ ด
2 วางหุ ่ น ยนต์ ใ ห้ เ ซ็ น เซอร์ ท ั ง สองตั ว กั บ พื ้ น สี ข าว มอเตอร์ ท ั ้ ง สองตั ว จะหมุ น ตามเข็ ม นาฬิ ก า ถ้ า มี
ตั ว ใดหมุ น กลั บ ข้ า งแสดงว่ า ต่ อ สายกลั บ ด้ า นให้ ท ำการแก้ ไ ขให้ ถ ู ก ด้ า น เมื ่ อ ทำงานถู ก ต้ อ งแล้ ว ปรั บ วอล
ลุ ่ ม VR1K ไปให้ อ ยู ่ ต รงกลาง
3 ปรั บ เกื อ กม้ า VRL และ VRR มาทางซ้ า ยมื อ สุ ด วางหุ ่ น ยนต์ ใ ห้ เ ซ็ น เซอร์ ท ั ้ ง สองตั ว กั บ พื ้ น สี
ขาว มอเตอร์ ท ั ้ ง สองตั ว จะไม่ ต ้ อ งไม่ ห มุ น
4
ค่ อ ยๆปรั บ เกื อ กม้ า VRL มาทางขวามื อ จนกระทั ่ ง มอเตอร์ ท างด้ า นซ้ า ยเริ ่ ม หมุ น แล้ ว หยุ ด ปรั บ วอลลุ ม
5
ค่ อ ยๆปรั บ เกื อ กม้ า VRR มาทางขวามื อ จนกระทั ่ ง มอเตอร์ ท างด้ า นขวาเริ ่ ม หมุ น แล้ ว หยุ ด ปรั บ วอลลุ ม
6 นำไปวางทดสอบกั บ สนามทดสอบ โดยให้ เ ส้ น สี ด ำอยู ่ ต รงกลางระหว่ า งเซ็ น เซอร์ ตั ว หุ ่ น ยนต์
จะวิ ่ ง ไปตามเส้ น สี ด ำในสนามทดสอบ
7 เมื ่ อ ทดสอบว่ า หุ ่ น ยนต์ ท ำงานแล้ ว สามารถปรั บ ความเร็ ว มอเตอร์ ด ้ า นซ้ า ยที ่ ว อลลุ ่ ม VML และ
ด้ า นขวาที ่ ว อลลุ ่ ม VMR ได้ ต ามต้ อ งการ
หมายเหตุ ปกติ ม อเตอร์ จ ะตามเข็ ม นาฬิ ก า หากมี ม อเตอร์ ต ั ว ใดตั ว หนึ ่ ง หมุ น ทวนเข็ ม นาฬิ ก า
แสดงว่ า ต่ อ มอเตอร์ สลั บ ขั ้ ว
HIGH QUALITY ELECTRONIC KIT SET FOR HOBBY & EDUCATION
OP-AMP LINE TRACKING ROBOT
วงจรหุ ่ น ยนต์ เ ดิ น ตามเส้ น ใช้ ไ อซี อ อปแอมป์
CODE MB123
This line tracking robot circuit is another fundamental circuit that detects white or
black-colored areas to control the robot's movement along the desired path. The advantage of this
circuit is its use of an op-amp to control the motors, which makes its operation superior to circuits
using transistors. Moreover, it allows for an in-depth study of the operational behavior of op-amp
ICs.
Technical Information:
-Circuit Power Supply: 4.5V from 3 AA alkaline batteries. (not included).
-Maximum current consumption: approximately 100mA.
-Adjustable sensitivity for detection.
-Sensor circuit board size: 2.36 x 0.60 inches.
-Control circuit board size: 2.18 x 2.10 inches.
-Total size of the robot: 5.20 x 4.80 x 2.80 inches.
Circuit Operation
This circuit's operation is divided into two interconnected parts: the light detection circuit and
the motor control circuit.
The light detection circuit is responsible for receiving light reflections from both white and black
surfaces. White surfaces reflect more light compared to black surfaces. When both sensors detect a
white surface, both motors operate and move the robot forward. If a sensor detects a black surface,
that motor stops, causing the robot to turn in the direction where the white surface is detected.
The light detection circuit is further divided into left and right sides.The left side includes LED L
and PHOTO L, while the right side includes LED R and PHOTO R. Both sides function similarly.
VR1K regulates the current flowing through transistor TR1 and LED on both the left and right sides.
Adjusting VR1K affects the brightness of the LED. The light detection uses phototransistors
PHOTO L on the right side and PHOTO R on the left side. When the phototransistor receives more
light, the current flow increases. This light comes from the reflection of white and black areas. Light
reflected from white surfaces is more intense than from black surfaces. The phototransistor's output
is then sent to the motor control circuit.
The motor control circuit is also divided into left and right sides. The left side contains IC1/1 C
and TR2, while the right side has IC1/2 C and TR3. Both sides operate similarly. The input voltage
from the phototransistor is sent to the op-amp's positive terminal for comparison against the negative
terminal. The output of this comparison is sent to the base of TR to amplify the current and drive the
motors. VR in the op-amp's output is used to adjust the voltage supplied to the transistor, controlling
the motor's speed as desired.
Circuit Assembly
The circuit assembly intercomected two sets of circuit boards: the sensor set and the motor
control set.
For the first set, which is the sensor set, it includes LEDs and phototransistors. Both components
have similar features. Note that the phototransistor has a black-colored small tube. When inserting
the phototransistor, align it correctly with the image on the printed board. As for the LED, it has
clear legs. Pay attention to their length and the insertion process as depicted in Figure 3.
The second set is the motor control set. When assembling, begin with the components that have
the least height. Start from the diode, then the resistor, and follow a gradual increase in height.
Components with terminals such as diodes, electrolytic capacitors, and LEDs must be inserted with
the correct polarity each time. The method of checking polarity and inserting components is depicted
in Figure 3. For VRL and VRR, use a value of 100k or 104 ohms, and for VML and VMR, use a value
of 10k or 103 ohms.
When soldering, utilize an iron not exceeding 40 watts and exercise caution to prevent bridging.
After soldering is completed, double-check the soldering points and component correctness. If sure of
their accuracy, connect the 4-wire cable to the sensor set, ensuring the L R wire positions are correct.
For the assembly of the robot itself, follow the instructions provided on the second sheet manual.
Circuit Testing
Once the assembly is completed, adjust all screws to be in a halfway position. Move the slide
switch towards OFF and insert 3 AA batteries.
Then, slide the switch to ON to power the circuit. LED G1 and LED G2 will turn on.
1.Test by adjusting the VR1K potentiometer. Rotate it to the far left; both LEDs on the sensor
print board should turn off. Slowly adjust it to the right: both LEDs on the sensor board will
gradually brighten. After that, turn the VR1K potentiometer to the far right; both LEDs on the
sensor board will be at their brightest.
2.Place the robot so both sensors are on a white surface. Both motors will rotate clockwise. If any
motor rotates in the opposite direction, it means the motor is reverse polarity make the necessary
corrections. When all is functioning correctly, adjust the VR1K potentiometer to be in the middle.
3.Adjust the VRL and VRR to the far left. Place the robot so both sensors are on a white surface;
both motors will not rotate.
4.Gradually adjust the VRL to the right until the left motor starts turning, then stop adjusting
the potentiometer.
5.Gradually adjust the VRR to the right until the right motor starts turning, then stop adjusting
the potentiometer.
6.Test it on a test field, ensuring the black line is in the middle between the sensors. The robot
will run along the black line on the test field.
7.After confirming the robot's functionality, adjust the speed of the left motor using the VML
potentiometer and the right motor using the VMR potentiometer as needed.
Note: Normally, a motor will turn clockwise. If a motor turns counterclockwise, it
means the motor has reversed polarity.
Figure 1. Robot Circuit
VRL
VML
5MM RED COLOR WATER CLEAR LED
Circuit Assembling
NO.1
Figure 3. Installing the Components
RESISTOR
Ω
R .....
TRIMMER
POTENTIOMETER
A
K
A
ELECTROLYTIC
CAPACITOR
+
C .....
µ
F
+
C
+
!
Watch the polarity
C
PHOTO
http://www.futurekit.com
VRR
VMR
MOTOR L
MOTOR R
E
E
K
K
A
C
A
C
MB122-2
PHOTO L
LED L
LED R
PHOTO R
G L + E R
+
1
LG1
A
K
A
+
LG2
Figure 2.
J
VRL
VRR
2
3
+
ON SW OFF
VMR
VML
MB123-1
+BAT-
-ML+
+MR-
DIODE
JUMPER
1N....
J
TRANSISTOR
LED
C
K
B
NPN
E
LED
IC
PHOTO
PHOTO
PHOTO
Need help?
Do you have a question about the MB123 and is the answer not in the manual?
Questions and answers