A
MINOR PROJECT
REPORT ON
“AUTOMATED WRITING MACHINE ”
SUBMITTED IN PARTIAL FULFILLMENT FOR THE AWARD OF DIPLOMA IN
COMPUTER SCIENCE & ENGINEERING
Session: 2022-2023
Submitted by: SHIVAM PATIDAR
(SP No.:CS20210011/022 )
DEPARTMENT OF COMPUTER SCIENCE &
ENGINEERING
GOVERNMENT POLYTECHNIC COLLEGE
JHALAWAR
#certificate…..
I
PREFACE
In the realm of technology and creativity, a union emerges—the Automatic Arduino
Writing Machine. This manual unveils the convergence of Arduino's prowess and human
imagination. From code to motion, mechanics to expression, we explore the harmonious
fusion that births this innovation. This machine is more than gears and wires; it's a canvas
where automation breathes life into art.
Automation, or labor-saving technology is the technology by which a process or procedure
is performed with minimal human assistance. Automation or automatic control is the use of
various control systems for operating equipment such as machinery, processes in factories,
boilers and heat treating ovens, switching on telephone networks, steering and stabilization
of ships, aircraft and other applications and vehicles with minimal or reduced human
intervention.
Advantages commonly attributed to automation include higher production rates and
increased productivity, more efficient use of materials, better product quality, improved
safety, shorter workweeks for labor, and reduced factory lead times. Higher output and
increased productivity have been two of the biggest reasons in justifying the use of
automation. Automated machines are more accurate, versatile & reliable. They reduce the
probability of error significantly.
The automated writing machine consists of two motors to achieve movement of the
mechanical arm in two dimensions. The system developed aims to reduce the final
production cost by 73%. This Automated writing machine is a programmed composing
machine used for composing any kind of content and drawing any outline on paper. It
works like a CNC machine.
II
ACKNOWLEDGMENT
The satisfaction and euphoria that accompany the successful completion of
any task would be incomplete without the mention of people who made it possible,
whose consistent guidance and encouragement crowned our efforts with success.
We consider it as our privilege to express the gratitude to all those who
guided in the completion of the project.
First of all, we thank the Lord Almighty for his grace on us to succeed in
this endeavor.
We express our gratitude to Principal, Dr. Rajul Goyal, for having provided
us with the golden opportunity to undertake this project work in their esteemed
organization.
We sincerely thank Mr. Sunil Sharma, HOD, Department of Computer
Science and Engineering, Govt. Polytechnic College Jhalawar, for his immense
support and guidance given to us.
We also express our gratitude to Mr. Naveen Dabley and Mr. Jagdish
Prasad Meena , Lecturer, Department of Computer Science and Engineering, Govt.
Polytechnic College Jhalawar, for their support and suggestions throughout the
project work.
Last but not the least, heartfelt thanks to our parents, staff members of
Department of Computer Science and Engineering , Govt. Polytechnic College ,
Jhalawar and friends for their support.
III
APPENDIX - A
List of Acronyms
2D : Two Dimensional
3D : Three Dimensional
AC : Alternating Current
API : Application Programming Interface
CNC : Computer Numerical Control
CV : Computer Vision
DC : Direct Current
ICSP : In-Circuit Serial Programming
IDE : Integrated Development Environment
LED : Light Emitting Diode
MDF : Medium Density Fiberboard
MG : Metal Gear
NASA : National Aeronautics and Space Administration
NEMA : National Electrical Manufacturers Association
OCR : Optical Character Recognition
OpenCV : Open-source Computer Vision
OSS : Open Source Software
PC : Personal Computer
PCB : Printed Circuit Board
PIL : Python Imaging Library
PWM : Pulse Width Modulation
ROI : Region of Interest
USB : Universal Serial Bus
IV
CONTENTS
Page no.
CERTIFICATE I
PREFACE II
KNOWLEDGEMENT III
APPENDIX - A (List of Acronyms) IV
1. Introduction 1
1.1 Overview 1
1.2 Proposed System 2
2. Literature Review 4
2.1 Polygraph 4
2.2 Typewriter 5
2.3 Telautograph 5
2.4 Autopen 6
2.5 Longpen 7
2.6 AxiDraw 7
2.7 Papers Published 8
3. Project Description 10
3.1 Overview 10
3.2 Software 10
3.3 Hardware 11
4. Software 12
4.1 Overview 12
4.2 Python 12
4.3 OpenCV 13
4.4 Tesseract 14
4.5 PIL (Python Imaging Library) 16
4.6 Benbox 17
5. Hardware 19
5.1 Overview 19
5.2 Stepper Motor 20
5.3 Servo Motor 22
5.4 Motor Driver 24
5.5 Expansion Board 26
5.6 Arduino 28
5.7 Wooden Frame 29
6. Methodology of Implementation 31
6.1 Overview 31
6.2 Flowchart 31
6.3 Block Diagram 32
6.4 Implementation Steps 32
6.5 Output and Discussion 37
7. Future Scope and Applications 40
8. Conclusion 41
9. References 42
44
LIST OF FIGURES
Figure No. Description Page No.
2.1 Polygraph 5
2.2 Basic Typewriter 5
2.3 Autopen Model 50 6
2.4 AxiDraw 8
4.1 Process flow of OCR 17
4.2 Benbox Software 18
5.1 Overview of hardware components 19
5.2 Schematic view of general stepper motor 20
5.3 Nema 17 stepper motor 21
5.5 Controlling of servo motor using PWM 23
5.6 MG90S servo motor 24
5.7 A4988 motor driver with heat sink 25
5.8 A4988 motor driver pinout 26
5.9 A4988 driver expansion board for Arduino 27
5.10 Expansion board connected to A4988 motor driver and Arduino 27
5.11 Arduino UNO R3 pinout 29
5.12 Frame of the project 30
6.1 Flowchart of the overall process 31
6.2 Block diagram of the complete process 32
6.3 Sample input image in predefined font 33
6.4 Extracted text shown on the terminal 33
6.5 Extracted text written into a text file 34
6.6 Document image in user's font 34
6.7 Image uploading in Benbox software 35
6.8 Parameter configuration for Benbox 36
7.1 Input in predefined font 37
7.2 Font converted text 37
7.3 Final setup and output on paper 38
LIST OF TABLES
Table No. Description Page No.
2.1 List of all major automated or mechanical writing systems 4
7.1 Comparison of proposed system with others 38
I
Chapter 1
INTRODUCTION
1.1 OVERVIEW
As the world is entering the dawn of a new era, manufacturing is undergoing an
evolution which has been termed as Industry 4.0 or Smart Manufacturing. The speed with
which industries are moving towards digital technologies like industrial robotics, 3D
printing, machine learning, optical character recognition, cloud computing, augmented
reality and sensors can make the Industry 4.0 revolution more realistic [1].
The human race is turning to robots to do the work and reduce human effort. In
this society which is undergoing a rapid change, time and manpower are the major critical
constraints in the completion of any tasks on large scales and with efficiency. Therefore
automation is playing a significant role in saving a lot of human efforts in most of the
regularly carried out works like welding, painting, assembly, container filling, writing,
etc. As far as writing is concerned, the time and effort taken in typing the keys on a
keyboard which is time consuming and requires a lot of skills and human efforts can be
avoided with the help of automation [2] [3].
Some existing technologies such as automated voice to text converters are used to
write only the inbuilt fonts like the Roman, Calibri, Arial, Impact, Georgia, etc. The paper
aims to design and develop a system which is capable of writing on a page with the help
of a pen in the user's specific handwriting or in predefined font if needed.
Automated Writing Machine De
par
II
This initiates the concept of CNC machines which are Computer Numerical
Control machines which is a unique and versatile form of soft automation. Initially, it had
been advanced to regulate the motion and also the operation of device tools. By using
concepts like CNC machines, an automated machine can be implemented for writing
purposes also [6][9]. Fig 5 shows the overall hardware setup of the proposed system.
1.2 PROPOSED SYSTEM
The proposed system is an auto composing machine through which one can make
their work simpler by programming the venture. According to the title this is a
straightforward task utilizing Arduino to make a writing machine at the place of work,
which can draw any outline and compose various kinds of fonts. This system is an
embedded system whose working principle is based on the Computer Numerical Control
machine. It uses an Arduino development board which is connected with other
peripherals like motors to provide the necessary pen movement on the paper.
The Arduino board is interfaced with one servo motor and two stepper motors to
achieve the pen movement and x-y axis gantry movement respectively based on the input
image that is fed into the system. The pen which is fitted in the system is part of the z axis
movement. The servo motor helps in the vertical movement of the nib of the pen so that
the pen nib will touch the paper only when something needs to be written and is raised
above when not needed. This motion of the pen in the z axis coupled with the x and y axis
movement achieved through the stepper motors results in a two dimensional sketching on
the paper.
Automated Writing Machine De
par
III
This system is a valuable setup and can be utilized in everyday life. As we know,
there are many areas in human life which require us to write the matter by ink on a paper
in their own handwriting. For example Departments like Administration, Judicial,
Municipal, Police, etc. having clerks for writing the matter manually.
Automated Writing Machine De
par
IV
Chapter 2
LITERATURE REVIEW
In this chapter , we will discuss how the automated writing concept developed
through history. Table 2.1 shows a list of all major automated or mechanical writing
systems.
Table 2.1 List of all major automated or mechanical writing systems
Machine Year
1804 Polygraph
1874 Typewriter
1888 Telautograph
1937 Autopen
2004 Longpen
2014 AxiDraw
2017 - 19 Papers published
2.1 POLYGRAPH
A Polygraph is a duplicating device that produces a copy of a piece of writing
simultaneously with the creation of the original, using pens and ink. It was first developed
by an Englishman named John Isaac Hawkins. Hawkins received a United
States patent for his device in 1803. This early device was known at the time as
a polygraph and bears little resemblance to today's autopens in design or operation .
Automated Writing Machine De
par
V
Fig 2.1 Polygraph
2.2 TYPEWRITER
A typewriter is an electromechanical machine for writing characters similar to
those produced by a printer's movable type. Typically, a typewriter has an array of keys,
and each one causes a different single character to be produced on the paper, by means of
a ribbon with dried ink struck against the paper by a type element similar to the sorts used
in movable type letterpress printing. The first commercial typewriters were introduced in
1874, but did not become common in offices until after the mid-1880s. The typewriter
quickly became an indispensable tool for practically all writing other than personal
handwritten correspondence. It was widely used by professional writers, in offices etc.
Fig 2.2 Basic typewriter
2.3 TELAUTOGRAPH
The telautograph, an analog precursor to the modern fax machine, transmits
electrical impulses recorded by potentiometers at the sending station
Automated Writing Machine De
par
VI
to servomechanisms attached to a pen at the receiving station, thus reproducing at the
receiving station a drawing or signature made by the sender. It was the first such device to
transmit drawings to a stationary sheet of paper. The telautograph's invention is attributed
to Elisha Gray, who patented it on July 31, 1888. Gray's patent stated that the
telautograph would allow "one to transmit his own handwriting to a distant point over a
two-wire circuit".
2.4 AUTOPEN
An autopen or signing machine is a device used for the automatic signing of a
signature or autograph. The autopen called the Robot Pen was developed in the 1930s,
and became commercially available in 1937. It was used as a storage unit device (similar
in principle to how vinyl records store information) to record a signer's signature. A small
segment of the record could be removed and stored elsewhere to prevent misuse. The
machine would then be able to mass-produce a template signature when needed.
The first commercially successful autopen was developed by Robert M. De Shazo,
in 1942. The modern autopen, the Autopen Model 50 was one of the International
Autopen Company’s earliest automatic signature machines [20].At top speed, the
machine signed about twice as fast as a human.
Fig 2.3 Autopen Model 50
Automated Writing Machine De
par
VII
2.5 LONGPEN
The LongPen is a remote signing device conceived of by writer Margaret Atwood
in 2004 and debuted in 2006. It allows a person to remotely write in ink anywhere in the
world via tablet PC and the Internet and a robotic hand. It also allows for an audio and
video conversation between the endpoints, such as a fan and author, while a book is being
signed.
2.6 AXIDRAW
The AxiDraw project has been active since 2014, when it was first created by Dr.
Lindsay Robert Wilson. In the UK. The AxiDraw is a simple, modern, precise, and
versatile pen plotter. AxiDraw machines work with a variety of writing instruments,
including permanent markers and fountain pens. The unique writing head extends beyond
the base of the machine, making it possible to write or draw on almost any flat surface
[18].
The AxiDraw is a pen plotter, which is a type of simple robot. Its sole function is
to guide a pen along the set of vector lines, curves, and paths that you ask it to follow.
Everything that the machine is ultimately capable of, such as drawing graphics, writing
text, or signing documents, are expressions of this basic function. It is capable of drawing
essentially anything that can be composed from a set of lines. But there are not many
advances made in the machine where the output is in the user's handwriting. Additionally,
these machines are really expensive for a common man to buy.
Automated Writing Machine De
par
VIII
Fig 2.4 AxiDraw
2.7 PAPERS PUBLISHED
All the papers published about pen plotters do not incorporate converting the
extracted text from a document into the user's font.
In the paper title “Automated Writing and Drawing Machine“ [2] a robotic arm
has been developed which is fitted with a pen and this system is programmed to write
down anything that the user pronounces into the microphone. This setup is cost efficient
which helps a physically challenged person to write or draw small sketches, draw an
outline diagram, and do multiple signatures. This work was based on Java and web
applications along with firebase Server.
The paper “Homework Writing Machine” [3] discusses a composing machine
which is capable of composing any kind of content and drawing any outline on paper.
This instrument could be utilized by the network for the outline and quick composition
process. This machine works in three axes whose movement is given by stepper engine
and servo engine.
The author in the paper “Design and Development of Arduino Controlled Writing
Robot” [7] has focussed on developing a writing robot which incorporates speech
recognition using an Arduino microcontroller. This machine is capable of recognizing
Automated Writing Machine De
par
IX
voice inputs recorded by the user with the help of a microphone and writing the message
on paper.
The system proposed in this paper is an automated writing machine which is
capable of performing optical character recognition. The aim is to give the output on
paper with the help of a pen controlled by motors in the user's handwriting or in a
predefined font, provided the user's font is built and installed which can be done through
web applications.
Automated Writing Machine De
par
X
Chapter 3
PROJECT DESCRIPTION
3.1 OVERVIEW
This chapter describes the fundamental concepts based on which the project is
designed and implemented. This includes a brief introduction on the overall software and
hardware working.
3.2 SOFTWARE
Computer software, or simply software, is that part of a computer system that
consists of encoded information or computer instructions, in contrast to the physical
hardware from which the system is built. All the softwares used in this project comes
under the open source category.
Open-source software (OSS) is computer software with its source code made
available with a license in which the copyright holder provides the rights to study,
change, and distribute the software to anyone and for any purpose. Open-source software
may be developed in a collaborative public manner. Open-source software is the most
prominent example of open-source development.
The role of software in this project is to mainly extract text from the image. This
is called Optical Character Recognition (OCR). Optical Character recognition (OCR) is a
process of detecting text regions inside a digital image and recognizing the text. It is
mostly used in text detection and extraction from scanned documents. The processing of
Automated Writing Machine De
par
XI
images in OCR comprise of detecting and recognizing various characters like numbers,
symbols, and alphabets. It's also possible to integrate several programs which will result
in OCR. For example one program can detect text regions and send the output to a second
program, which in turn can recognize the characters in text and convert them to editable
form [5][10].
3.3 HARDWARE
Electronic hardware consists of interconnected electronic components which
perform analog or logic operations on received and locally stored information to produce
as output, resulting in new information or to provide control for output actuator
mechanisms.
Electronic hardware can range from individual chips/circuits to distributed
information processing systems. Well designed electronic hardware is composed of
hierarchies of functional modules which inter-communicate via precisely defined
interfaces.
The proposed system’s hardware mainly consists of two axes operating
orthogonally to each other and a third axis, with limited motion capability, which is used
to actuate the write head. Additionally, the hardware is controlled by the software through
a development board.
Automated Writing Machine De
par
XII
Chapter 4
SOFTWARE
4.1 OVERVIEW
All the softwares and libraries used to implement this project is exhaustively
discussed in this chapter. The softwares and libraries used are: Python, Open CV,
Pytesseract, PIL, Benbox.
4.2 PYTHON
The basic programming language used in this project is python. More precisely
Python version 3.8. Python is a general-purpose programming language that can be used
on any modern computer operating system. It can be used for processing text, numbers,
images, scientific data and just about anything else you might save on a computer. It is
used daily in the operations of the Google search engine, the video-sharing website
YouTube, NASA and the New York Stock Exchange. These are but a few of the places
where Python plays important roles in the success of the business, government, and non-
profit organizations; there are many others.
Python is a dynamic language, built for speed. Python is a high-level, interpreted
and general-purpose dynamic programming language that focuses on code readability.
The syntax in Python helps the programmers to do coding in fewer steps as compared to
Automated Writing Machine De
par
XIII
Java or C++. Python has topped the charts in recent years over other programming
languages like C, C++ and Java and is widely used by programmers.
One of the main reasons to choose this language was because it provides large
standard libraries that include the areas like string operations, Internet, web service tools,
operating system interfaces and protocols. Most of the highly used programming tasks are
already scripted into it that limits the length of the codes to be written in Python.
Secondly, python is relatively very easy to write and understand.
4.3 OPEN CV
The CV in OpenCV stands for Computer Vision. Humans are capable of
perceiving the three-dimensional structure of the world around with apparent ease.
Computer vision (CV) tries to describe the world that humans see in one or more images
and to reconstruct its properties [22]. Being a very matured and well supported
programming language in the area of machine learning, Python is used for computer
vision programming. Practically computer vision applications contain a mix of
programming, modeling, and mathematics [22].
Computer vision is a field of computer science that works on enabling computers
to see, identify and process images in the same way that human vision does, and then
provide appropriate output. It is like imparting human intelligence and instincts to a
computer. In reality though, it is a difficult task to enable computers to recognize images
of different objects. When a human who is driving a car sees someone suddenly move
into the path of the car, the driver must react instantly. In a split second, human vision has
completed a complex task, that of identifying the object, processing data and deciding
Automated Writing Machine De
par
XIV
what to do. Computer vision's aim is to enable computers to perform the same kind of
tasks as humans with the same efficiency.
An important point to note is that computer vision is not like image processing.
Image processing only deals with enhancing the contents of the image but it is not
concerned with understanding the content of the image. One of the problems solved with
computer vision is Optical Character Recognition (OCR).
OpenCV stands for open source computer vision. OpenCV is an open source
computer vision and machine learning library. OpenCV is a library of programming
functions mainly aimed at real-time computer vision. In simple language it is a library
used for Image Processing. It is mainly used to do all the operations related to images. It
is really great for research papers or projects that are built on top of the work of other
developers. OpenCV is capable of working with any operating system [11]. OpenCV also
supplies functions to read images from files. It supports the most common image formats
[19]. OpenCV and Tesseract can together be combined and used to achieve OCR [15].
In the proposed system, OpenCV performs text detection using OpenCV’s EAST
text detector, a highly accurate deep learning text detector used to detect text in natural
scene images [15].
4.4 TESSERACT
OCR (Optical Character Recognition) is a widespread technology to recognise
text inside images, such as scanned documents and photos. OCR technology is used to
convert virtually any kind of images containing written text (typed, handwritten or
printed) into machine-readable text data. Probably the most well known use case for OCR
Automated Writing Machine De
par
XV
is converting printed paper documents into machine-readable text documents. Once a
scanned paper document goes through OCR processing, the text of the document can be
edited with word processors like Microsoft Word or Google Docs. Before OCR
technology was available, the only option to digitise printed paper documents was to
manually re-typing the text. Not only was it massively time consuming, it also came with
inaccuracy and typing errors.
Tesseract is an optical character recognition engine which can recognize
characters from images by using Python. It was initially developed by Hewlett-Packard.
The recognition of characters in fonts that are available on computers are much more
accurate than human handwriting recognition, based on the training dataset of Tesseract.
[8][12][17]. It mounts the machine and deep learning technologies to achieve optimal
accuracy. Tesseract works best when there is a (very) clean segmentation of the
foreground text from the background. In practice, it can be extremely challenging to
guarantee these types of segmentations. Hence, we tend to train domain-specific image
classifiers and detectors. Hence it’s important to understand how to access Tesseract OCR
via the Python programming language to apply OCR to personal projects .
Python-tesseract, also called Pytesseract, is an optical character recognition
(OCR) tool for python. That is, it will recognize and "read" the text embedded in images.
Pytesseract is a wrapper for Google's Tesseract-OCR Engine. Wrapper is basically a
software that contains other software so that the contained elements can exist in the newer
system or domain. Pytesseract is also useful as a stand-alone invocation script to
tesseract, as it can read all image types supported by the Pillow (PIL) and Leptonica
imaging libraries, including jpeg, png, gif, bmp, tiff, and others. Pytesseract is just a more
secure version of actual tesseract software which can be easily accessed using python.
Automated Writing Machine De
par
XVI
Once the text regions are detected with OpenCV, we’ll then extract each of the
text ROIs and pass them into Tesseract, enabling us to build an entire OpenCV OCR
pipeline.
4.5 PIL
Python Imaging Library (abbreviated as PIL) (in newer versions known as Pillow)
is a free and open-source additional library for the Python programming language that
adds support for opening, manipulating, and saving many different image file formats
[13]. It is available for Windows, Mac OS X and Linux. It is one of the core libraries for
image manipulation in Python. Unfortunately, its development has stagnated, with its last
release in 2009. Luckily, there’s an actively-developed fork of PIL called Pillow. Forking
refers to development of different versions of a program. It’s easier to install, runs on all
major operating systems, and supports Python 3.
Some of the file formats supported are PPM, PNG, JPEG, GIF, TIFF, and BMP. It
is also possible to create new file decoders to expand the library of file formats accessible.
Fig 4.1 shows the entire process flow of optical character recognition including
tesseract and imaging libraries. Here API is an abbreviation for Application
Programming Interface and it is a way to communicate between applications. Every time
a call is made to a server in the name of an application using an API, it counts as an API
request. Logins, saves, queries are examples of operations counted as API requests among
other types of operations. For better understanding, consider you downloaded an
application to your smartphone, you opened it and the application asked your Email and
Automated Writing Machine De
par
XVII
Password. At the moment you press Register and send your data to the API it is counted
as one API request.
Fig 4.1 Process flow of OCR
4.6 BENBOX
The Benbox Laser Engraver as a CNC-platform for laser engraving. In this
project, benbox is used to achieve precise control. When a firmware code is uploaded into
the software, after pressing run in Benbox, the hardware moves according to the
firmware.
Benbox has a number of various parameters that can be manipulated and changed
to get the required precise control [14]. Fig 4.2 shows the view of Benbox software with
changaeble parameters on the right hand side.
Automated Writing Machine De
par
XVIII
Fig 4.2 Benbox software
Automated Writing Machine De
par
XIX
Chapter 5
HARDWARE
5.1 OVERVIEW
The hardware components, and the rationale behind the selection of different
components is discussed in detail in this chapter. The overview of the components used is
shown in Fig 5.1 and these components are discussed in detail in this chapter.
Additionally, the
Fig 5.1 Overview of hardware components
Automated Writing Machine De
par
XX
5.2 STEPPER MOTOR
Stepper motors are DC motors that move in discrete steps. They have multiple
coils that are organized in groups called "phases". By energizing each phase in sequence,
the motor will rotate, one step at a time. With a computer controlled, very precise
positioning and/or speed control can be achieved. For this reason, stepper motors are the
motor of choice for many precision motion control applications.
Fig 5.2 Schematic view of a general stepper motor
Stepper motors have a permanent magnetic rotating shaft called a rotor and
stationary electromagnets surrounding the rotor called the stator. If you look at the coils
on the stator in Fig 5.2, they are arranged in terms of coil pairs, like A and A’ forms a
pair, B and B’ forms a pair and so on. So each of these coil pairs form an electromagnet
and they can be energised individually using a driver circuitry. When a coil gets energised
it acts as a magnet and the rotor pole gets aligned to it, when the rotor rotates to adjust
Automated Writing Machine De
par
XXI
itself to align with the stator it is called as one step. Similarly by energising the coils in a
sequence we can rotate the motor in small steps to make a complete rotation.
Stepper motors basically are electromagnetic devices which convert digital pulses
into mechanical shaft rotation. Many advantages are achieved using these motors such as:
high simplicity, low cost, high reliability, high torque and high accuracy.
Fig 5.3 Nema 17 stepper motor
This project involves usage of two Nema 17 stepper motors (Fig 5.3). One motor
to control the X-axis motion and another motor to control the Y-axis motion.
Additionally, a driver is used to drive the motors. Stepper motors are categorized by
frame size, such as "size 11" or "size 23". The National Electrical Manufacturers
Association (NEMA) sets standards for many electrical products, including step motors.
Generally speaking, "size 11" means the mounting face of the motor is 1.1 inches square.
The Nema17 stepper motor is a stepper motor with an end face size of 1.7 inches x 1.7
inches. The driving voltage is 12-24V. The maximum speed can be as high as 2000 rpm.
It is widely used in 3D printers, engraving machines, film cutting machines and other
occasions.
Automated Writing Machine De
par
XXII
Stepper motors are rated by their holding torque in oz/in (ounces per inch) or N m
or N cm. For example Nema 23 is rated as 175 oz/in, which means it can hold 175 ounces
on an arm of 1 inch in length attached to the motor shaft. Similarly, Nema 17 stepper
motor is rated 50 to 80 oz/in, which is approximately 1.4 to 2.2 kgs. Hence that is why
Nema 17 is used in this project.
5.3 SERVO MOTOR
A servo motor is an electrical device which can push or rotate an object with great
precision. If you want to rotate and object at some specific angles or distance, then you
use a servo motor. It is just made up of a simple motor which runs through a servo
mechanism. If a motor is DC powered then it is called DC servo motor, and if it is AC
powered motor then it is called AC servo motor. We can get a very high torque servo
motor in small and lightweight packages. Due to these features they are being used in
many applications like toy cars, Robotics, Machine etc.
It consists of three parts: Controlled device, Output sensor, Feedback system. It is
a closed loop system where it uses a positive feedback system to control motion and final
position of the shaft. Here the device is controlled by a feedback signal generated by
comparing output signal and reference input signal.
Here the reference input signal is compared to the reference output signal and the
third signal is produced by the feedback system. And this third signal acts as input signal
to control devices. This signal is present as long as a feedback signal is generated or there
is a difference between reference input signal and reference output signal. So the main
Automated Writing Machine De
par
XXIII
task of servomechanism is to maintain output of a system at desired value at presence of
noises.
Servo motor works on PWM (Pulse width modulation) principle, meaning
its angle of rotation is controlled by the duration of applied pulse to its Control PIN.
Basically a servo motor is made up of a DC motor which is controlled by a variable
resistor (potentiometer) and some gears. The servo motor expects to see a pulse every 20
milliseconds (ms) and the length of the pulse will determine how far the motor turns. For
example, a 1.5ms pulse will make the motor turn to the 90° position, such as if the pulse
is shorter than 1.5ms, the shaft moves to 0° and if it is longer than 1.5ms than it will turn
the servo to 180° as shown in Fig 5.5. All servo motors work directly with your +5V
supply rails but we have to be careful on the amount of current the motor would consume,
if you are planning to use more than two servo motors a proper servo shield should be
designed.
Fig 5.5 Controlling of servo motor using PWM
Automated Writing Machine De
par
XXIV
In this project, a servo motor is used for the movement of the pen in the Z-axis.
More specifically MG90S-Metal Gear Micro Servo Motor is used (Fig 5.6). This small
and lightweight servo comes with high output power, thus ideal for Robotic Arms.
Fig 5.6 MG90S servo motor
5.4 MOTOR DRIVER
A stepper motor driver is an electronic device that is used to drive the stepper
motor. By itself it usually does nothing and must be used together with a controller.
Stepper motors require voltages and/or currents that the controller simply can’t produce.
Therefore we need to use a stepper motor driver. This electronic device will transform our
movement instructions from a controller into a sequence where the winding in the stepper
motor will be turned on or off while still providing enough power to it.
Basically a motor driver acts as an interface between the motor and the control
circuits. Motors require a high amount of current whereas the controller circuit works on
low current signals. So, the function of motor drivers is to take a low current control
signal and then turn it into a higher current signal that can drive a motor.
Automated Writing Machine De
par
XXV
Having only one Arduino control all of the stepper motors can take up a lot of the
processing and not leave a lot of room to do anything else; unless a self-contained
dedicated stepper motor driver is used. Therefore, the stepper motor driver used in this
project is A4988. Fig 5.7 shows A4988 motor driver with heat sink, heat sink is used as a
passive heat exchanger that transfers the heat generated by an electronic device to air or a
liquid coolant, where it is dissipated away from the device, thereby allowing regulation of
the device's temperature at optimal levels. Motor drivers can control both speed and
spinning direction of a bipolar stepper motor like NEMA 17 with just two pins. The
A4988 stepper motor driver has output drive capacity of up to 35 V and ±2A and lets you
control one bipolar stepper motor at up to 2A output current per coil like NEMA 17.
Fig 5.7 A4988 motor driver with heat sink
The driver has a built-in translator for easy operation. This reduces the number of control
pins to just 2, one for controlling the steps and other for controlling spinning direction.
The driver offers 5 different step resolutions viz. full-step, half-step, quarter-step, eighth-
step, and sixteenth-step. STEP input controls the micro steps of the motor. Each HIGH
pulse sent to this pin steps the motor by number of micro steps set by Micro step
Selection Pins. The faster the pulses, the faster the motor will rotate. DIR input controls
Automated Writing Machine De
par
XXVI
the spinning direction of the motor. Pulling it HIGH drives the motor clockwise and
pulling it LOW drives the motor counterclockwise (Fig 5.8).
Fig 5.8 A4988 Motor Driver Pinout
5.5 EXPANSION BOARD
A microcontroller has a limited number of pins, and hence a limited number of
interfaces with the outside world. An expansion board takes a few of those pins and fans
them out to even more pins. Expansion boards are also called shields. A shield is
basically a board that can be plugged on top of the Arduino PCB extending its
capabilities. Shields are pieces of hardware that sit on top of your Arduino, often to give it
a specific purpose. For example, you can use a shield to make it easier to connect and
control motors. Fig 5.9 shows A4988 driver expansion board for Arduino.
In this project, A4988 driver CNC shield expansion board for Arduino is used. It
is an Arduino shield which has the capability to control four stepper motors by using four
A4988 stepper motor driver boards. Another good feature of this is that one of the motors
Automated Writing Machine De
par
XXVII
can clone the movement of another motor on the same board. In our case, the expansion
board is used so that two stepper motors and a servo motor can be controlled easily. Fig
5.10 shows the expansion board with A4988 motor driver and Arduino board connected
to it.
Fig 5.9 A4988 driver expansion board for Arduino
Fig 5.10 Expansion board connected to A4988 motor driver and Arduino
Automated Writing Machine De
par
XXVIII
5.6 ARDUINO
Arduino is an open-source platform used for building electronics projects.
Arduino consists of both a physical programmable circuit board (often referred to as a
microcontroller) and a piece of software, or IDE (Integrated Development Environment)
that runs on your computer, used to write and upload computer code to the physical
board. The Arduino board is a printed circuit board (PCB) designed to use a micro-
controller chip as well as other input and outputs. A micro-controller is a small computer
contained in a single, integrated circuit or computer chip. Micro-controllers are an
excellent way to program and control electronics. Micro-controller boards have a micro
controller chip and other useful connectors and components that allow a user to attach
inputs and outputs.
You write code in the Arduino software to tell the microcontroller what to to-do.
For example, by writing a line of code, you can tell a light-emitting diode (LED) to blink
on and off. If you connect a push button and add another line of code, you can tell the
LED to turn on only when the button is pressed. Next, you may want to tell the LED to
blink only when the pushbutton is held down. In this way, you can quickly build a
behavior for a system that would be difficult to achieve without a microcontroller.
In this project, Arduino UNO R3 is used, shown in Fig 5.11. The Arduino UNO is
the best board to get started with electronics and coding. The UNO is the most used and
documented board of the whole Arduino family. Arduino Uno is a microcontroller board
based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can
be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator , a USB
connection, a power jack, an ICSP header and a reset button. It contains everything
needed to support the microcontroller; simply connect it to a computer with a USB cable
Automated Writing Machine De
par
XXIX
or power it with a AC-to-DC adapter or battery to get started. "Uno" means one in Italian
and was chosen to mark the release of Arduino Software (IDE) 1.0.
Fig 5.11 Arduino UNO R3 pinout
5.7 WOODEN FRAME
Selection of frame is an essential part for system designing. The main material
used to make up the X and Y gantry is Medium Density Fiberboard (MDF). Medium-
density fiberboard is the most versatile building material because it’s inexpensive and
fairly durable. MDF is a good choice for practical projects. This MDF is fitted with 3D
printing rods which are in turn connected to the Nema 17 stepper motors. These rods help
in achieving the two dimensional movement because these rods are threaded.
Automated Writing Machine De
par
XXX
Fig 5.12 Frame of the project
Automated Writing Machine De
par
XXXI
Chapter 6
METHODOLOGY
OF IMPLEMENTATION
6.1 OVERVIEW
The methodology of implementation was structured and carried out after a
detailed analysis. To achieve the automated writing, a detailed study and analysis was
made before executing the full mission.
An analysis was made to select a programming platform for easy and faster
processing which is also compatible with most systems with minimum configuration
required. This resulted in converging to use the python programming platform.
In this chapter, firstly the flowchart of the entire process is shown and then the
overall process of implementation is discussed in detail.
6.2 FLOWCHART
Fig 6.1 Flowchart of the overall process
Automated Writing Machine De
par
XXXII
6.3 BLOCK DIAGRAM
Fig 6.2 Block diagram of the complete process
Automated Writing Machine De
par
XXXIII
6.4 IMPLEMENTATION STEPS
STEP 1 : Input the image of the text document which can be in predefined text or in a
human’s handwriting. We will consider predefined text for the sample implementation as
shown in Fig 6.3.
Fig 6.3 Sample input image in predefined font
STEP 2 : Through the python code, the text region is detected using OpenCV and these
text ROIs (Region of Interest) are passed into Tesseract which will extract the text. This
extracted text is shown on the python terminal (Fig 6.4) and also written into a text file
(Fig 6.5).
Automated Writing Machine De
par
XXXIV
Fig 6.4 Extracted text shown on the terminal
Fig 6.5 Extracted text written into a text file
Automated Writing Machine De
par
XXXV
STEP 3 : The font of text from the text file in the previous step is converted into
the user’s font which in turn is converted into an image as shown in Fig 6.6. Here the
user’s font template is obtained with the help of a web application.
Fig 6.6 Document image in user’s font
STEP 4 : Finally the image obtained in the previous step is uploaded into the user
interface terminal software, which is Benbox in this case. With the help of the firmware
code, the image that is uploaded is written onto the paper with the help of hardware
motion that is achieved through motors and power supply. Fig 6.7 shows how the image
can be uploaded into benbox. Fig 6.8 shows the parameter configuration in Benbox.
Fig 6.7 Image uploading in Benbox software
Automated Writing Machine De
par
XXXVI
Fig 6.8 Parameter configuration for Benbox
Automated Writing Machine De
par
XXXVII
6.5 RESULTS AND DISCUSSION
This proposed system is a new kind of automated writing machine which
incorporates optical character recognition. The source code will first extract the text from
the input image and this extracted text is converted into any of the predefined fonts stored
in the computer or to the user's handwriting. Fig 7.1 shows the input image which is a
snippet of scanned document in predefined font - “Arial” and Fig 7.2 shows the extracted
text converted to user’s font. The font conversion is done with the help of a web
application. Here the user’s alphabetical data is uploaded and using this the font is built.
DEPT OF CSE ,GPC
JHALAWAR
Fig 7.1 Input in predefined font
DEPT OF
CSE ,GPC
JHALAWAR
Fig 7.2 Font converted text
Automated Writing Machine De
par
XXXVIII
This font converted image or image in predefined text is uploaded and executed in
Benbox software, the output is written on the paper as shown in Fig 7.3.
Fig 7.3 Final setup and output on paper
The main advantage of this system lies in the cost of production. Considering two
commercially available similar systems for the purpose of comparison as shown in below.
Automated Writing Machine De
par
XXXIX
Table 7.1 Comparison of proposed system with others
Another important point to keep in mind is the accuracy of optical character
recognition. OCR of text in predefined fonts is relatively more accurate than that in
human handwriting, approximately above 95% most of the time depending on which font
is used. Accuracy of OCR in case of human handwriting recognition is dependent on how
shabby or neat the person’s handwriting is. The writing speed of the machine is almost
the same as that of an average human which is 13wpm (words per minute).
One of the limitations in this project is that the output can only be written in block
letters due to the laser engraving software used. This problem can possibly be solved by
using a different software.
Automated Writing Machine De
par
XL
Chapter 7
FUTURE SCOPE
AND APPLICATIONS
The proposed system can be used as a baseline setup for many future
modifications. One such modification can be inclusion of voice to text modules in the
already proposed system [16], which will be beneficial for specially abled people.
Another modification can be to make a real time system, where the user can send
the text to be written remotely and the machine should be capable of writing it down. This
can be achieved by incorporating the use of the internet and cloud services into the
process. This particular application can be useful to notify a family member whose phone
battery might have run out and hence the phone would have switched off.
Currently, the optical character recognition of the proposed system is not as
accurate for shabby handwriting than it is for predefined handwriting style. Hence, by
achieving better text recognition [4], the system can be extended to read doctors'
prescriptions which in turn can be converted to the user’s language using a language
translation model.
To summarize, the automated writing machine is user friendly, cost efficient and
aims to improve the quality of life & reduce human efforts.
Automated Writing Machine De
par
XLI
Chapter 8
CONCLUSION
In these developing times, humans are turning towards robots to do their work to
save time and manpower and to have an efficient output. The basic problem with the
already existing technologies like automated speech writing machines, speech to text
converter, printers, scanners, is that they only write in predefined fonts present in the
computer. The proposed system works as an automated writing machine that is capable of
writing in any predefined font or in the user’s handwriting style.
After integrating the software with hardware, the resultant mechanical system
makes up an user friendly and cost effective automated writing machine with minimum
human interruption, reducing the requirement of manual effort and time. To summarize,
the automated writing machine will be able to contribute to our daily life challenges and
hence improve the quality of life.
It has been a great pleasure for us to work on this exciting and challenging
project. This project proved good for us as it provided practical knowledge of not only
programming in python and working with embedded systems, but also about all the
handling procedures related with “Automated Writing Machine”. It also provides
knowledge about the latest technology used in developing web enabled application
technology that will be in great demand in future. This will provide better opportunities
and guidance in future in developing projects independently.
To summarize, the automated writing machine will be able to contribute to our
daily life challenges and hence improve the quality of life.
Automated Writing Machine De
par
XLII
Chapter 9
REFERENCES
[1] P. Novák, J. Vyskočil, P. Kadera, L. Kathrein, K. Meixner, D. Winkler, S. Biffl,
“Engineering Roles and Information Modeling for Industry 4.0 Production System
Engineering”, 2019 24th IEEE International Conference on Emerging
Technologies and Factory Automation (ETFA), DOI:
10.1109/ETFA.2019.8869141, Sept, 2019.
[2] M. Aditi, S. Karpagam, B. Nandini, B. S. Murugan, “Automated Writing and
Drawing Machine,” International Journal of Engineering Research & Technology,
ISSN: 2278-0181, ETEDM - 2019 Conference Proceedings, 2019.
[3] Mr.R.Augustian Isaac, Amit Kumar Singh, Prateekshit Tamta, Gaurav Singh,
“Homework Writing Machine,” IJARIIE, Vol-4 Issue-5 2018.
[4] T. C. Wei, U. U. Sheikh and A. A. A. Rahman, "Improved optical character
recognition with deep neural network," 2018 IEEE 14th International Colloquium
on Signal Processing & Its Applications (CSPA), Batu Feringghi, 2018, pp. 245-
249, doi: 10.1109/CSPA.2018.8368720.
[5] A. M. Sabu and A. S. Das, "A Survey on various Optical Character Recognition
Techniques," 2018 Conference on Emerging Devices and Smart Systems
(ICEDSS), Tiruchengode, 2018, pp. 152-155, doi:
10.1109/ICEDSS.2018.8544323.
[6] Shani Ranjan, Mani Rani, Shweta Ranjan, Dr. Manmohan Singh, “Design and
Implementation of low-cost 2D plotter Computer Numeric Control (CNC)
Machine,” International Journal of Engineering Research & Technology, Vol. 7
Issue 05, May-2018.
[7] R. Balathangam, P. Mathipriya, R.Pavithra, G. Prithiviraj, U.Poornima, “Design
and Development of Arduino Controlled Writing Robot,” International Research
Journal of Engineering and Technology, Volume: 04 Issue: 04, Apr -2017.
[8] Q. Li, W. An, A. Zhou and L. Ma, "Recognition of Offline Handwritten Chinese
Characters Using the Tesseract Open Source OCR Engine," 2016 8th International
Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC),
Hangzhou, 2016, pp. 452-456, doi: 10.1109/IHMSC.2016.239.
[9] Kajal J.Madekar, Kranti R. Nanaware, Pooja R. Phadtare, Vikas S. Mane,
“Automatic mini CNC machine for PCB drawing and drilling,” International
Research Journal of Engineering and Technology, Volume: 03 Issue: 02, Feb-2016.
[10] D. Berchmans and S. S. Kumar, “Optical character recognition: An overview and
an insight,” 2014 International Conference on Control, Instrumentation,
Automated Writing Machine De
par
Communication and Computational Technologies (ICCICCT),
Kanyakumari, 2014, pp. 1361-1365, DOI: 10.1109/ICCICCT.2014.6993174.
[11] “The OpenCV Tutorials,” Release 2.4.13.7, December 31, 2019.
[12] Ng Wai Foong, “A Beginner’s Guide to Tesseract OCR,” Jun 3, 2019.
[13] Kenneth Reitz, “Python Guide Documentation Release 0.0.1”, 21st
December, 2018.
[14] Endurance, “The Benbox Laser Engraver as a CNC-platform for laser
engraving”, 2018.
[15] Adrian Rosebrock, ”OpenCV OCR and text recognition with Tesseract,”
17th September, 2018.
[16] Rajat Nitin Shah, “Voice Based Writing Machine,” MyGov Innovation,
August 18, 2018.
[17] George Livingston, “Optical Character Recognition in PDF Using
Tesseract Open-Source Engine,” July 25, 2018.
[18] “AxiDraw User Guide”, Evil Mad Scientist, 2016.
[19] Gloria Bueno García, Oscar Deniz Suarez, José Luis Espinosa Aranda, Jesus
Salido Tercero, Ismael Serrano Gracia, Noelia Vállez Enano, “Learning
Image Processing with OpenCV,” March 2015.
[20] “The Autopen: We've Been At It Since The Very Beginning”, Automated
Signature Technology, December 11, 2013.
[21] Jan Erik Solem, “Programming Computer Vision with Python,” 2012.
[22] Richard Szeliski, “Computer Vision: Algorithms and Applications,”
September 3, 2010.