You are on page 1of 5

Materials Today: Proceedings xxx (xxxx) xxx

Contents lists available at ScienceDirect

Materials Today: Proceedings


journal homepage: www.elsevier.com/locate/matpr

Implementation dc motor as servomotor by using arduino and optical


rotary encoder
Ali Abdyaseer Kadhum ⇑, Munther Mohammed Abdulhussein
Department of Electrical Techniques- Kufa Technical Institute, Al-Furat Al-Awsat Technical University Kufa, Najaf, Iraq

a r t i c l e i n f o a b s t r a c t

Article history: In this paper, we have implemented servo motor that can be controlled to rotate in even 360 degree using
Received 10 March 2021 normal DC motor and an optical encoder. This helps to reduce the cost required to buy a servo motor spa-
Accepted 22 March 2021 tially for heavy duty tasks. It is important to mention that the prices of servo motors increase as the rota-
Available online xxxx
tion range of the servo is wider. In addition, the prices increase as the torque of the servo motor is higher.
Therefore, using a normal DC motor with gearbox and optical encoder, will reduce the cost significantly
Keywords: because we have provided a high torque using the gearbox and also provided a 360-degree controllable
Servomotor
rotation range using the optical encoder. Arduino Uno has been chosen to provide compatible system that
DC motor
Arduino
is easy to operate and economically. This idea can be used in any application that requires servo motor
Optical rotary encoder with high torque or with wide rotation angle to reduce the specified cost and save some money.
Ó 2021 Elsevier Ltd. All rights reserved.
Selection and peer-review under responsibility of the scientific committee of the Emerging Trends in
Materials Science, Technology and Engineering. This is an open access article under the CC BY-NC-ND
license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

1. Introduction few other distinctive components making a DC motor a servo [4].


With regard to servo unit, one might find a small DC motor, intel-
There were a few applications types related to electrical motors ligent circuitry, gear arrangement and potentiometer. Further-
in which the motor’s rotation was needed for specific angle not more, the potentiometer and intelligent circuitry help rotating
continuously for long time period. With regard to such applica- the servo as needed.
tions, a few distinctive motor types were needed with certain Arduino can be defined as one of the easy-to-use microcon-
arrangements promotes the rotation of the motor to specific angle troller platforms, also, it might be utilized for developing interac-
for specific electrical input. Servomotor was a special type of motor tive applications. Actually, the information has been taken from
which was operated automatically up to specific limit for certain various input elements (switches and sensors) which were pro-
command by means of error sensing feedback for correcting the cessed in a Microcontroller and switches to equally wide range of
performance. Servomotor has more industrial applications in these output elements: lamps, motors, starters and so on. [3].
days such as remote controlling direction of motion toy cars, CD or In recent years optical coding has been used in servo systems to
DVD player, Robotics, Conveyor Belts, Camera Auto Focus, Solar obtain fast, reliable and high-precision feedback [6].
Tracking System, Antenna Positioning, Woodworking/CNC, Textiles During this paper, we will demonstrate what have been imple-
and many applications in our daily life [1,2]. mented to program the Arduino to use the DC motor as a servo
There are 3 major components in the servo system – feedback motor that can rotate up to 360 degree. we have connected an opti-
system, output sensor and controlled device [2], this is considered cal encoder to the shaft of the DC motor. This encoder sends pulses
as an automatic closed-loop control system. Here, rather than con- as the motor rotates. Therefore, we have written programs to read
trolling the device via using – variable input signals, the device was and count the pulses that coming from the encoder to be able to
controlled through a feedback signal which is developed via put- define the position of the pointer that is connected to the DC
ting to comparison the reference input signal and the output sig- motor’s shaft. The program that we have written, can control the
nal. Basically, a servo motor is considered as a DC motor, also a DC motor to sweep in 90, 180, 270 and 360 degrees.

⇑ Corresponding author.
E-mail address: kin.ali1@atu.edu.iq (A.A. Kadhum).

https://doi.org/10.1016/j.matpr.2021.03.576
2214-7853/Ó 2021 Elsevier Ltd. All rights reserved.
Selection and peer-review under responsibility of the scientific committee of the Emerging Trends in Materials Science, Technology and Engineering.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

Please cite this article as: Ali Abdyaseer Kadhum and Munther Mohammed Abdulhussein, Implementation dc motor as servomotor by using arduino and
optical rotary encoder, Materials Today: Proceedings, https://doi.org/10.1016/j.matpr.2021.03.576
Ali Abdyaseer Kadhum and Munther Mohammed Abdulhussein Materials Today: Proceedings xxx (xxxx) xxx

Fig. 1. Shows the Arduino with its I/O and power ports.

Fig. 2. Shows the mobile robot platform.

Fig. 4. Show the optical disk.

2. Objective

The purpose of this project is to convert an ordinary DC motor


which is equipped with a gearbox to a servo motor using a cheap
mechanism which could be applied on any DC motor regardless
of its size.

3. Controller (Arduino)

To send the control signal to the motor and receive the feedback
signal, an electronic controller is needed. As a result, we used UNO
Arduino controller for the above purposes.
In the recent times, the microcontroller is an integrated elec-
tronic circuit that contains an internal microprocessor and an
internal programmable memory for storage, and it is considered
one of the elements of rapid electronic development [8]. Also con-
tains gates, control commands, data input and output, and analog
Fig. 3. Show the optical encoders. digital converters (A/D), process amplifiers, voltage comparators,
2
Ali Abdyaseer Kadhum and Munther Mohammed Abdulhussein Materials Today: Proceedings xxx (xxxx) xxx

Fig. 5. Show the DC motor.


Fig. 6. Show the driver Interfacing the components and programing the
microcontroller.

Fig. 7. Shows the circuit diagram.

timers and counters, and more [5,9]. Fig. 1 is shown parts of UNO regulator; thus, damaging the board, the suggested range is
Arduino controller board. between 7 and 12 V.
An external power supply or a USB connection might be used to
power the UNO Arduino. The source of power can be automatically
4. DC motor
selected. External (non USB) power might be coming either from a
battery or AC-to-DC adapter (wall wart). In addition, the adapter
A simple DC motor equipped with a gearbox was used. This DC
might be connected through plugging 2.1 mm center-positive plug
motor is mounted on a mobile robot platform as shown in Fig. 2.
into the power jack of the board. Furthermore, leads from the bat-
tery might be inserted into the Gnd as well as Vin pin headers
related to POWER connector. Also, the board might be operating 5. Optical rotary encoder
on an external supply in range of (6 and 20) volts. In the case when
being supplied with not more than 7 V, yet, 5 V pin might be sup- The rotary encoders are tracking the motor’s shaft movement in
plying not more than 5 V and the board might be unstable. In the terms of myriad pieces of commercial devices and industrial equip-
case when utilizing over 12 V, overheat might occur in the voltage ment [7]. With regard to industrial applications, the incremental
3
Ali Abdyaseer Kadhum and Munther Mohammed Abdulhussein Materials Today: Proceedings xxx (xxxx) xxx

Fig. 8. Flowchart diagram.

encoders (utilized just in the case when relative position is A rotary encoder disk includes lines that are interrupting the
required, or cost being a problem) were generally utilized with beam. Preferably, manufacturer of encoder attempts to make the
ac induction motors. On the other hand, the absolute encoders lines extremely sharp for producing clear transitions from light
(that are providing various binary outputs at each one of the posi- to dark and dark to light on the sensor of the encoder. The optical
tions, so the shaft position was determined) were often come with disk is shown in Fig. 4.
permanent magnet brushless motors in the servo applications. There are limitations in each type of such rotary encoder disks.
Approximately, every optical encoder is working in the same The super -reinforced glass encoder disks still are glass, and might
manner. In addition, a LED (typically IR) is shining via an encoding be failing under drilling vibration and heavy shock or other hard
disk with lines interrupting light beam to photosensor. Little light implementations. The plastic encoder disks are flexing under
bounces through the reflective encoder disk from closed regions. vibration, resulting in possible errors in position measurement or
But all encoder principles remain the same as shown in Fig. 3. velocity. Furthermore, metal encoder disks might be flex, whereas

4
Ali Abdyaseer Kadhum and Munther Mohammed Abdulhussein Materials Today: Proceedings xxx (xxxx) xxx

tiny encoder disk holes might be clogged by debris or dirt. The range of the servo is wider. In addition, the prices increase as the
optical encoder with pulses detector has been utilized in the pre- torque of the servo motor is higher. Therefore, using a normal DC
sented work via mounting it on the DC motor as can be seen in motor with gearbox and optical encoder, will reduce the cost sig-
the Fig. 5. nificantly because we have provided a high torque using the gear-
box and also provided a 360-degree controllable rotation range
6. DC motor driver using the optical encoder. This idea can be used in any application
that requires servo motor with high torque or with wide rotation
Since the Arduino microcontroller does not proved high output angle to reduce the specified cost and save some money.
power, H brigh driver circuit was used to drive the DC motor this
driver is shown in Fig. 6. 10. Future work

7. Hardware design Since this work can be used in any application that requires
servo motor with high torque or with wide rotation angle to reduce
We have used DC motor with gearbox, motor driver, optical the specified cost, in the future, it can be used to implement a
encoder, UNO Arduino microcontroller, four pushbuttons and some steering wheel for mobile robot vehicle and it can be used to in
resistors. We connected an optical encoder to shaft of the geared radar system to let the radar sweeps. Also, it can be used to control
DC motor and connected the signal wires of the optical encoder the rotation of security cameras and many other applications.
to the UNO Arduino microcontroller to send the pulses signal.
The control signal comes from the microcontroller to motor driver CRediT authorship contribution statement
to control the rotation of the DC motor either in clockwise or in
counter clockwise directions. We used four pushbuttons to control Ali Abdyaseer Kadhum: Writing - original draft. Munther
the DC motor to rotate in 90, 180, 270 and 360 degrees range in Mohammed Abdulhussein: Conceptualization, Methodology,
clockwise or in anticlockwise directions. Fig. 7 is showing the cir- Visualization, Investigation, Supervision.
cuit diagram.
Declaration of Competing Interest
8. Programming tasks
The authors declare that they have no known competing finan-
Since in the hardware design, we put 4 pushbuttons to control cial interests or personal relationships that could have appeared
the sweeping angles of the DC motor, we have written a program to influence the work reported in this paper.
to check for each pushbutton, which means if the first pushbutton
is pressed, let the DC motor to sweep in 90 degree as long as the References
first pushbutton is still pressed. However, if the second pushbutton
[1] B. Pillai, K.T.Nair. Intelligent adaptive controller for DC servo motor position
is pressed, the will sweep in 180 degree. While if the third push- control in LabVIEW. In: 2017 International Conference on Intelligent
button is pressed, the DC motor will sweep in 270 degree. And at Computing, Instrumentation and Control Technologies (ICICICT). 9812013985.
last, if the fourth pushbutton is pressed, the DC motor will sweep IEEE. 2017.
[2] P. Serikitkankul, H. Seki, M. Hikizu, Y. Kamiya. The Effects of Negative Driving
in 360 degree. It is important to mention that we have put the pre- Torque in Servomotor Drivers. 2006 SICE-ICASE International Joint Conference,
vious conditions in such a way that only single pushbutton should Busan. 2006. 876-879. doi: 10.1109/SICE.2006.315412.
be pressed; therefore, if someone presses two or more pushbut- [3] P. Vîrlan. Direct and reverse start of the servomotor with LabView, 2017
International Conference on Electromechanical and Power Systems (SIELMEN),
tons, nothing will happen and the motor will not rotate.
Iasi. 2017. 364–369. doi: 10.1109/SIELMEN.2017.8123350.
We have drawn a flowchart in Fig. 8 to summarize the general [4] K.A. Abro, J.F. Gómez-Aguilar, I. Khan, K.S. Nisar, Role of modern fractional
idea of our program and make it more understandable. derivatives in an armature-controlled DC servomotor, Eur. Phys. J. Plus 134 (11)
(2019), https://doi.org/10.1140/epjp/i2019-12957-6.
[5] M.M. Abdulhussein, T.M. Sahib, A.A.A.M. Jassem, A.A. Kadhim, A smart control
9. Conclusions and discussions based on microcontroller for solar tracking system, Solid State Technol. 63 (6)
(2020) 11583–11591.
[6] G.S. Miljkovic, D.B. Denic, Redundant and flexible pseudorandom optical rotary
In this paper, it was required to implement a servo motor with encoder, Elektronika ir Elektrotechnika 26 (6) (2020) 10–16.
high torque and with a wide rotation angle. We have used DC [7] X. Li, G. Ye, H. Liu, Y. Ban, Y. Shi, L. Yin, B. Lu, A novel optical rotary encoder with
motor with gearbox, motor driver, optical encoder, UNO Arduino eccentricity self-detection ability, Rev. Sci. Instrum. 88 (11) (2017) 115005.
[8] Y.A. Badamasi. The working principle of an Arduino. In 2014 11th international
microcontroller, four pushbuttons and some resistors. We have
conference on electronics, computer and computation (ICECCO). 1–4. IEEE.
used the pushbuttons to control the rotation angle of the DC motor (2014, September).
in 90, 180, 270 and 360 degrees, which means to let the DC motor [9] D.D. Tung, N.M. Khoa, An Arduino-based system for monitoring and protecting
overvoltage and undervoltage, Eng. Technol. Appl. Sci. Res. 9 (3) (2019) 4255–
to sweep in these angles. This helps to reduce the cost required to
4260.
buy a servo motor spatially for heavy duty tasks. It is important to
mention that the prices of servo motors increase as the rotation

You might also like