You are on page 1of 41

ARDUINO BASED TACHOMETER WITH

SPEED CONTROL
A SEMINAR REPORT

SUBMITTED BY

PRAKHAR PANDEY

In partial fulfilment for the award of the degree


Of
Bachelor of Engineering
IN
ELECTRICAL AND ELECTRONIC ENGINEERING

AT
PS Institute OF Technology and Science
Department of EN
Kanpur
April/2017
CERTIFICATE

We hereby certify that the work which is being presented in the


B.Tech. Major Project Report entitled Arduino Based Tachometer
With Speed Control, in partial fulfilment of the requirements for
the award of the Bachelor of Technology in Electrical & Electronics
Engineering and submitted to the Department of Electrical &
Electronics Engineering of PSIT- Kanpur UP is an authentic record of
my own work carried out during the Academic year 2016-17

The matter presented in this Report has not been submitted by


us for the award of any other degree elsewhere.

Prakhar Pandey
Group Leader
Group-14

This is to certify that the above statement made by the


candidate is correct to the best of my knowledge.

Signature of Supervisor(s)

Date: Sawan Kr. Sharma

Project
Supervisor(s

Dr. Anshuman Tyagi


Head
Electrical & Electronics Engineering Department

(I)
ACKNOWLEDGEMENT
It is my privilege to express our sincerest regards to our project guide, Mr.
Naimuddin, for their valuable inputs, able guidance, encouragement, whole-hearted
cooperation and constructive criticism throughout the duration of our project. We deeply
express our sincere thanks to our Head of Department Dr. Anshuman Tyagi for encouraging
and allowing us to present the project on the topic ARDUINO BASED TACHOMETER
WITH SPEED CONTROL at our department premises for the partial fulfillment of the
requirements leading to the award of B-Tech degree. We take this opportunity to thank all our
lecturers who have directly or indirectly helped our project. We pay our respects and love to
our parents and all other family members and friends for their love and encouragement
through out our career. Last but not the least we express our thanks to our friends for their
cooperation and support.

(II)
ABSTRACT
Tachometer is a device that measures the rotational speed of any shaft or disc. The
unit of the measurement is usually revolutions per minute or RPM. The traditional method of
measuring RPM of a rotating shaft was based on velocity feedback concept where a dc
generator is hooked to the rotating shaft so that the voltage induced across the generators
terminals is proportional to the speed of the shaft. Today, we are going to make a digital
tachometer based on a PIC microcontroller that requires no physical contact with the rotating
shaft to measure its rotational speed. The physical contact is avoided by using an optical
detection technique that requires an infrared light emitting diode in conjunction with a photo
detecting diode. StartUSB for PIC from mikroElektronika is the main controller board used in
this project. To read more about this board, visit my article Getting started with PIC18F
Microcontrollers. This tachometer can measure speeds up to 99960 RPM with the resolution
of 60 RPM. The result is shown on a 162 character LCD display.
Tachometer is a measuring instrument used for measuring the speed of a rotating
body. The unit of measured speed by tachometer is expressed in revolution per minute or
RPM. Tachometers were purely mechanical in past. In that time, the speed measuring
parameters were sent to the tachometer through mechanical coupling (cable or shaft) and the
rpm is measured using a gear mechanism and it is identified using needle mechanism. The
tachometers have changed a lot due to rapid development of modern electronics. This article
is for a contactless digital tachometer using Arduino. Here the speed of the motor is also
controlled. The RPM, the duty cycle and other information are displayed on a LCD screen.
The electric drive systems used in industrial applications are increasingly required to
meet higher performance and reliability requirements. The DC motor is an attractive piece of
equipment in many industrial applications requiring variable speed and load characteristics
due to its ease of controllability. Microcontrollers provide a suitable means of meeting these
needs. Certainty, part of the recent activity on microcontrollers can be ascribed to their
newness and challenge. In this paper, implementation of the MC68HC11E9 microcontroller
for speed control of DC motor fed by a DC chopper has been investigated. The chopper is
driven by a high frequency PWM signal. Controlling the PWM duty cycle is equivalent to
controlling the motor terminal voltage, which in turn adjusts directly the motor speed.
Experimental results have been obtained that show the employment of microcontroller for
speed control and over current protection of a DC motor.

(III)
TABLE OF CONTENTS
Chapter No. Title Page No.
Certificate I
Acknowledgment II
Abstract III
1. Introduction -01
2. Literature Overview -04
2.1 Arduino UNO -04
2.1.1 Overview -04
2.1.2 Summary -06
2.1.3 Schematic & Design -06
2.1.4 Power -07
2.1.5 Input & Output -08
2.1.6 Communication -09
2.1.7 Reset -10
2.1.8Overcurrent Protection-11
2.1.9 Phy. Characteristics -11
2.2 USB 2.0 Cable -11
2.3 IR Sensor -12
2.4 PCB -12
2.5 9v Battery -14
2.6 9v Battery Clip -14
2.7 DC Motor -15
2.8 Capacitor -16
2.9 Rectifier Diode -17
2.10 NPN Transistor -18
2.11 Resistor -20
2.12 LCD Module -20
2.13 POT -21
2.14 Jumper Wires -22
3. Working mechanism -23
3.1 Working -23
3.1.1 RPM of motor -27
3.1.2 Counting the RPM -27
3.1.3 Speed control of motor-27
3.1.4 Programming -28
4. Application & Scope -31
4.1 Advantages -31
4.2 Application -31
4.3 Scope -31
5. References -32
CHAPTER 1
INTRODUCTION
A tachometer (revolution-counter, tach, rev-counter, RPM gauge) is an instrument
measuring the rotation speed of a shaft or disk, as in a motor or other machine. [1] The device
usually displays the revolutions per minute (RPM) on a calibrated analogue dial, but digital
displays are increasingly common. The word comes from Greek (tachos "speed")
and metron ("measure"). Essentially the words tachometer and speedometer have identical
meaning: a device that measures speed. It is by arbitrary convention that in the automotive
world one is used for engine and the other for vehicle speed. In formal engineering
nomenclature, more precise terms are used to distinguish the tachometers or revolution
counters on cars, aircraft, and other vehicles show the rate of rotation of the
engine's crankshaft, and typically have markings indicating a safe range of rotation speeds.
This can assist the driver in selecting appropriate throttle and gear settings for the driving
conditions.

Prolonged use at high speeds may cause inadequate lubrication, overheating


(exceeding capability of the cooling system), exceeding speed capability of sub-parts of the
engine (for example spring retracted valves) thus causing excessive wear or permanent
damage or failure of engines. This is more applicable to manual transmissions than to
automatics. On analogue tachometers, speeds above maximum safe operating speed are
typically indicated by an area of the gauge marked in red, giving rise to the expression of
"redlining" an engine revving the engine up to the maximum safe limit. The red zone is
superfluous on most modern[specify] cars, since their engines typically have a revolution
limiter which electronically limits engine speed to prevent damage. Diesel engines with
traditional mechanical injector systems have an integral governor which prevents over-
speeding the engine, so the tachometers in vehicles and machinery fitted with such engines
sometimes lack a redline.

In vehicles such as tractors and trucks, the tachometer often has other markings,
usually a green arc showing the speed range in which the engine produces maximum torque,
which is of prime interest to operators of such vehicles. Tractors fitted with a power take
off (PTO) system have tachometers showing the engine speed needed to rotate the PTO at the
standardized speed required by most PTO-driven implements. In many countries, tractors are
required to have a speedometer for use on a road. To save fitting a second dial, the vehicle's
tachometer is often marked with a second scale in units of speed. This scale is only accurate
in a certain gear, but since many tractors only have one gear that is practical for use on-road,
this is sufficient. Tractors with multiple 'road gears' often have tachometers with more than
one speed scale. Aircraft tachometers have a green arc showing the engine's designed cruising
speed range.

In older vehicles, the tachometer is driven by the RMS voltage waves from the low
tension (LT) side of the ignition coil,[2] while on others (and nearly all diesel engines, which
have no ignition system) engine speed is determined by the frequency from
the alternator tachometer output. This is from a special connection called an "AC tap" which
is a connection to one of the stator's coil output, before the rectifier. Tachometers driven by a
rotating cable from a drive unit fitted to the engine (usually on the camshaft) exist - usually
on simple diesel-engined machinery with basic or no electrical systems.

(1)

On recent EMS found on modern vehicles, the signal for the tachometer is usually
generated from an ECU which derives the information from either the crankshaft
or camshaft speed sensor

Fig 1.1 circuit diagram for tachometer

Tachometer is a device that measures the rotational speed of any shaft or disc. The
unit of the measurement is usually revolutions per minute or RPM. The traditional method of
measuring RPM of a rotating shaft was based on velocity feedback concept where a dc
generator is hooked to the rotating shaft so that the voltage induced across the generators
terminals is proportional to the speed of the shaft. Today, we are going to make a digital
tachometer based on a PIC microcontroller that requires no physical contact with the rotating
shaft to measure its rotational speed. The physical contact is avoided by using an optical
detection technique that requires an infrared light emitting diode in conjunction with a photo
detecting diode. StartUSB for PIC from mikroElektronika is the main controller board used in
this project. To read more about this board, visit my article Getting started with ARDUINO.
This tachometer can measure speeds up to 99960 RPM with the resolution of 60 RPM. The
result is shown on a 162 character LCD display.

(2)

Tachometer is an essential instrument in this modern era of industrialization. In


industry it is necessary to control the speed of motor at a definite RPM and for this counting
of RPM is essential. Tachometer is an instrument used for measuring the number of
revolution of an object in a given interval of time. Usually it is expressed in revolution per
minute or RPM. Earlier tachometers are purely mechanical where the revolution is
transferred to the tachometer through mechanical coupling (cable or shaft), the rpm is
determined using a gear mechanism m and it is displayed on a dial. With the advent of
modern electronics, the tachometers have changed a lot. This project is about a contactless
digital tachometer using Arduino. The speed of the motor can also be controlled with the
circuit.
(3)
CHAPTER 2
LITERATURE OVERVIEW

System design:
Design of the system consist two parts:
a) Hardware Part
a. USB Printer Cable for Arduino [x1]
b. Solderless Breadboard [x1]
c. 9V Battery [x1]
d. 9V Battery Clip for Arduino [x1]
e. DC Motor (4.5 VDC) + 0.1uF Capacitor [x1]
f. Rectifier Diode (1N4148) [x1]
g. npn Transistor (P2N2222A) [x1]
h. Resistance (220 Ohm) [Red-Red-Brown] [x1]
i. Character LCD Module (16*2) [x1]
j. Potentiometer (10 kOhm) [x2]
k. Jumper Wires
b) Software Part
a. Arduino IDE

2.1 Arduino UNO


2.1.1 Overview
The Arduino Uno is a microcontroller board based on the ATmega328 (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 or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter. Revision 2 of the Uno board has a resistor pulling
the 8U2 HWB line to ground, making it easier to put into DFU mode. Revision 3 of the board
has the following new features:
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other
new pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the
voltage provided from the board. In future, shields will be compatible both with the board
that use the AVR, which operate with 5V and with the Arduino Due that operate with 3.3V.
The second one is a not connected pin, that is reserved for future purposes.

(4)

Fig 2.1 Arduino UNO

Stronger RESET circuit.


Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino
1.0. The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The
Uno is the latest in a series of USB Arduino boards, and the reference model for the Arduino
platform; for a comparison with previous versions, see the index of Arduino boards.
Arduino/Genuino 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 quartz crystal, 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 or power it with a AC-to-DC adapter or battery to get started.

(5)
2.1.2 Summary

Fig 2.2 Arduino different parts

Microcontroller- ATmega328
Operating Voltage-5V
Input Voltage (recommended)-7-12V
Input Voltage (limits)-6-20V
Digital I/O Pins-14 (of which 6 provide PWM output)
Analog Input Pins-6
DC Current per I/O Pin-40 mA
DC Current for 3.3V Pin-50 mA
Flash Memory-32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM-2 KB (ATmega328)
EEPROM-1 KB (ATmega328)
Clock Speed-16 MHz
2.1.3 Schematic & Reference Design
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle 6.0
and newer)
Schematic: arduino-uno-Rev3-schematic.pdf

(6)
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use an
ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration
is identical on all three processors.
2.1.4 Power
The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or
battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the
board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of
the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than
7V, however, the 5V pin may supply less than five volts and the board may be unstable. If
using more than 12V, the voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.
Fig 2.3 Arduino UNO power pins

The power pins are as follows:

(7)
VIN. The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it through
this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
GND. Ground pins.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).
2.1.5 Input and Output
Each of the 14 digital pins on the Uno can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can
provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by
default) of 20-50 kOhms. In addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL
Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on
a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function
for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of
resolution (i.e. 1024 different values). By default they measure from ground to 5 volts,
though is it possible to change the upper end of their range using the AREF pin and the
analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the
Wire library.
(8)

There are a couple of other pins on the board:


AREF. Reference voltage for the analog inputs. Used with analogReference()
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset
button to shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the
Atmega8, 168, and 328 is identical.
2.1.6 Communication
The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on
the board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the Arduino
board. The RX and TX LEDs on the board will flash when data is being transmitted via the
USB-to-serial chip and USB connection to the computer (but not for serial communication on
pins 0 and 1).A SoftwareSerial library allows for serial communication on any of the Uno's
digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus; see the documentation for
details. For SPI communication, use the SPI library.

Fig 2.4 Arduino communication & programming


(9)
2.1.7 Programming
The Arduino Uno can be programmed with the Arduino software (download). Select
"Arduino Uno from the Tools > Board menu (according to the microcontroller on your
board). For details, see the reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows
you to upload new code to it without the use of an external hardware programmer. It
communicates using the original STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP
(In-Circuit Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is
available . The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated
by:
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to
ground, making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and
Linux) to load a new firmware. Or you can use the ISP header with an external programmer
(overwriting the DFU bootloader). See this user-contributed tutorial for more information.
2.1.8 Automatic (Software) Reset
Rather than requiring a physical press of the reset button before an upload, the
Arduino Uno is designed in a way that allows it to be reset by software running on a
connected computer. One of the hardware flow control lines (DTR) of the ATmega8U2/16U2
is connected to the reset line of the ATmega328 via a 100 nanofarad capacitor. When this line
is asserted (taken low), the reset line drops long enough to reset the chip. The Arduino
software uses this capability to allow you to upload code by simply pressing the upload
button in the Arduino environment. This means that the bootloader can have a shorter
timeout, as the lowering of DTR can be well-coordinated with the start of the upload.
This setup has other implications. When the Uno is connected to either a computer
running Mac OS X or Linux, it resets each time a connection is made to it from software (via
USB). For the following half-second or so, the bootloader is running on the Uno. While it is
programmed to ignore malformed data (i.e. anything besides an upload of new code), it will
intercept the first few bytes of data sent to the board after a connection is opened. If a sketch
running on the board receives one-time configuration or other data when it first starts, make
sure that the software with which it communicates waits a second after opening the
connection and before sending this data.
The Uno contains a trace that can be cut to disable the auto-reset. The pads on either
side of the trace can be soldered together to re-enable it. It's labeled "RESET-EN". You may
also be able to disable the auto-reset by connecting a 110 ohm resistor from 5V to the reset
line; see this forum thread for details.
(10)

2.1.9 USB Overcurrent Protection


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports
from shorts and overcurrent. Although most computers provide their own internal protection,
the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB
port, the fuse will automatically break the connection until the short or overload is removed.
2.1.10 Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively,
with the USB connector and power jack extending beyond the former dimension. Four screw
holes allow the board to be attached to a surface or case. Note that the distance between
digital pins 7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the
other pins.

2.2 USB 2.0 Cable for Arduino :


USB Cable A to B - 6 Foot. Description: This is a standard issue USB 2.0 cable. This
is the most common A to B Male/Male type peripheral cable, the kind that's usually used for
printers. Compatible with most SFE designed USB boards as well as USB Arduino boards
like the Uno.

Fig 2.5 Arduino cable

(11)
2.3 Infra-red sensor (IR sensor)
This sensor can be used for most indoor applications where no important ambient light is
present. For simplicity, this sensor doesn't provide ambient light immunity, but a more
complicated, ambient light ignoring sensor should be discussed in a coming article.
However, this sensor can be used to measure the speed of object moving at a very high
speed, like in industry or in tachometers. In such applications, ambient light ignoring sensor,
which rely on sending 40 kHz pulsed signals cannot be used because there are time gaps
between the pulses where the sensor is 'blind'...
The solution proposed doesn't contain any special components, like photo-diodes,
photo-transistors, or IR receiver ICs, only a couple if IR-LEDs, an Op amp, a transistor and a
couple of resistors. In need, as the title says, a standard IR led is used for the purpose of
detection. Due to that fact, the circuit is extremely simple, and any novice electronics
hobbyist can easily understand and build it.
Figure 2.6: An infra red sensor

2.4 Solderless Breadboard:


A PCB is a non-conducting board upon which there are conducting strips. The
components of your circuit are then connected to these conducting strips. The connections
can be made using solder or wire-wrap. The problem is that these two types of connections
are rather permanent. If you make a mistake in your initial circuit, it is difficult to "undo"
what you've done. As a result, these methods are inconvenient for prototyping circuits.

To build prototype circuits, we'll use a special device known as a solderless


breadboard. We often refer to such breadboards as proto-boards.Figure is a top down view of
a standard proto-board. The protoboard consists of a set of holes that are just the right size for
accepting the leads of electrical devices. (such as a resistor lead). The holes in the proto-board
are electrically connected in a systematic manner so you can easily build electrical circuits by
simply inserting the leads of your circuit components into the protoboard's holes.

(12)

The proto-board's holes are electrically connected in a systematic manner. A long row
of holes on the top (bottom) of the board are electrically connected. These rows are usually
connected to the power supply and ground and we refer to them as power buses.

In the middle of the board, you'll find two columns of holes stacked on top of each
other. These columns are also electrically connected. We usually insert components into these
holes. In figure 11, we've circled the electrically connected groups of holes on the proto-
board.
Figure 2.7: Solderless Breadboard

The nice thing about a proto-board is that you can easily build circuits by inserting
one end of a device's lead into one hole and then inserting another component's lead into one
of the electrically connected holes. This means that it is easy and fast to build circuits.

It is important, however, that one is NEAT in building prototype circuits. Being neat
means that wires of appropriate lengths are used and that wires and components lie flat
against the proto-board (if possible). It is highly recommended that your wires and
components run in vertical and horizontal directions. Neat breadboards are important for
more than aesthetic reasons. Careful wiring makes it easier to debug your circuits when they
don't work. It also prevents accidental shorting of components and excessive parasitic effects
that can greatly degrade the performance of your circuit.

(13)

2.5 9V Battery

The nine-volt battery, or 9-volt battery, in its most common form was introduced for
the early transistor radios. It has a rectangular prism shape with rounded edges and a
polarized snap connector at the top. This type is commonly used in walkie
talkies, clocks and smoke detectors.
Fig 2.8 9v Battery

The nine-volt battery format is commonly available in primary carbon-zinc and


alkaline chemistry, in primary lithium iron disulphide, and in rechargeable form in nickel-
cadmium, nickel-metal hydride and lithium-ion. Mercury-oxide batteries of this format, once
common, have not been manufactured in many years due to their mercury
content. Designations for this format include NEDA 1604 and IEC 6F22 (for zinc-carbon)
or MN1604 6LR61](for alkaline). The size, regardless of chemistry, is commonly
designated PP3 - a designation originally reserved solely for carbon-zinc [2] - or in some
countries, E or E-block.

Most nine-volt alkaline batteries are constructed of six individual 1.5V LR61 cells
enclosed in a wrapper.[4] These cells are slightly smaller than LR8D425 AAAA cells and can
be used in their place for some devices, even though they are 3.5 mm shorter. Carbon-zinc
types are made with six flat cells in a stack, enclosed in a moisture-resistant wrapper to
prevent drying. Primary lithium types are made with 3 cells in series.[5]

In 2007, 9-volt batteries accounted for 4% of alkaline primary battery sales in the US.
In Switzerland in 2008, 9-volt batteries totalled 2% of primary battery sales and 2% of
secondary battery sales.

Other nine-volt batteries of different sizes exist, such as the British "Ever Ready" PP
series and certain lantern batteries.

2.6 9V Battery Clip for Arduino


The battery has both terminals in a snap connector on one end. The smaller circular
(male) terminal is positive, and the larger hexagonal or octagonal (female) terminal is the
negative contact. The connectors on the battery are the same as on the connector itself; the
smaller one connects to the larger one and vice versa. The same snap-style connector is used
on other battery types in the Power Pack (PP) series. Battery polarization is normally obvious
since mechanical connection is usually only possible in one configuration.

(14)
Fig 2.9 9V Battery clip

A problem with this style of connector is that it is very easy to connect two batteries
together in a short circuit, which quickly discharges both batteries, generating heat and
possibly a fire. Because of this hazard, 9-volt batteries should be kept in the original
packaging until they are going to be used. An advantage is that several nine-volt batteries can
be connected to each other in series to provide higher voltages.
2.7 DC Motor (4.5 VDC)

A DC motor is any of a class of rotary electrical machines that converts direct current
electrical energy into mechanical energy. The most common types rely on the forces
produced by magnetic fields. Nearly all types of DC motors have some internal mechanism,
either electromechanical or electronic, to periodically change the direction of current flow in
part of the motor.

Fig 2.10 DC motor


(15)

DC motors were the first type widely used, since they could be powered from existing
direct-current lighting power distribution systems. A DC motor's speed can be controlled over
a wide range, using either a variable supply voltage or by changing the strength of current in
its field windings. Small DC motors are used in tools, toys, and appliances. The universal
motor can operate on direct current but is a lightweight motor used for portable power tools
and appliances. Larger DC motors are used in propulsion of electric vehicles, elevator and
hoists, or in drives for steel rolling mills. The advent of power electronics has made
replacement of DC motors with AC motors possible in many applications

2.8 Capacitor

A capacitor is a passive two-terminal electrical component that stores


electrical energy in an electric field. The effect of a capacitor is known as capacitance. While
capacitance exists between any two electrical conductors of a circuit in sufficiently close
proximity, a capacitor is specifically designed to provide and enhance this effect for a variety
of practical applications by consideration of size, shape, and positioning of closely spaced
conductors, and the intervening dielectric material. A capacitor was therefore historically first
known as an electric condenser.

The physical form and construction of practical capacitors vary widely and
many capacitor types are in common use. Most capacitors contain at least two electrical
conductors often in the form of metallic plates or surfaces separated by a dielectric medium.
A conductor may be a foil, thin film, sintered bead of metal, or an electrolyte. The
nonconducting dielectric acts to increase the capacitor's charge capacity. Materials commonly
used as dielectrics include glass, ceramic, plastic film, paper, mica, and oxide layers.
Capacitors are widely used as parts of electrical circuits in many common electrical devices.
Unlike a resistor, an ideal capacitor does not dissipate energy.

Fig 2.11 Capacitor

When two conductors experience a potential difference, for example, when a


capacitor is attached across a battery, an electric field develops across the dielectric, causing a
net positive charge to collect on one plate and net negative charge to collect on the other
plate. No current actually flows through the dielectric, instead, the effect is a displacement of
charges through the source circuit. If the condition is maintained sufficiently long,
this displacement current through the battery ceases. However, if a time-varying voltage is
applied across the leads of the capacitor, the source experiences an ongoing current due to the
charging and discharging cycles of the capacitor.

(16)

Capacitance is defined as the ratio of the electric charge on each conductor to the
potential difference between them. The unit of capacitance in the International System of
Units (SI) is the farad (F), defined as one coulomb per volt (1 C/V). Capacitance values of
typical capacitors for use in general electronics range from about 1 pF (1012 F) to about 1 mF
(103 F).

The capacitance of a capacitor is proportional to the surface area of the plates


(conductors) and inversely related to the gap between them. In practice, the dielectric
between the plates passes a small amount of leakage current. It has an electric field strength
limit, known as the breakdown voltage.

Fig 2.12 Capacitor types

The conductors and leads introduce an undesired inductance and resistance.


Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass. In analog filter networks, they smooth the output
of power supplies. In resonant circuits they tune radios to particular frequencies. In electric
power transmission systems, they stabilize voltage and power flow.[3] The property of energy
storage in capacitors was exploited as dynamic memory in early digital computers.

2.9 Rectifier Diode

A rectifier is an electrical device that converts alternating current (AC), which


periodically reverses direction, to direct current (DC), which flows in only one direction. The
process is known as rectification. Physically, rectifiers take a number of forms,
including vacuum tube diodes, mercury-arc valves, copper and selenium oxide
rectifiers, semiconductor diodes, silicon-controlled rectifiers and other silicon-based
semiconductor switches. Historically, even synchronous electromechanical switches and
motors have been used. Early radio receivers, called crystal radios, used a "cat's whisker" of
fine wire pressing on a crystal of galena (lead sulphide) to serve as a point-contact rectifier or
"crystal detector".

(17)

Fig 2.13 Rectifier diode

Rectifiers have many uses, but are often found serving as components of DC power
supplies and high-voltage direct current power transmission systems. Rectification may serve
in roles other than to generate direct current for use as a source of power. As
noted, detectors of radio signals serve as rectifiers. In gas heating systems flame
rectification is used to detect presence of a flame.

Because of the alternating nature of the input AC sine wave, the process of
rectification alone produces a DC current that, though unidirectional, consists of pulses of
current. Many applications of rectifiers, such as power supplies for radio, television and
computer equipment, require a steady constant DC current (as would be produced by
a battery). In these applications the output of the rectifier is smoothed by an electronic
filter (usually a capacitor) to produce a steady current.

More complex circuitry that performs the opposite function, converting DC to AC, is
called an inverter.

2.10 NPN Transistor

The most commonly used transistor configuration is the NPN Transistor. We also
learnt that the junctions of the bipolar transistor can be biased in one of three different ways
Common Base, Common Emitter and Common Collector.

In this tutorial about bipolar transistors we will look more closely at the Common
Emitter configuration using the Bipolar NPN Transistor with an example of the construction
of a NPN transistor along with the transistors current flow characteristics is given below.

(18)

Fig 2.14 NPN Transistor polarity basis


(Note: Arrow defines the emitter and conventional current flow, out for a Bipolar
NPN Transistor.)The construction and terminal voltages for a bipolar NPN transistor are
shown above. The voltage between the Base and Emitter ( VBE ), is positive at the Base and
negative at the Emitter because for an NPN transistor, the Base terminal is always positive
with respect to the Emitter. Also the Collector supply voltage is positive with respect to the
Emitter ( VCE ). So for a bipolar NPN transistor to conduct the Collector is always more
positive with respect to both the Base and the Emitter.

Fig 2.15 NPN Transistor Connection

Then the voltage sources are connected to an NPN transistor as shown. The Collector
is connected to the supply voltage VCC via the load resistor, RL which also acts to limit the
maximum current flowing through the device. The Base supply voltage VB is connected to the
Base resistor RB, which again is used to limit the maximum Base current.

So in a NPN Transistor it is the movement of negative current carriers (electrons)


through the Base region that constitutes transistor action, since these mobile electrons provide
the link between the Collector and Emitter circuits. This link between the input and output
circuits is the main feature of transistor action because the transistors amplifying properties
come from the consequent control which the Base exerts upon the Collector to Emitter
current.

(19)

Then we can see that the transistor is a current operated device (Beta model) and that
a large current ( Ic ) flows freely through the device between the collector and the emitter
terminals when the transistor is switched fully-ON. However, this only happens when a
small biasing current ( Ib ) is flowing into the base terminal of the transistor at the same time
thus allowing the Base to act as a sort of current control input.

The transistor current in a bipolar NPN transistor is the ratio of these two currents
( Ic/Ib ), called the DC Current Gain of the device and is given the symbol of hfe or
nowadays Beta, ( ). The value of can be large up to 200 for standard transistors, and it is
this large ratio between Ic and Ib that makes the bipolar NPN transistor a useful amplifying
device when used in its active region as Ib provides the input and Ic provides the output. Note
that Beta has no units as it is a ratio.

Also, the current gain of the transistor from the Collector terminal to the Emitter
terminal, Ic/Ie, is called Alpha, ( ), and is a function of the transistor itself (electrons
diffusing across the junction). As the emitter current Ie is the sum of a very small base current
plus a very large collector current, the value of alpha , is very close to unity, and for a
typical low-power signal transistor this value ranges from about 0.950 to 0.999

2.11 Resistance
The electrical resistance of an electrical conductor is a measure of the difficulty of passing
an electric current through that conductor.

Fig 2.16 Resistor


It explains the relationship between voltage (amount of electrical pressure) and
the current (flow of electricity). With more resistance in a circuit, less electricity will flow
through the circuit.
2.12 Character LCD Module

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16x2 LCD display is very basic module and is very commonly used
in various devices and circuits. These modules are preferred over seven segments and other
multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have
no limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on.

(20)
Fig 2.17 LCD Module

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers,
namely, Command and Data.

The command register stores the command instructions given to the LCD. A
command is an instruction given to LCD to do a predefined task like initializing it, clearing
its screen, setting the cursor position, controlling display etc. The data register stores the data
to be displayed on the LCD. The data is the ASCII value of the character to be displayed on
the LCD. Click to learn more about internal structure of a LCD.
2.13 Potentiometer

A potentiometer, informally a pot, is a three-terminal resistor with a sliding or rotating


contact that forms an adjustable voltage divider. If only two terminals are used, one end and
the wiper, it acts as a variable resistor or rheostat.

The measuring instrument called a potentiometer is essentially a voltage divider used


for measuring electric potential (voltage); the component is an implementation of the same
principle, hence its name.
Fig 2.18 Potentiometer

(21)

Potentiometers are commonly used to control electrical devices such as volume controls on
audio equipment.

Potentiometers operated by a mechanism can be used as position transducers, for example, in


a joystick. Potentiometers are rarely used to directly control significant power (more than
a watt), since the power dissipated in the potentiometer would be comparable to the power in
the controlled load.

2.14 Jumper Wires

A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire, or
DuPont cable named for one manufacturer of them) is an electrical wire or group of them in
a cable with a connector or pin at each end (or sometimes without them simply "tinned"),
which is normally used to interconnect the components of a breadboard or other prototype or
test circuit, internally or with other equipment or components, without soldering.
Fig 2.19 Jumper wires

Individual jump wires are fitted by inserting their "end connectors" into the slots provided in
a breadboard, the header connector of a circuit board, or a piece of test equipment.

(22)

CHAPTER 3
Working Mechanism

3.1 working:
In this we will going to check the speed of the any rotating thing by using IR sensors
and the speed of rotating thing will display on the LCD screen and after this we control speed
of this according to our requirement. For this, Tachometer is a device used for measuring the
number of revolutions of an object in a given interval of time. Usually it is expressed in
revolutions per minute or RPM. Earlier tachometers purely mechanical where the revolution
is transferred to the tachometer through mechanical coupling (cable or shaft) , the rpm is
determined using a gear mechanism and it is displayed on a dial. With the advent of modern
electronics, the tachometers have changed a lot. This article is about a contactless digital
tachometer using arduino. The speed of the motor can be also controlled using the same
circuit. The RPM and all the other information are displayed on a 162 LCD screen.
The contact with the rotating shaft is avoided with an optical sensing mechanism that
uses an infrared (IR) light emitting diode and a photo detecting diode. The IR LED transmits
an infrared light towards the rotating disc and the photo detecting diode receives the reflected
light beam. This special arrangement of sensors is placed at about an inch away and facing
towards the rotating disc. If the surface of the disc is rough and dark, the reflected IR light
will be negligible. A tiny piece of white paper glued to the rotating disc is just enough to
reflect the incident IR light when it passes in front of the sensor, which happens once per
rotation .

Fig 3.1 Speed calculation of contactless tachometer

(23)

If the entire disc surface is bright and reflective, use a piece of black paper instead so
that the IR light will be absorbed by this portion once per rotation. In either case, a pulse will
be generated at the output of the signal conditioning circuit for each complete rotation of the
disc. The circuit diagram for the sensor part is shown below.
Fig 3.2 IR sensors and signal conditioning circuit

When the IR Tx pin is pulled high, the BC547 transistor (NPN) conducts and infrared
light is transmitted. This is controlled through RA3 pin of PIC18F255o, and is turned on for 1
sec during which the number of reflected pulses received by the photo detecting diode are
counted. The pulses appears at the collector of the BC557 transistor (PNP) goes to
RA4/T0CKI pin of PIC18F2550. It is the external input pin for Timer0 module which counts
the external pulses arriving at this pin. Under normal condition, the resistance of photo
detecting diode is very high and therefore, the BC557 transistor is almost cut-off. The output
at its collector is pulled to ground. When the photo detecting diode receives the reflected IR
light, its resistance drops and BC557 conducts, and the collector output goes high. Thus, this
simple circuit converts the reflected IR light from the white mark on the rotating disc into a
pulse.

NOTES:

The arduino board can be powered using a 9V supply through the external power
jack.
The 5V needed at some parts of the circuit can be tapped from the 5V source on the
arduino board.
The fan I used was rated 9V/100mA. The transistor 2N2222 can handle only upto
800mA. Keep this in mind while selecting the load.
The LCD module used was JHD162A.
POT R5 can be used to adjust the contrast of the LCD display. When connected first,
the LCD may not show up anything. Adjust the R5 until you get the display. The
optimum voltage at the wiper of R5 is between 0.4 to 1V.
(24)
The IR photo transistor and the IR diode both were taken from an LTH-1550 photo
interrupter module.
The lateral surface of the photo transistor must be masked using a tape.
Fig 3.3 Controller circuit for speed control
The development of high performance motor drives is very important in industrial as
well as other purpose applications. Generally, a high performance motor drive system must
have good dynamic speed command tracking and load regulating response. The dc motors are
used in various applications such as defense, industries, Robotics etc. DC drives, because of
their simplicity, ease of application, reliability and favourable cost have long been a backbone
of industrial applications. The project provides the efficient and simple method to control
speed of DC motor using ATMEGA16 microcontroller and L298N motor driver IC.

Fig 3.4 Block diagram circuit for speed control


(25)

With the use of ATMEGA16 and l298N we can drive the dc motor at desired speed
having a feedback loop and in this project we have used proportional integral and derivative
method in which errors are not only solved but also taken to its minimal value with very low
amount of error oscillations.

PROPORTIONAL CONTROL:

The proportional part of PID examines the magnitude of the error and it reacts
proportionally. A large error receives a large response

INTEGRAL CONTROL:

To address the first issue with the proportional control, integral control attempts to
correct small error (offset).

DERIVATIVE CONTROL:

The derivative part of the control output attempts to look at the rate of change in the
error signal. Derivative will cause a greater system response to a rapid rate of change than to
a small rate of change.
The circuit diagram of the digital tachometer using arduino is shown below.

(26)
3.1.1 RPM Sensor

An IR photo transistor and IR LED forms the sensor. IR photo transistor is a type of
photo transistor which responds to infra-red waves only. The use of IR phototransistor avoids
other light interferences from the environment. The photo transistor and IR diode are aligned
side by side. Resistor R2 limits the current through the IR diode. A reflective strip is glued on
the rotating object (shaft, disc or fan) in line with the sensor. I used a 9V/100mA cooling fan.
The clearance between the sensor and reflective strip has to be less than 1cm. When the
reflective strip passes in front of the sensor, IR waves are reflected back to the photo
transistor. The photo transistor conducts more at this moment and as a result the voltage
across R3(68K resistor) shoots up at this moment. The result will be a waveform like what
shown below at the emitter of the photo transistor. RPM can be determined by counting the
number of upward shoots in a given interval of time.

3.1.2 Counting the RPM.

Arduino is used for counting the RPM and displaying it on the LCD screen. Emitter of
the photo transistor is connected to the Interrupt 0 (digital pin 2) of the arduino. The arduino
interrupt is configured to be rising edge triggered. As a result the will be an interrupt for
every upward shoot in the emitter waveform. The number of interrupts occurred in a given
time is counted by incrementing a varible using the interrupt service routine. The time
elapsed during te counting cycle is determined using the millis() function. The millis()
function returns the number of milli seconds passed since the arduino board is switched ON.
Calling the millis() function before and after the counting cycle and the taking their
difference gives the times passed during the counting cycle. The (number of interrupts/time in
milliseconds)*60000 will give the revolutions per minute (RPM).

3.1.3 Controlling the speed of motor.

A provision for controlling the motor speed using a potentiometer is also included in
the circuit. Transistor Q1 is used for driving the motor. Its base is connected to pwm pin 9 of
the arduino through the current limiting resistor R1. Wiper of the speed control POT R4 is
connected to anlog pin A0 of the arduino. The voltage at this pin is converted into a value
between 0 and 1023 using the anlogRead function. Then this value is divided by four to fit it
into the 0 to 255 range. Then this value is written to the PWM pin 9 using the anlogWrite
function. The result will be a square wave at pin 9 whose duty cycle is proportional to the
value written using the analogWrite function. For example if the value is 255, the duty cycle
will be 100% and if the value is 127, the duty cycle will be around 50%. D1 is a free
wheeling diode and C1 is a noise by-pass capacitor(de coupler).

(27)
The rpm and duty cycle are displayed on the LCD screen using the standard
LiquidCrystal library. Read this article: Interfacing LCD to Arduino. Full program for the
digital tachometer using arduino is shown below.

Program:

#include<LiquidCrystal.h>

LiquidCrystal lcd(12,11,6,5,4,3);

int pwm=9;

int pot=A0;

float value=0;

int percent;

float rev=0;

int rpm;

int oldtime=0;

int time;

void isr() //interrupt service routine

rev++;

void setup()

lcd.begin(16,2); //initialize LCD


(28)

attachInterrupt(0,isr,RISING); //attaching the interrupt

void loop()

delay(1000);

detachInterrupt(0); //detaches the interrupt

time=millis()-oldtime; //finds the time

rpm=(rev/time)*60000; //calculates rpm

oldtime=millis(); //saves the current time

rev=0;

value=analogRead(pot); //reads the speed control POT

value=value/4;

analogWrite(pwm,value); //sets the desired speed

percent=(value/255)*100; //finds the duty cycle %

lcd.clear();

lcd.setCursor(0,0);

lcd.print("___TACHOMETER___");

lcd.setCursor(0,1);

(29)

lcd.print(rpm);
lcd.print(" RPM");

lcd.print(" ");

lcd.print(percent);

lcd.print("%");

attachInterrupt(0,isr,RISING);

(30)
CHAPTER 4
Advantages and Application

4.1 Advantages
1. Simple to operate.
2. No attachment required to the shaft.
3. Can calculate the speed and operate according to our required speed.
4. Very convenient.
5. Less error will be there.

4.2 Application
1. Tachometer is an essential instrument in this modern era of industrialization. In
industry it is necessary to control the speed of motor at a definite RPM and for this
counting of RPM is essential.
2. Tachometer performs this task of counting. Using the theory behind tachometer we
can develop other device such as visitor counter, object counter.
3. In aero to check the speed of shuttle, engine or rotor position.
4. In Industrial: Mixers/Pumps, Conveyors, Compressors, Extruders, Paper/Pulp Mills,
Centrifuge, PLC Interface, Motor Control, Assembly, Systems Flow Meters.
5. In marines, petrochemicals or in rails etc.

4.3 Scope
1. Bio medical signals like breathing heart measurement and pulse oximetry.
2. Integrated alarm system for unhealthy heart.
3. We use inbuilt memory for data storage for a comparative examination.

(31)

CHAPTER 5
REFERENCES

http://www.arduino.cc.( Access time 29/01/2015 . 9:06 PM).


https://en.wikipedia.org/wiki/Arduino Arduino cookbook.

arduino-1.0.5-r2/reference/AnalogWrite.html
arduino-1.0.5-r2/reference/DigitalWrite.html

arduino-1.0.5-r2/reference/AttachInterrupt.html
arduino-1.0.5-r2/reference/DigitalRead.html

(32)

You might also like