Wireless Control of DC Motor.: (Type Text)
Wireless Control of DC Motor.: (Type Text)
Abstract
Motors are being used everywhere in the industry. The need for automation in this
segment in increasing day by day. Thus wireless operation is gaining importance.
Wireless speed control uses many technologies like Blue tooth, Infrared, radio
communication etc.
In this project we hereby propose you the wireless operation of DC motors Using Wi-Fi
technology. Here the speed of DC motor is controlled by controlling the PWM pulse. The
pulse is controlled using Wi-Fi. The interface which we are using to control is called
NODE MCU. This is a microcontroller which has wireless capability. This can be
effectively used for this project.
Introduction.
Wireless control is gaining importance. May it be motor or any other applications.
The speed and direction control of DC motor is very important for various kinds of uses.
Through all these years, there have been various attempts in finding different efficient
solutions for the speed and direction control of the DC motor. History will recognize the vital
role played by DC motors in the development of industrial power transmission systems. The
DC machine was the first practical device to convert electrical power into mechanical power,
and vice-versa in its generator form. Inherently straight forward operating characteristics,
flexible performance and high efficiency encouraged the widespread use of DC motors
in many types of industrial drive applications. DC motors have been long been the primary
means of Electrical traction. DC motor is considered as a SISO system having torque/speed
characteristics compatible with most mechanical loads. Hence, DC motors are always a good
ground for advanced theories because the theory is extendable to other types of motors.
Wireless communication is the transfer of information between two or more points that are
not physically connected. Distances can be short, such as a few meters for television remote
control, or as far as thousands or even millions of kilometers. Among the various wireless
technologies like IR (Infra Red), Bluetooth and WLAN, we have chosen WLAN technology,
the main reason being it has a very long range of 3 KHz-5GHZ. It is also not affected by any
obstructions. Commercial applications for wireless are door announcers, security and access
systems, gate control, remote activation, score board and paging systems.
In this project we will be controlling the motor wirelessly. The interface used is called
NODE MCU. Node MCU is microcontroller having wireless connectivity capability over
Wi-Fi.
Methodology.
In the first place we will be programming the NODE MCU so as to receive inputs
from the mobile phones via Wi-Fi. The NODE MCU generates the hotspot. This hotspot
can be accessed by a mobile or a computer with Wi-Ficapability. Next the NODE MCU also
acts as an interface for the driver module. Driver module receives inputs from NODE MCU
to control speed and direction of DC motor connected. The actual operation of motor can be
viewed on mobile display.
Block Diagram
RPM sensor.
NODE MCU
ESP8266 Module
Components
The main components of the projects include
1. NODE MCU
NodeMCU is an open-source firmware and development kit that helps
you to prototype or build IoT product. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on
the ESP-12 module. The firmware uses the Lua scripting language. It is based
on the eLua project, and built on the Espressif Non-OS SDK for ESP8266.
Hardware typically used is a circuit board functioning as a dual in-line
package (DIP) which integrates a USB controller with a smaller surface-mounted
board containing the MCU and antenna. The choice of the DIP format allows for easy
prototyping on breadboards. The design was initially was based on the ESP-12
module of the ESP8266, which is a Wi-Fi SoC integrated with a Tensilica Xtensa
LX106 core, widely used in IoT applications
The ESP8266 chip requires 3.3V power supply voltage. It should not be powered
with 5 volts like other arduino boards.
NodeMCU ESP-12E dev board can be connected to 5Vusing micro USB connector
or Vin pin available on board.
The I/O pins of ESP8266 communicate or input/output max 3.3V only. i.e. the pins
are NOT 5V tolerant input.
Pinouts
Below table gives NodeMCU Dev Kit IO pins and ESP8266 internal GPIO pins mappin
Features
Finally, programable WiFi module.
Arduino-like (software defined) hardware IO.
Can be programmed with the simple and powerful Lua programming language or
Arduino IDE.
USB-TTL included, plug & play.
10 GPIOs D0-D10, PWM functionality, IIC and SPI communication, 1-Wire and
ADC A0 etc. all in one board.
Wifi networking (can be used as access point and/or station, host a web server),
connect to internet to fetch or upload data.
Event-driven API for network applications.
PCB antenna.
2. Sensors.
Sensors are sophisticated devices that are frequently used to detect and respond to
electrical or optical signals. A Sensor converts the physical parameter (for example:
temperature, blood pressure, humidity, speed, etc.) into a signal which can be measured
electrically. Let’s explain the example of temperature. The mercury in the glass
thermometer expands and contracts the liquid to convert the measured temperature which
can be read by a viewer on the calibrated glass tube.
7. Repeatability – The reading that varies is repeatedly measured under the same
environment
Classification of Sensors
The sensors are classified into the following criteria:
1. Primary Input quantity (Measurand)
2. Transduction principles (Using physical and chemical effects)
3. Material and Technology
4. Property
5. Application
This device emits and/or detects infrared radiation to sense a particular phase in the
environment. Generally, thermal radiation is emitted by all the objects in the infrared
spectrum. The infrared sensor detects this type of radiation which is not visible to human eye.
A Typical IR sensor is shown below.
Working
The basic idea is to make use of IR LEDs to send the infrared waves to the object. Another
IR diode of the same type is to be used to detect the reflected wave from the object. The
diagram is shown below.
When IR receiver is subjected to infrared light, a voltage difference is produced across the
leads. Less voltage which is produced can be hardly detected and hence operational
amplifiers (Op-amps) are used to detect the low voltages accurately.
Measuring the distance of the object from the receiver sensor: The electrical property of IR
sensor components can be used to measure the distance of an object. The fact when IR
receiver is subjected to light, a potential difference is produced across the leads.
3. L-298 driver.
The L298 Driver is a high voltage, high current dual ful bridge driver designed to
accept standard TTL logic levels and drive inductive loads such relays, solenoids, DC
and stepping motors. Two enable inputs are provided to enable or disable the device
independently of the input signals. The emitters of the lower transistors of each bridge
are connected together the corresponding external terminal can be used for the
connection of an external sensing resistor.
FEATURES
Operating supply voltage up to 46 V
Total DC current up to 4 A
Low saturation voltage
Two motor direction indicator LEDs
Logical "0" input voltage upto1.5 V (HIGH NOISE IMMUNITY)
Over temperature protection.
Schottky EMF-protection diodes
An onboard user-accessible 5V low-dropout regulator
]
This driver is used to control speed of DC motor. The driver receives the inputs from
NODE MCU.
SPECIFICATIONS
Operating Voltage - Up to 46v
DC Current - 4A
Pin Details
4. DC motor.
A DC motor is an electric motor that runs on direct current power. In any electric motor,
operation is dependent upon simple electromagnetism. A current carrying conductor
generates a magnetic field, when this is then placed in an external magnetic field, it will
encounter a force proportional to the current in the conductor and to the strength of the
external magnetic field.It is a device which converts electrical energy to mechanical energy.
It works on the fact that a current carrying conductor placed in a magnetic field experiences a
force which causes it to rotate with respect to its original position.
Practical DC Motor consists of field windings to provide the magnetic flux and armature
which acts as the conductor.
DC motor basically consist two main parts. The rotating part is called the rotor and the
stationary part is also called the stator. The rotor rotates with respect to the stator.
[Type text] Page 13
Wireless Control of DC motor.
The rotor consists of windings, the windings being electrically associated with the
commutator. The geometry of the brushes, commutator contacts and rotor windings are such
that when power is applied, the polarities of the energized winding and the stator magnets are
misaligned and the rotor will turn until it is very nearly straightened with the stator’s field
magnets.
As the rotor reaches alignment, the brushes move to the next commutator contacts and
energize the next winding. The rotation reverses the direction of current through the rotor
winding, prompting a flip of the rotor’s magnetic field, driving it to keep rotating.
Working
Circuit Diagram
The circuit operated and controlled by a NODE MCU. This Wi-Fi capable unit is connected
with the driver unit. By enabling the pins of the driver the motors are controlled. The driver
[Type text] Page 16
Wireless Control of DC motor.
is used to control the speed and direction of the motor. The driver has total of 6 pin for
controlling. Set of 3 pins for one motor and other set for another motor.
The speed of the motor is controlled by a method called Pulse width modulation. So the
rotational speed of a DC motor depends upon the interaction between two magnetic fields,
one set up by the stator’s stationary permanent magnets and the other by the armatures
rotating electromagnets and by controlling this interaction we can control the speed of
rotation.
The magnetic field produced by the stator’s permanent magnets is fixed and therefore can not
be changed but if we change the strength of the armatures electromagnetic field by
controlling the current flowing through the windings more or less magnetic flux will be
produced resulting in a stronger or weaker interaction and therefore a faster or slower speed.
Then the rotational speed of a DC motor (N) is proportional to the back emf (Vb) of the
motor divided by the magnetic flux (which for a permanent magnet is a constant) times an
electromechanical constant depending upon the nature of the armatures windings (Ke) giving
us the equation of: N ∝ V/KeΦ. So how do we control the flow of current through the motor.
Well many people attempt to control the speed of a DC motor using a large variable resistor
(Rheostat) in series with the motor as shown.
While this may work, as it does with Scalextric slot car racing, it generates a lot of heat and
wasted power in the resistance. One simple and easy way to control the speed of a motor is to
regulate the amount of voltage across its terminals and this can be achieved using “Pulse
Width Modulation” or PWM. As its name suggests, pulse width modulation speed control
works by driving the motor with a series of “ON-OFF” pulses and varying the duty cycle, the
fraction of time that the output voltage is “ON” compared to when it is “OFF”, of the pulses
while keeping the frequency constant.
The power applied to the motor can be controlled by varying the width of these applied
pulses and thereby varying the average DC voltage applied to the motors terminals. By
changing or modulating the timing of these pulses the speed of the motor can be controlled,
ie, the longer the pulse is “ON”, the faster the motor will rotate and likewise, the shorter the
pulse is “ON” the slower the motor will rotate.
In other words, the wider the pulse width, the more average voltage applied to the motor
terminals, the stronger the magnetic flux inside the armature windings and the faster the
motor will rotate and this is shown below.
PWM, or pulse width modulation is a technique which allows us to adjust the average value
of the voltage that’s going to the electronic device by turning on and off the power at a fast
rate. The average voltage depends on the duty cycle, or the amount of time the signal is ON
versus the amount of time the signal is OFF in a single period of time.
So depending on the size of the motor, we can simply connect an Arduino PWM output to
the base of transistor or the gate of a MOSFET and control the speed of the motor by
controlling the PWM output. The low power Arduino PWM signal switches on and off the
gate at the MOSFET through which the high power motor is driven.
On the other hand, for controlling the rotation direction, we just need to inverse the direction
of the current flow through the motor, and the most common method of doing that is by using
an H-Bridge. An H-Bridge circuit contains four switching elements, transistors or MOSFETs,
with the motor at the center forming an H-like configuration. By activating two particular
switches at the same time we can change the direction of the current flow, thus change the
rotation direction of the motor.
So if we combine these two methods, the PWM and the H-Bridge, we can have a complete
control over the DC motor. There are many DC motor drivers that have these features and the
L298N is one of them.
The module have an onboard 5V regulator which is either enabled or disabled using a
jumper. If the motor supply voltage is up to 12V we can enable the 5V regulator and the 5V
pin can be used as output, for example for powering our Arduino board. But if the motor
voltage is greater than 12V we must disconnected.
The Enable A and Enable B pins are used for enabling and controlling the speed of the
motor. If the pin is enabled then , the motor will run at maximum speed. These pins also act
as PWM inputs for the driver. Next, the Input 1 and Input 2 pins are used for controlling the
rotation direction of the motor A, and the inputs 3 and 4 for the motor B. Using these pins we
actually control the switches of the H-Bridge inside the L298N IC. If input 1 is LOW and
input 2 is HIGH the motor will move forward, and vice versa, if input 1 is HIGH and input 2
is LOW the motor will move backward. In case both inputs are same, either LOW or HIGH
the motor will stop. The same applies for the inputs 3 and 4 and the motor B.
To control these pins via NODE MCU we need to define the pins of NODE MCU in the
program. The programming is done is Embedded C language.
The additional feature of the project being the display of speed of each motor on the mobile
screens. This is done by using a IR sensor. An infrared sensor is an electronic instrument
which is used to sense certain characteristics of its surroundings by either emitting and/or
detecting infrared radiation. Infrared sensors are also capable of measuring the heat being
emitted by an object and detecting motion.
The wavelength region which ranges from 0.75 to 3µm is known as the near infrared regions.
The region between 3 and 6µm is known as the mid-infrared and infrared radiation which has
a wavelength greater higher than 6µm is known as far infrared.
An IR sensor consists of an IR LED and an IR Photodiode; together they are called as Photo–
Coupler or Opto–Coupler. As said before,the Infrared Obstacle Sensor has builtin IR
transmitter and IR receiver.Infrared Transmitter is a light emitting diode (LED) which emits
infrared radiations. Hence, they are called IR LED’s. Even though an IR LED looks like a
normal LED, the radiation emitted by it is invisible to the human eye. Infrared receivers are
also called as infrared sensors as they detect the radiation from an IR transmitter. IR receivers
come in the form of photodiodes and phototransistors. Infrared Photodiodes are different
from normal photo diodes as they detect only infrared radiation. When the IR transmitter
emits radiation, it reaches the object and some of the radiation reflects back to the IR
receiver. Based on the intensity of the reception by the IR receiver, the output of the sensor is
defined.
Features
1. Operating Voltage: 3.0V – 5.0V
2. Detection range: 2cm – 30cm (Adjustable using potentiometer)
3. Current Consumption:at 3.3V : ~23 mA,at 5.0V: ~43 mA
4. Active output level: Outputs Low logic level when obstacle is detected
5. On board Obstacle Detection LED indicator
Program
1. #include <ESP8266WiFi.h>
2. const char WiFiPassword[] = "12345678";
3. const char AP_NameChar[] = "Ready to connect" ;
4. WiFiServer server(80);
53. }
63. }
64. }
65. prevstate = currentstate; // store this scan (prev scan) data for next scan
74. }
75. }
76. prevstate1 = currentstate1; // store this scan (prev scan) data for next scan
85. dir1=1;
86. }
92. dir1=0;
93. }
99. }
104. dir2=1;
105. }
145. client.flush();
154. delay(5);
161. if(dir1==1){
162. client.println("<br/>Motor rotating in FORWARD direction<br/>" );
163. }
164. else{
165. client.println("Motor rotating in BACKWARD direction<br/><br/>" );
166. }
167. client.println("Motor-2 Details<br/>" );
168. client.println("RPM = " );
169. client.println(rpm1);
170. if(dir2==1){
171. client.println("<br/>Motor rotating in FORWARD direction<br/>" );
172. }
173. else{
174. client.println("Motor rotating in BACKWARD direction<br/>" );
175. }
176. client.println("</html>");
177. delay(1);
178. Serial.println("Client disonnected");
179. Serial.println("");
180. }
181. }
Advantages
Disadvantages.
Future scope