THE BARCODEBASED PRODUCT CLASSIFICATION SYSTEM ABSTRACT With this product classification system project based on barcode, classifying products will become easier and more accurate, leading to a reduction in labor force within the factory. The GM65 scanner is used to recognize barcode types, send data to the ATmega328 microcontroller on the Arduino board to control the sensors and servo motors accurately to set up the products. Finally, the output data is displayed on the LCD screen for easy monitoring of the operation process. TABLE OF CONTENTS ACKNOWLEDGMENT II LIST OF FIGURE XI LIST OF TABLES XIII CHAPTER 1: OVERVIEW OF THE TOPIC 1 1.1 INTRODUCTION OF THE TOPIC: 1 1.2 RESEARCH PURPOSE: 1 1.3 RESEARCH OBJECT: 2 1.4 RESEARCH SCOPE: 2 1.5 EXPECTED RESULTS: 2 CHAPTER 2: THEORETICAL BASIS 3 2.1 OVERVIEW OF THE ARDUINO UNO CONTROLLER BOARD: 3 2.1.1 Introduction to Arduino Uno: 3 2.1.2 Arduino Uno R3 Structure and Hardware: 4 2.1.3 Pinout diagram of Arduino Uno R3: 5 2.1.4 Power supply: 5 2.1.5 IO Pins: 6 2.2 ARDUINO IDE SOFTWARE OVERVIEW: 8 2.3 GENERAL ABOUT BARCODES AND SCANNERS GM65: 8 2.3.1 Barcode concept: 8 2.3.2 Common types of barcodes: 9 2.3.3 How Barcode works: 13 2.3.4 Classification of barcode scanners and barcode recognition methods: 13 2.4 SERVO DC MOTOR OVERVIEW: 16 2.4.1 What is a servo motor? 16 2.4.2 Working principle of servo motor: 16 2.5 OPERATING PRINCIPLE OF INFRARED SENSORS: 18 CHAPTER 3: DESIGN AND CONSTRUCTION 19 3.1 THE BLOCK DIAGRAM OF THE SYSTEM: 19 3.1.1 Power Block: 19 3.1.2 Code Scan Block: 21 3.1.3 Processing block: 23 3.1.4 Sensor Block: 23 3.1.5 Motor Block: 24 3.1.6 Display block: 26 3.2 GENERAL PRINCIPLE DIAGRAM: 29 CHAPTER 4: PROCEED TO IMPLEMENT 30 4.1 SYSTEM OPERATION: 30 4.2 ALGORITHM FLOWCHART OF THE SYSTEM: 30 CHAPTER 5: EXPERIMENT 32 5.1 EXPERIMENTAL PROCESS: 32 5.1.1 Designing printed circuit: 32 5.1.2 Printed circuit construction: 33 5.1.3 Load the program and run the printed circuit: 35 5.2 EXPERIMENTAL RESULTS: 37 5.3 EXPERIMENTAL CONCLUSIONS: 38 CHAPTER 6: CONCLUSION 39 6.1 ADVANTAGES: 39 6.2 DISADVANTAGES: 39 6.3 DIRECTION OF DEVELOPMENT: 39 REFERENCES 41 APPENDIX 43 CHAPTER 1: OVERVIEW OF THE TOPIC 1.1 Introduction of the topic: Nowadays, our country is entering the era of industrialization and modernization, according to the trend of automation and rapid development. Therefore, it requires us to focus on improving and building production systems in order to reduce production costs, enhance labor productivity and produce highvalue products. It can be seen that product classification is a simple but essential requirement in factories, especially product classification based on various criteria to replace human labor. Product classification brings many benefits, such as replacing and reducing labor force, avoiding boredom at work, improving working conditions, creating opportunities to access advances in science and technology and working in a new and increasingly civilized environment. In addition, product classification helps to improve labor productivity, create a premise for reducing product costs, and quickly change product models. It also simplifies management and monitoring, as it not only changes the working conditions of workers but also minimizes the number of required workers. There have been many automated systems applied and implemented, all of which are relatively complex systems. With their knowledge and understanding of reality, they have undertaken the project The barcodebased product classification system. 1.2 Research purpose: The design consists of a product classification system tailored to the requirements of the production line, which uses The GM65 barcode reader module capable of scanning both 1D and 2D barcodes to input data into the central processing unit, the Arduino Uno microcontroller, to control two servo motors to properly sort the scanned product. 1.3 Research object: Understanding popular barcode standards: Understand popular barcode standards such as UPC, EAN, Code 128, Code 39, etc. to understand how products are identified and classified using these codes. Barcode reading technology: Learn about modern barcode reading technologies such as optical scanning, image sensing, RFID, etc. to increase reading speed and accuracy. Learn about capacitor components, voltage regulators, and ICs. Learn about GM65 barcode scanner. Learn about the Arduino Uno microcontroller, Atmega328 chip, and Arduino software. Learn about the sg90 servo motor and its operation. Learn how to connect and operate the LCD 1602 display. 1.4 Research scope: The device uses 12VDC power, used anywhere with small items that can be sorted. 1.5 Expected results: The system has the ability to read and process information stably when facing different situations such as scanning multiple barcodes in a short period or scanning different types of barcodes. It can classify three different types of products. The sensor and servo motor only operate when the correct product is detected. The display shows the barcode and the number of products that have been classified. CHAPTER 2: THEORETICAL BASIS 2.1 Overview of the Arduino Uno controller board: 2.1.1 Introduction to Arduino Uno: Arduino is an opensource platform used for building electronic projects and a microcontroller board used for programming to interact with hardware devices such as sensors, motors, lights, and many other devices. The highlight of Arduino is its extremely easytouse application development environment with a programming language that can be quickly learned, even by beginners in electronics and programming. Arduino is widely used globally and is increasingly proving its power through countless applications, unique systems of opensource community users. Arduino is opensource from hardware to software, with a very low cost. With a small amount of money, users can own an Arduino board with 20 IO ports that can interact and control about that many devices. Arduino has strengths over other microcontroller platforms, including: Runs on multiple platforms (programming can be done on different operating systems, including Windows, Mac OS, Linux on desktop, and Android on mobile). Simple and easytounderstand programming language; open platform, as it is developed based on opensource, allowing software to run on Arduino to be easily integrated on different platforms; hardware expansion is easy, as Arduino is designed and used as a module; it is simple, quick to assemble, program and use the device; easy to share, as people can easily share source code without worrying about the programming language or operating system they are using. Arduino has many eye catching applications, including 3D printers, robots, UAVS, interactive games, lighting controls and high speed photography triggers. Arduino Uno R3 microcontroller board is one of the most popular committees in the Arduino family. It was launched in 2011 and is the latest version of Arduinos board. This kit circuit is based on the ATMEGA328P microcontroller to control and operate the microcontroller. The United Nations Board is the first product in the series of boards used by USB for communication. Arduino has many notable applications, including 3D printers, robots, unmanned aerial vehicles (UAVs), interactive games, light controls, and highspeed photography triggers. The Arduino UNO R3 microcontroller board is one of the most popular in the Arduino family. It was introduced in 2011 and is the latest version 3 of the Arduino board. This kit circuit is based on the ATmega328P microcontroller to control and operate the microcontroller. The Uno board was the first product in the series of boards that used USB for communication. 2.1.2 Arduino Uno R3 Structure and Hardware: About Arduino, Arduino Uno R3 is the most popular version of Arduino. The United Nations version is a revised version 3 (R3), which is currently the latest version. Compared with the old version of Arduino Uno, accuracy and durability are much higher. Arduino Uno R3 is equipped with three types of 8 bit AVR microcontrollers, including Atmega8, Atmega168 and Atmega328. Table 2 1 Specifications of Arduino Uno R3 Operating voltage 5V (USB) Recommended operating voltage 6 to 9V Number of digital IO pins 14 pins ( 6 pins PWM) Number of analog IO pins 6 pins Maximum output current per pin IO 30 mA Maximum output current (5V) 500 mA Maximum output current (3.3V) 50 mA Flash memory 32KB (ATmega328) with 0.5KB used by bootloader SRAM 2 KB EEPROM 1 KB Operating frequency 16 MHz 2.1.3 Pinout diagram of Arduino Uno R3: Figure 2 1 Pinout diagram of Arduino Uno R3 An Arduino Uno R3 board consists of 20 input and output pins, of which 6 function pins are PWM inputs and 6 function pins are PWM inputs. 2.1.4 Power supply: Arduino Uno is powered with 5V through USB connection or external power supply. The external power source (not from USB) can be obtained from ACDC converter module or battery pack. To connect with converter module, we can plug a 2.1mm centerpositive plug into the power jack on the board. When using battery pack, the pack is connected between Vin and GND pins to supply power. Arduino Uno can operate with external power source from 6 to 20V. If using lower voltage, typically 7V, the 5V pin may supply less than 5V, but it may cause unstable operation. When using power source above 12V, the voltage regulator will become hot and may get damaged, therefore it is recommended to use power source from 7 to 12V. The energy pins are as follows: • Vin (Voltage Input): is where external power source is supplied to Arduino UNO (from 7V12V), we can supply power through Vin pin or via a power jack which is connected to this pin and the negative pole of the supply is connected to the GND pin. • GND (Ground): is the negative pole of the power supplied to Arduino UNO. When we use devices with separate power sources, their negative pins must be joined together. • 5V: is the output voltage supplied by Arduino UNO. The maximum current allowed on this pin is 500mA. • 3.3V: is the output voltage of 3.3V. The maximum current allowed on this pin is 50mA. • IOREF (Input Output Reference): is the operating voltage of the microcontroller on the Arduino UNO. It can be measured at this pin and is 5V. However, it is not used to supply power from this pin. • RESET: Pressing the Reset button on the board resets the microcontroller. It corresponds to connecting the RESET pin to GND via a resistor (10KΩ). 2.1.5 IO Pins: The Arduino UNO R3 kit has 14 digital pins that can be used as input or output pins by using functions such as pinMode(), digitalRead(), and digitalWrite(). They have only 2 voltage levels which are 0V and 5V, with a maximum inputoutput current of 40mA on each pin. Each pin has pullup resistors built into the ATmega328 microcontroller (these resistors are not connected by default). Some digital pins have special functions as follows: • 2 Serial pins: 0 (RX) and 1 (TX): used to send (TX) and receive (RX) TTL Serial data. Arduino Uno can communicate with other devices via these pins. Wireless serial connection, such as Bluetooth connection, is often referred to as wireless Serial. If serial communication is not needed, it is not necessary to use these pins. • PWM (Pulse Width Modulation) pins (~): 3, 5, 6, 9, 10, and 11: these pins allow you to output PWM with 8bit resolution (values from 0 to 255 corresponding to the voltage range of the pin from 0V to 5V) using analogWrite() function. In other words, you can adjust the output voltage of this pin from 0V to 5V, instead of just fixing it at 0V and 5V like other pins. • SPI (Serial Peripheral Interface) pins: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK): In addition to their normal functions, these 4 pins are also used to transmit data using the SPI protocol with other devices. • LED 13: there is a orange LED (with L label) on the Arduino UNO board. When you press the Reset button, you will see this LED flash as a signal. It is connected to pin 13. When this pin is used by the user, the LED will be turned on. • Arduino UNO has 6 analog pins (A0 to A5) that provide 10bit signal resolution (0 to 2101) to read voltage values ranging from 0V to 5V. With the AREF pin on the board, you can provide a reference voltage when using analog pins. That is, if you supply 2.5V to this pin, you can use the analog pins to measure voltage values from 0V to 2.5V with a resolution of 10bits. Particularly, Arduino UNO has 2 A4 (SDA) and A5 (SCL) pins that support I2CTWI communication with other devices. 2.2 Arduino IDE Software Overview: Arduino IDE stands for Arduino Integrated Development Environment, which is an opensource software environment primarily used to write code on a compiler similar to CC++ and load them into microcontroller boards. The programming environment is simple and easy to use, the programming language is easy to understand and based on the familiar CC++ platform for technical people. And importantly, the number of prewritten and shared code libraries by the open community is incredibly large. Figure 2 2 Interface of Arduino IDE 2.0.4 2.3 General about barcodes and scanners GM65: 2.3.1 Barcode concept: Barcode (or also known as a barcode) is a method of storing and transmitting information using a symbol called a barcode symbology. A barcode symbology or simply barcode, is a symbol composed of a combination of straight bars and spaces that represent patterns of characters, symbols, and numeric digits. Variations in the widths of the bars and spaces represent data in the form of digits or characters that can be read by a machine. As an automatic identification technology, barcode allows for quick and accurate data collection.
Trang 1With this product classification system project based on barcode, classifyingproducts will become easier and more accurate, leading to a reduction in labor forcewithin the factory The GM65 scanner is used to recognize barcode types, send data
to the ATmega328 microcontroller on the Arduino board to control the sensors andservo motors accurately to set up the products Finally, the output data is displayed
on the LCD screen for easy monitoring of the operation process
Trang 21.4 RESEARCH SCOPE: 2
1.5 EXPECTED RESULTS: 2
CHAPTER 2: THEORETICAL BASIS 3
2.1 OVERVIEW OF THE ARDUINO UNO - CONTROLLER BOARD: 3
2.1.1 Introduction to Arduino Uno: 3
2.1.2 Arduino Uno R3 - Structure and Hardware: 4
2.1.3 Pinout diagram of Arduino Uno R3: 5
2.1.4 Power supply: 5
2.1.5 I/O Pins: 6
2.2 ARDUINO IDE SOFTWARE OVERVIEW: 8
2.3 GENERAL ABOUT BARCODES AND SCANNERS GM65: 8
2.3.1 Barcode concept: 8
2.3.2 Common types of barcodes: 9
2.3.3 How Barcode works: 13
2.3.4 Classification of barcode scanners and barcode recognition methods: 13
2.4 SERVO DC MOTOR OVERVIEW: 16
2.4.1 What is a servo motor? 16
2.4.2 Working principle of servo motor: 16
2.5 OPERATING PRINCIPLE OF INFRARED SENSORS: 18
CHAPTER 3: DESIGN AND CONSTRUCTION 19
3.1 THE BLOCK DIAGRAM OF THE SYSTEM: 19
Trang 33.1.4 Sensor Block: 23
3.1.5 Motor Block: 24
3.1.6 Display block: 26
3.2 GENERAL PRINCIPLE DIAGRAM: 29
CHAPTER 4: PROCEED TO IMPLEMENT 30
4.1 SYSTEM OPERATION: 30
4.2 ALGORITHM FLOWCHART OF THE SYSTEM: 30
CHAPTER 5: EXPERIMENT 32
5.1 EXPERIMENTAL PROCESS: 32
5.1.1 Designing printed circuit: 32
5.1.2 Printed circuit construction: 33
5.1.3 Load the program and run the printed circuit: 35
5.2 EXPERIMENTAL RESULTS: 37
5.3 EXPERIMENTAL CONCLUSIONS: 38
CHAPTER 6: CONCLUSION 39
6.1 ADVANTAGES: 39
6.2 DISADVANTAGES: 39
6.3 DIRECTION OF DEVELOPMENT: 39
REFERENCES 41
APPENDIX 43
Trang 4Figure 2-7 QR code 12
Figure 2-8 Matrix code 12
Figure 2-9 PDF417 barcode 12
Figure 2-10 How barcodes work 13
Figure 2-11 Structure of Laser Barcode Reader 15
Figure 2-12 The principle of reading barcodes 15
Figure 2-13 Working principle of servo motor 17
Figure 2-14 Operating principle of infrared sensors 18
Figure 3-1 The block diagram of the system 19
Figure 3-2 Specifications of IC 7805 20
Figure 3-3 Power Block diagram 20
Figure 3-4 The GM65 barcode reader module 21
Figure 3-5 Processing Block 23
Figure 3-6 Infrared sensor 23
Figure 3-7 Wiring diagram for sensors 24
Figure 3-8 Servo motor 25
Figure 3-9 Wiring diagram of servo motors 25
Figure 3-10 LCD Screeen 26
Figure 3-11 Wiring diagram of LCD with arduino 28
Figure 3-12 General principle diagram 29
Figure 4-1 Algorithm flowchart of the system 31
Trang 5Figure 5-4 Complete printed circuit 34
Figure 5-5 Circuit after attaching component pins 35
Figure 5-6 LCD displays 36
Figure 5-7 Completed system 37
Trang 7CHAPTER 1: OVERVIEW OF THE TOPIC
1.1 Introduction of the topic:
Nowadays, our country is entering the era of industrialization andmodernization, according to the trend of automation and rapid development.Therefore, it requires us to focus on improving and building production systems inorder to reduce production costs, enhance labor productivity and produce high-valueproducts
It can be seen that product classification is a simple but essential requirement infactories, especially product classification based on various criteria to replacehuman labor Product classification brings many benefits, such as replacing andreducing labor force, avoiding boredom at work, improving working conditions,creating opportunities to access advances in science and technology and working in
a new and increasingly civilized environment
In addition, product classification helps to improve labor productivity, create apremise for reducing product costs, and quickly change product models It alsosimplifies management and monitoring, as it not only changes the workingconditions of workers but also minimizes the number of required workers
There have been many automated systems applied and implemented, all ofwhich are relatively complex systems With their knowledge and understanding ofreality, they have undertaken the project "The barcode-based product classificationsystem"
1.2 Research purpose:
The design consists of a product classification system tailored to therequirements of the production line, which uses The GM65 barcode reader modulecapable of scanning both 1D and 2D barcodes to input data into the centralprocessing unit, the Arduino Uno microcontroller, to control two servo motors to
Trang 8Learn about capacitor components, voltage regulators, and ICs
Learn about GM65 barcode scanner
Learn about the Arduino Uno microcontroller, Atmega328 chip, and Arduinosoftware
Learn about the sg90 servo motor and its operation
Learn how to connect and operate the LCD 1602 display
It can classify three different types of products
The sensor and servo motor only operate when the correct product is detected.The display shows the barcode and the number of products that have beenclassified
CHAPTER 2: THEORETICAL BASIS
1.6 Overview of the Arduino Uno - controller board:
1.1.1 Introduction to Arduino Uno:
Trang 9Arduino is an open-source platform used for building electronic projects and amicrocontroller board used for programming to interact with hardware devices such
as sensors, motors, lights, and many other devices
The highlight of Arduino is its extremely easy-to-use application developmentenvironment with a programming language that can be quickly learned, even bybeginners in electronics and programming Arduino is widely used globally and isincreasingly proving its power through countless applications, unique systems ofopen-source community users
Arduino is open-source from hardware to software, with a very low cost With asmall amount of money, users can own an Arduino board with 20 I/O ports that caninteract and control about that many devices Arduino has strengths over othermicrocontroller platforms, including:
- Runs on multiple platforms (programming can be done on different operatingsystems, including Windows, Mac OS, Linux on desktop, and Android onmobile)
- Simple and easy-to-understand programming language; open platform, as it
is developed based on open-source, allowing software to run on Arduino to
be easily integrated on different platforms; hardware expansion is easy, asArduino is designed and used as a module; it is simple, quick to assemble,program and use the device; easy to share, as people can easily share sourcecode without worrying about the programming language or operating systemthey are using Arduino has many eye -catching applications, including 3Dprinters, robots, UAVS, interactive games, lighting controls and high -speedphotography triggers
Arduino Uno R3 microcontroller board is one of the most popular committees inthe Arduino family It was launched in 2011 and is the latest version of Arduino'sboard This kit circuit is based on the ATMEGA328P microcontroller to control and
Trang 10board This kit circuit is based on the ATmega328P microcontroller to control andoperate the microcontroller The Uno board was the first product in the series ofboards that used USB for communication.
1.1.2 Arduino Uno R3 - Structure and Hardware:
About Arduino, Arduino Uno R3 is the most popular version of Arduino TheUnited Nations version is a revised version 3 (R3), which is currently the latestversion Compared with the old version of Arduino Uno, accuracy and durabilityare much higher Arduino Uno R3 is equipped with three types of 8 -bit AVRmicrocontrollers, including Atmega8, Atmega168 and Atmega328
Table 2-1 Specifications of Arduino Uno R3
Operating voltage 5V (USB)
Recommended operating voltage 6 to 9V
Number of digital I/O pins 14 pins ( 6 pins PWM)
Number of analog I/O pins 6 pins
Maximum output current per pin I/O 30 mA
Maximum output current (5V) 500 mA
Maximum output current (3.3V) 50 mA
Flash memory 32KB (ATmega328) with
0.5KB used by bootloader
Operating frequency 16 MHz
Trang 111.1.3 Pinout diagram of Arduino Uno R3:
Figure 2-1 Pinout diagram of Arduino Uno R3
An Arduino Uno R3 board consists of 20 input and output pins, of which 6function pins are PWM inputs and 6 function pins are PWM inputs
1.1.4 Power supply:
Arduino Uno is powered with 5V through USB connection or external power supply The external power source (not from USB) can be obtained from AC-DC converter module or battery pack
To connect with converter module, we can plug a 2.1mm center-positive plug into the power jack on the board When using battery pack, the pack is connected between Vin and GND pins to supply power
Arduino Uno can operate with external power source from 6 to 20V If using lower voltage, typically 7V, the 5V pin may supply less than 5V, but it may cause unstable operation
When using power source above 12V, the voltage regulator will become hot andmay get damaged, therefore it is recommended to use power source from 7 to 12V
Trang 12UNO When we use devices with separate power sources, theirnegative pins must be joined together.
5V: is the output voltage supplied by Arduino UNO The maximumcurrent allowed on this pin is 500mA
3.3V: is the output voltage of 3.3V The maximum current allowed onthis pin is 50mA
IOREF (Input Output Reference): is the operating voltage of themicrocontroller on the Arduino UNO It can be measured at this pinand is 5V However, it is not used to supply power from this pin
RESET: Pressing the Reset button on the board resets themicrocontroller It corresponds to connecting the RESET pin to GNDvia a resistor (10KΩ).)
1.1.5 I/O Pins:
The Arduino UNO R3 kit has 14 digital pins that can be used as input or outputpins by using functions such as pinMode(), digitalRead(), and digitalWrite() Theyhave only 2 voltage levels which are 0V and 5V, with a maximum input/outputcurrent of 40mA on each pin Each pin has pull-up resistors built into theATmega328 microcontroller (these resistors are not connected by default)
Some digital pins have special functions as follows:
2 Serial pins: 0 (RX) and 1 (TX): used to send (TX) and receive (RX) TTLSerial data Arduino Uno can communicate with other devices via these pins.Wireless serial connection, such as Bluetooth connection, is often referred to
as wireless Serial If serial communication is not needed, it is not necessary
to use these pins
Trang 13 PWM (Pulse Width Modulation) pins (~): 3, 5, 6, 9, 10, and 11: these pinsallow you to output PWM with 8-bit resolution (values from 0 to 255corresponding to the voltage range of the pin from 0V to 5V) usinganalogWrite() function In other words, you can adjust the output voltage ofthis pin from 0V to 5V, instead of just fixing it at 0V and 5V like other pins.
SPI (Serial Peripheral Interface) pins: 10 (SS), 11 (MOSI), 12 (MISO), 13(SCK): In addition to their normal functions, these 4 pins are also used totransmit data using the SPI protocol with other devices
LED 13: there is a orange LED (with "L" label) on the Arduino UNO board.When you press the Reset button, you will see this LED flash as a signal It
is connected to pin 13 When this pin is used by the user, the LED will beturned on
Arduino UNO has 6 analog pins (A0 to A5) that provide 10-bit signalresolution (0 to 210-1) to read voltage values ranging from 0V to 5V Withthe AREF pin on the board, you can provide a reference voltage when usinganalog pins That is, if you supply 2.5V to this pin, you can use the analogpins to measure voltage values from 0V to 2.5V with a resolution of 10-bits.Particularly, Arduino UNO has 2 A4 (SDA) and A5 (SCL) pins that supportI2C/TWI communication with other devices
1.7 Arduino IDE Software Overview:
Arduino IDE stands for 'Arduino Integrated Development Environment', which
is an open-source software environment primarily used to write code on a compilersimilar to C/C++ and load them into microcontroller boards
The programming environment is simple and easy to use, the programminglanguage is easy to understand and based on the familiar C/C++ platform fortechnical people And importantly, the number of pre-written and shared codelibraries by the open community is incredibly large
Trang 14Figure 2-2 Interface of Arduino IDE 2.0.4
1.8 General about barcodes and scanners GM65:
1.1.6 Barcode concept:
Trang 15Barcode (or also known as a barcode) is a method of storing and transmittinginformation using a symbol called a barcode symbology A barcode symbology orsimply barcode, is a symbol composed of a combination of straight bars and spacesthat represent patterns of characters, symbols, and numeric digits Variations in thewidths of the bars and spaces represent data in the form of digits or characters thatcan be read by a machine.
As an automatic identification technology, barcode allows for quick andaccurate data collection
1.1.7 Common types of barcodes:
Around us there are many types of barcodes, the most commonly seen are 2types of 1D and 2D codes
- Universal Product Code (UPC): with parallel black bars encoded from an digit string (valid from 0 to 9) and a check digit at the end to create acomplete 12-digit barcode It is used for labeling and checking consumergoods at fixed points of sale worldwide This barcode type is managed by theUS-based Uniform Code Council (UCC) Applications include retail,supermarkets, consumer goods, etc
Trang 16-Figure 2-3 UPC barocde
- EAN (European Article Number): is an improvement of UPC-A barcode,with the main difference being geographic application Applications includeretail, supermarkets, consumer goods,
Figure 2-4 EAN barcode
- Code 39: overcomes the biggest drawback of the above two barcodes, which
is the ability to encode an unlimited amount of data and a wider range ofcharacters, including uppercase letters, natural numbers, and some specialcharacters Applications include Defense Department, healthcare,administrative agencies, book publishing
Figure 2-5 Code 39
Trang 17- Code 128: is a highly rated and widely used barcode type due to its manyoutstanding advantages: Compact barcode, stores a wide range ofinformation, and can encode more characters including uppercase letters,lowercase letters, digits, standard ASCII characters, and control codes.Applications include supply chain and logistics, retail supply chain,manufacturing industry
Figure 2-6 Code 128
1.1.1.2 2D barcode:
2D barcode (also known as QR code) is a form of barcode that represents dataencoded in a matrix of small and large squares alternatively The data in the 2Dbarcode can be arranged horizontally or vertically, allowing it to store moreinformation than the 1D barcode The 2D barcode can contain at least 2000characters, and it's commonly used to link to websites or track products, identifyproducts, online payment, etc The most common type of 2D barcode is QR Code(Quick Response Code), which is widely used in advertising and branding, product/service introduction, promotional campaigns, information retrieval, even forscanning payment and money transfer at some banks
- QR Code has many advantages, such as diverse sizes, fast data reading,supporting 4 different data encoding modes (numeric, alphanumeric, byte,Kanji), less error-prone, and especially, it's free to use
Trang 18Figure 2-7 QR code
- Matrix code: This type of barcode is used for naming goods and documents.Similar to QR Code, this barcode is rarely error-prone during use and hasfast reading capabilities
Figure 2-8 Matrix code
- PDF417 barcode: PDF417 is a 2D barcode that is used in applications thatrequire storing massive amounts of data, such as digital images, fingerprints,numbers, graphics, signatures, etc This barcode is commonly used overseas
Figure 2-9 PDF417 barcode
1.1.8 How Barcode works:
Trang 19While you encounter barcodes on a daily basis, have you ever pondered howthey work? The following is how barcodes work:
- First, barcode scanners will beam light through the barcode and then into asuper-sensitive light detector using an incandescent light bulb or laser
- The barcode's black lines absorb light, while the white elements of thebarcode show through and are reflected
- The scanner measures the amount of light and converts it into readable data For example, the light scanner records the black sections that
computer-do not reflect well as 1 and the white parts as 0
- On the system, inventory management software will receive and interpretthis information
Figure 2-10 How barcodes work
1.1.9 Classification of barcode scanners and barcode recognition methods:
To read barcode symbols, people use a type of device called a barcode scanner,which is essentially an optical reader that uses a beam of light or laser Sometimeswhen looking at a barcode symbol, we may see a series of numbers directly below
Trang 20There are two types of barcode readers classified according to the manufacturingtechnology:
- Laser Barcode Reader
- CCD Barcode Reader
Since my system uses Laser Barcode Reader, I will focus on Laser BarcodeReader
1.1.1.3 Structure of Laser Barcode Reader:
Laser light is shone on the label surface and its reflection is captured by a sensor(laser photo detector) to read a bar code
A laser beam is reflected off a mirror and swept left and right to read a bar codeUsing laser allows reading of distant and wide bar code labels
Figure 2-11 Structure of Laser Barcode Reader
The Laser Barcode Reader type consists of the following components: a laserdiode, a polygon mirror, a motor, and a light-receiving element (photodiode)
Trang 211.1.1.4 The principle of reading barcodes:
Figure 2-12 The principle of reading barcodes
(1) The laser beam emitted from the laser diode is aimed at the barcode via thepolygon mirror The light-receiving element (photodiode) receives the reflectedlight from the barcode
(2) This reflected light is in the form of an analog wave
(3) The barcode reader converts the analog waveform to digital (A/D conversion)and determines the width of the bars and spaces using the digital signal
(4) The barcode reader decodes the combination of bars and spaces into barcodedata The decoded data output is transmitted to an external device via RS232C orequivalent communication
The advantages of laser barcode scanners are their high sensitivity, precision,ability to scan on curved surfaces, and long-range scanning capabilities Thedownside is that they are not as durable as CCD scanners because laser scanners use
a laser eye similar to the read head of a disc After reading for a limited time, thelaser eye can become weak, resulting in the "barcode sticking" effect, similar to thedisc sticking effect of a read head, and it can also be permanently damaged
1.9 Servo DC motor overview:
1.1.10 What is a servo motor?
A servo motor is a type of electric motor that can rotate with great precision.Normally this type of motor consists of a control circuit that provides feedback on
Trang 22Servomechanism is basically a closed-loop system, consisting of a controlleddevice, controller, output sensor and feedback system The term servomechanismmost probably applies to the systems where position and speed is to be controlled.
1.1.11 Working principle of servo motor:
Servo motors are utilized to precisely control both position and speed, although
in simple cases, only position may be controlled A potentiometer coupled with themotor shaft through gears senses the mechanical position of the shaft, and converts
it into an electrical signal that is compared to the command input signal Incontemporary servo motors, electronic encoders or sensors are alternatively used todetect the position of the shaft
Command input is provided based on the required position of the shaft Whenfeedback signal varies from the input signal, an error signal is produced This errorsignal is then amplified and delivered as input to the motor, causing rotation Whenthe shaft attains the desired position, the error signal becomes zero and the motorhalts, holding the position
The PWM (Pulse Width Modulation) principle governs the operation of a servomotor, wherein the angle of rotation is controlled by the duration of the appliedpulse to its Control PIN Servo motors are essentially composed of a DC motor that
is regulated by a variable resistor (potentiometer) and some gears
A pulse is delivered every 20 milliseconds, with the pulse width dictating theposition of the shaft For example, a 1ms pulse will turn the shaft anticlockwise by -90°, a 1.5ms pulse will place the shaft in the neutral position at 0°, and a 2ms pulsewill turn the shaft clockwise by +90°
Trang 23Figure 2-13 Working principle of servo motor
1.10 Operating principle of infrared sensors:
Active infrared sensors use radar technology to transmit and receive infraredradiation This radiation strikes surrounding objects and bounces back to thedevice's receiver This technique allows the sensor to detect not just movement in anarea, but also how distant the item is from the instrument
Operating principle:
Infrared sensors function in a similar way to object detection sensors Thesesensors comprise an IR LED (infrared light-emitting diode) and an infraredphotodiode The IR LED is a type of transmitter that emits infrared radiation Thephotodiode receiver mainly detects the radiation using an IR transmitter Thesephotodiode receivers are available in the form of optical diodes
When the IR emitter produces radiation, it reaches the object and some of theradiation is then reflected back to the IR receiver The output of the sensor can bedetermined by the IR receiver depending on the intensity of the reflection
Trang 24Figure 2-14 Operating principle of infrared sensors
Trang 25CHAPTER 3: DESIGN AND CONSTRUCTION
POWER BLOCK
PROCESSING BLOCK
MOTOR BLOCKSENSOR BLOCK
CODE SCANNING BLOCK
DISPLAY BLOCKMOTOR BLOCK
Figure 3-15 The block diagram of the system
Trang 26(220NF) and two types of ICs, 7809 and 7805 Both 7809 and 7805 are fixed outputvoltage regulator ICs with 9V and 5V, respectively Both belong to the LM78xxseries of positive voltage regulator ICs, which are produced in the TO-220 package.These ICs are commonly used in commercial electronic circuits and devices.
The structure and pins of these two types of ICs are the same, differing only intheir technical specifications:
Figure 3-16 Specifications of IC 7805 Table 3-2 specifications
Trang 27The power block will provide 12V for the conveyor motor, 9V for theprocessing block, 5V for the code scanning block, the Servo motor block and thesensor block.
Figure 3-17 Power Block diagram
1.1.13 Code Scan Block:
The GM65 barcode reader module, is supplied with 5V, used to identifybarcodes to give information to the microprocessor block
The GM65 barcode reader module is a high-performance scanner that can read1D and 2D barcodes quickly It also has a fast scan speed for linear codes, as well asbarcodes on paper or screen
The GM65 barcode reader module is a powerful bar code decoding algorithmbased on image recognition that can simply and reliably scan bar codes whilesimplifying secondary development The GM65 barcode reader module operatesreliably in low-light conditions and throughout a wide temperature range
Figure 3-18 The GM65 barcode reader module