You are on page 1of 30

DTMF Controlled Wireless Robot

Abstract:
The aim of this project is to design automatic robot which is capable of receiving a set
of command instructions in the form of DTMF tones and performs the necessary actions. Here
DTMF stands for “Dual tone multiple frequency”.

Automated sensors and remote communication aims at building a highly automated


wireless system which can be monitored with the help of a remote mobile. The employment of
the GSM mobile into the project makes the device to overcome distance limitation. This makes
the user of the robot to be operated from anywhere in the universe.

The objective of this project is fulfilled by employing a GSM mobile, a microcontroller,


few DC motors for direction control, and an electrical interfacing between the different modules
of the project and the controller. The electrical interfacing between different peripheral is
necessary to satisfy different electrical parameters.

The project makes use of a microcontroller which acts as a central controlling unit. This
module is capable of communicating with the input and the output modules. The output module
is formed by the motors used for controlling the direction of the motor i.e. the forward and
backward movement of the robot and also the GSM mobile which is used for performing
communication with the remotely located authorities. The micro controller reads the
mobile sensor continuously to take any action

2. Introduction
In the present world of wireless technology every thing is going to be digital
and wireless, and the cell phone is the key player in wireless technology today.
And today technology made the possessing of a mobile, considered as a basic
commodity.
And the trends in wireless technology changing day-by-day and today the
working is going on how to develop remote devices with out the presence of man
and to reduce to the time factor and labor, and our project belongs to that race
and by using it we can control any electronic devices through a touch cell phone,
with one Call

The major building blocks of this project are:

1. Regulated power supply.


2. Mobile phone.
3. Voice Generating circuit (IC based).
4. Microcontroller.
5. DTMF decoders
6. Motor drivers.
7. Movement controlling motors.
8. Buzzer.
9. LED Indicators.

2.1. Block Diagram

DT

GSM
INTRODUCTION:

MOBILE
Conventionally Wireless-controlled Robots use RF circuits, which have limited working range,
limited frequency range and limited control. Use of a mobile phone for robotic control can
overcome these limitations. It provides the advantage of robust control, working range as large
as the area of the service provider, no interference with other controllers. Although the
appearance and capabilities of robot vary vastly, all robots share feature of a mechanical,

DTMF
movable structure under some form of control. The control of Robot involves three distinct
phases: perception, processing and action. Generally, the preceptors are sensors mounted on the
robot, processing is done by the onboard microcontroller or processor, and the task is
performed using motors or with some other actuators.

AN OVERVIEW:
In this project the robot, is controlled by a mobile phone that makes call to the phone attached
to the robot. In the course of the call, if any button is pressed control corresponding to the
button pressed is heard at the end of the call. This is called Dual Tone Multi Frequency
(DTMF). The robot receives this DTMF tone with the help of the phone stacked in the robot.
The received tone is processed by the microcontroller (PIC16F73) with the help of DTMF
decoder (HT9170), which decodes the DTMF tone in to its equivalent binary digit and this
binary numbers are then send to the microcontroller. The microcontroller is programmed to
take a decision for any given input and outputs it decisions to the motor drivers in order to drive
the motors for forward or backward motion or a turn. The mobile that makes a call to the
mobile attached to the robot acts as a remote, so this does not require any transmitter or receiver
units. DTMF signaling is used for telephone signaling over the line in the voice frequency band
to the call switching center. The version of DTMF used for telephone dialing is called touch
tone DTMF assigns a specific frequency (consisting of two separate tones) to each keys that it
can easily be identified by the electronic circuit. The signal generated by the DTMF encoder is
the direct algebraic submission, in real time of the
amplitudes of two sine or cosine waves of different frequencies, that is pressing 5 will send a
tone made by adding 1336 Hz and 770 Hz to the other end of the mobile phone. The table
below shows the corresponding frequencies of the numbered buttons.

Frequencies corresponding to touch tone

CIRCUIT DESCRIPTION:
3.1. Power supply

Power supply is the major concern for every electronic device .Since the controller and other
devices used are low power devices there is a need to step down the voltage and as well as
rectify the output to convert the output to a constant dc

3.1.1 Battery
In electronics, a battery or voltaic cell is a combination of many electrochemical Galvanic
cells of identical type to store chemical energy and to deliver higher voltage or higher current
than with single cells.

In our project we make use of a battery or a voltaic cell instead of house hold power
supply in order to assure portability to the device so that it can be carried as per the
requirement. Here we employ a 9 volts transistor radio battery.

3.1.2 Rectifier

Usually rectifiers are employed to convert an ac input to a constant dc. But the case here is the
input itself is a DC then is there any necessity to employ a rectifier in the circuit, the answer is
quite simple even if the battery is connected in reverse polarity the rectifier takes care about so
we there will not be any damage for the device even if the polarity of the battery is connected in
reverse direction

There are many rectifiers available in the market some of them are:-

• Half wave rectifier


• Full wave rectifier
• Bridge rectifier

The rectification is done by using one or more diodes connected in series or parallel.
If only one diode is used then only first half cycle is rectified and it is termed as half wave
rectification and the rectifier used is termed as Half wave rectifier.

If two diodes are employed in parallel then both positive and negative half cycles are
rectified and this is full wave rectification and the rectifier is termed as Full wave rectifier.

If the diodes are arranged in the form of bridge then it is termed as Bridge rectifier, it
acts as a full wave rectifier.

These rectifiers are available in the market in the form of integrated chips (I.Cs)

3.1.3 Voltage regulator

The voltage regulator is used for the voltage regulation purpose. We use IC 7805 voltage
regulator.

The IC number has a specific significance. The number 78 represents the series while
05 represent the output voltage generated by the IC

3.1.4 Light emitting diode


We employ a light emitting diode for testing the functionality of the power supply circuit. Here
we use a 5 volts LED which is connected in series with the power supply circuit it verifies the
functioning of the power supply

LED’s are also employed in other areas for many purposes. The fallowing are the
advantages of using LED’s.

• It helps us while troubleshooting the device i.e. when the device is malfunctioning
it would be easy to detect where the actual problem araised
• LED employed with microcontroller verifies whether data entered is correct bus
number or not
• It verifies the functionality of the power supply.

3.2.PIC MICROCONTROLLER
PIC 16 SERIES-PIC16F73
PIC is a family of Harvard architecture microcontrollers made by Microchip Technology,
derived from the PIC1640 originally developed by General Instrument's Microelectronics
Division. The name PIC initially referred to "Peripheral Interface Controller".

It is available in different configurations viz 8bit,16 bit,32 bit with instructions set as given
below :

Under 8 bit comes-PIC10 xxxx, PIC12 xxxx, PIC16 xxxx, PIC18 xxxx.(12 bit instruction set)

Under 16 bit comes-PIC24H,DSPIC30,DSPIC33. (14 bit instruction set)

Under 32 bit comes-PIC32xxxx. (16 bit instruction set)

PICs are popular with developers and hobbyists alike due to their low cost, wide availability,
large user base, extensive collection of application notes, availability of low cost or free
development tools, and serial programming (and re-programming with flash memory)
capability.

Special Microcontroller Features:

• High performance RISC CPU.

• Only 35 single word instructions to learn.


• All single cycle instructions except for program branches which are two-cycle.

• Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle.

• Up to 8K x 14 words of FLASH Program Memory, Up to 368 x 8 bytes of Data Memory


(RAM).

• Interrupt capability (up to 12 sources).

• Eight level deep hardware stack.

• Direct, Indirect and Relative Addressing modes.

• Processor read access to program memory.

• Power-on Reset (POR).

• Power-up Timer (PWRT) and Oscillator Start-up Timer (OST).

• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation.

• Programmable code protection

• Power saving SLEEP mode

• Selectable oscillator options

• In-Circuit Serial Programming (ICSP) via two pins.

Peripheral Features:

• Timer0: 8-bit timer/counter with 8-bit prescaler.

• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external
crystal/clock.

• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler.

• Two Capture, Compare, PWM modules

- Capture is 16-bit, max. resolution is 12.5 ns


- Compare is 16-bit, max. resolution is 200 ns

- PWM max. resolution is 10-bit.

• 8-bit, up to 8-channel Analog-to-Digital converter.

• Synchronous Serial Port (SSP) with SPI (Master mode) and I2C(Slave).

• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI).

• Parallel Slave Port (PSP), 8-bits wide with external RD, WR and CS controls (40/44-pin
only).

• Brown-out detection circuitry for Brown-out Reset (BOR).

CMOS Technology:

• Low power, high speed CMOS FLASH technology.

• Fully static design.

• Wide operating voltage range: 2.0V to 5.5V.

• High Sink/Source Current: 25 Ma.

• Industrial temperature range.

• Low power consumption:

- < 2 mA typical @ 5V, 4 MHz

PIN DIAGRAM
PIN DESCRIPTION

 MCLR-(pin 1)

PIC16F7X devices have a noise filter in the MCLR Reset path. The filter will detect and ignore
small pulses. It should be noted that a WDT Reset does not drive MCLR pin low. The behavior
of the ESD protection on the MCLR pin has been altered from previous devices of this family.
Voltages applied to the pin that exceed its specification can result in both MCLR Resets and
excessive current beyond the device specification during the ESD event. For this reason,
Microchip recommends that the MCLR pin no longer be tied directly to VDD.

 RESET

The PIC16F7X differentiates between various kinds of RESET:

 Power-on Reset (POR)


 MCLR Reset during normal operation
 MCLR Reset during SLEEP
 WDT Reset (during normal operation)
 WDT Wake-up (during SLEEP)
 Brown-out Reset (BOR)
Some registers are not affected in any RESET condion. Their status is unknown on POR and
unchanged n any other RESET. Most other registers are reset to a RESET state” on Power-on
Reset (POR), on the MCLR and WDT Reset, on MCLR Reset during LEEP, and Brown-out
Reset (BOR). They are not affected by a WDT Wake-up, which is viewed as the resumption of
normal operation. The TO and PD bits are set or cleared differently in different RESET
situations, as indicated

 PORTA –(pin 2 to 7)and the TRISA Register-

PORTA is a 6-bit wide, bi-directional port. The corresponding data direction register is TRISA.
Setting a TRISA bit (= ‘1’) will make the corresponding PORTA pin an input (i.e., put the
corresponding output driver in a Hi-Impedance mode). Clearing a TRISA bit (= ‘0’) will make
the corresponding PORTA pin an output (i.e., put the contents of the output latch on the
selected pin).

Reading the PORTA register reads the status of the pins, whereas writing to it will write to the
port latch. All write operations are read-modify-write operations. Therefore, a write to a port
implies that the port pins are read, the value is modified and then written to the port data latch.

 GND –(pin 8)

Provide Ground to it.

 OSC1/CLKIN-(pin 9)

Oscillator crystal input/external clock source input


 OSC2/CLKOUT-(pin 10)

Oscillator crystal output. Connects to crystal or resonator in Crystal

Oscillator mode. In RC mode, the OSC2 pin outputs CLKOUT

which has 1/4 the frequency of OSC1, and denotes the instruction

cycle rate.

Oscillator:- CRYSTAL OSCILLATOR/CERAMIC RESONATORS In XT, LP or HS modes,


a crystal or ceramic resonator is connected to the OSC1/CLKIN and OSC2/CLKOUT pins to
establish oscillation. The PIC16F7X oscillator design requires the use of a parallel cut crystal.
Use of a series cut crystal may give a frequency out of the crystal manufacturers specifications.
When in HS mode, the device can accept an external clock source to drive the OSC1/CLKIN
pin.

OSCILLATOR TYPES

The PIC16F7X can be operated in four different oscillator modes:

 LP Low Power Crystal


 XT Crystal/Resonator
 HS High Speed Crystal/Resonator
 RC Resistor/Capacitor

 PORTC and the TRISC Register(pin 11 to 18)

PORTC is an 8-bit wide, bi-directional port. The corresponding data direction register is
TRISC. Setting a TRISC bit (= ‘1’) will make the corresponding PORTC pin an input (i.e., put
the corresponding output driver in a Hi-Impedance mode). Clearing a TRISC bit (= ‘0’) will
make the corresponding PORTC pin an output (i.e., put the contents of the output latch on the
selected pin).

PORTC is multiplexed with several peripheral functions PORTC pins have Schmitt Trigger
input buffers. When enabling peripheral functions, care should be taken in defining TRIS bits
for each PORTC pin.

 Vss(pin 19)

Ground reference for logic and I/O pins

 Vdd(pin 20)

Positive supply for logic and I/O pins

 PORTB and the TRISB Register(pin 21 to 28)

PORTB is an 8-bit wide, bi-directional port. The corresponding data direction register is
TRISB. Setting a TRISB bit (= ‘1’) will make the corresponding PORTB pin an input (i.e., put
the corresponding output driver in a Hi-Impedance mode). Clearing a TRISB bit (= ‘0’) will
make the corresponding PORTB pin an output (i.e., put the contents of the output latch on the
selected pin).

Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on all the
pull-ups. The weak pull-up is automatically turned off when the port pin is configured as an
output. The pull-ups are disabled on a Power-on Reset.
CORE ARCHITECTURE
Figure 2.1: Showing a typical microcontroller device and its different subunits

The PIC architecture is distinctively minimalist. It is characterized by the following features:

• Separate code and data spaces (Harvard architecture)


• A small number of fixed length instructions
• Most instructions are single cycle execution (4 clock cycles), with single delay cycles
upon branches and skips
• A single accumulator (W), the use of which (as source operand) is implied (i.e. is not
encoded in the opcode)
• All RAM locations function as registers as both source and/or destination of math and
other functions.
• A hardware stack for storing return addresses
• A fairly small amount of addressable data space (typically 256 bytes), extended through
banking
• Data space mapped CPU, port, and peripheral registers
• The program counter is also mapped into the data space and writable (this is used to
implement indirect jumps).

Unlike most other CPUs, there is no distinction between memory space and register space
because the RAM serves the job of both memory and registers, and the RAM is usually just
referred to as the register file or simply as the registers
ELECTRICAL CHARACTERISTICS

Absolute Maximum Ratings †

Ambient temperature under bias...................................... .-55 to +125°C

Storage temperature.................................................... -65°C to +150°C

Voltage on any pin with respect to VSS (except VDD, MCLR. and
RA4) ......................................... -0.3V to (VDD + 0.3V)

Voltage on VDD with respect to VSS............................. -0.3 to +6.5V

Voltage on MCLR with respect to VSS (Note2)..........................0 to +13.5V

Voltage on RA4 with respect to Vss ..................................0 to +12V

Total power dissipation (Note 1)................................................1.0W


Maximum current out of VSS pin................................................300 mA

Maximum current into VDD pin .....................................................250 mA

Input clamp current, IIK (VI < 0 or VI > VDD)............................ ± 20 mA

Output clamp current, IOK (VO < 0 or VO > VDD) ...................... ± 20 mA

Maximum output current sunk by any I/O pin..................................25 mA

Maximum output current sourced by any I/O pin ............................25 mA

Maximum current sunk by PORTA, PORTB, and PORTE (combined) (Note


3).....................................200 mA

Maximum current sourced by PORTA, PORTB, and PORTE (combined) (Note


3) ..............................................200 mA

Maximum current sunk by PORTC and PORTD (combined) (Note


3) ..................................................................200 mA

Maximum current sourced by PORTC and PORTD (combined) (Note


3).............................................................200 mA
Note 1: Power dissipation is calculated as follows: Pdis = VDD x {IDD - Σ IOH} + Σ {(VDD -
VOH) x IOH} + Σ(VOl x IOL)

2: Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may
cause latch-up. Thus,

a series resistor of 50-100Ω should be used when applying a “low” level to the MCLR pin,
rather than pulling

this pin directly to VSS.

3: PORTD and PORTE are not implemented on the PIC16F73/76 devices.

3.5 Oscillators

PIC16F877A can work with four different configurations of an oscillator. Since configurations
with crystal oscillator and resistor-capacitor (RC) are the ones that are used most frequently,
these are the only ones we will mention here. Microcontroller type with a crystal oscillator has
in its designation XT, and a microcontroller with resistor-capacitor pair has a designation RC.
This is important because you need to mention the type of oscillator when buying a
microcontroller.

XT Oscillator
Crystal oscillator is kept in metal housing with two pins where you have written down the
frequency at which crystal oscillates. One ceramic capacitor of 30pF whose other end is
connected to the ground needs to be connected with each pin.

Oscillator and capacitors can be packed in joint case with three pins. Such element is called
ceramic resonator and is represented in charts like the one below. A center pin of the element is
the ground, while end pins are connected with OSC1 and OSC2 pins on the microcontroller.
When designing a device, the rule is to place an oscillator nearer a microcontroller, so as to
avoid any interference on lines on which microcontroller is receiving a clock.RC Oscillator.

In applications where great time precision is not necessary, RC oscillator offers additional
savings during purchase. Resonant frequency of RC oscillator depends on supply voltage rate,
resistance R, capacity C and working temperature. It should be mentioned here that resonant
frequency is also influenced by normal variations in process parameters, by tolerance of
external R and C components, etc.

Above diagram shows how RC oscillator is connected with PIC16F877A. With value of
resistor R being below 2.2k, oscillator can become unstable, or it can even stop the oscillation.
With very high value of R (ex.1M) oscillator becomes very sensitive to noise and humidity. It is
recommended that value of resistor R should be between 3 and 100k. Even though oscillator
will work without an external capacitor (C=0pF), capacitor above 20pF should still be used for
noise and stability. No matter which oscillator is being used, in order to get a clock that
microcontroller works upon; a clock of the oscillator must be divided by 4. Oscillator clock
divided by 4 can also be obtained on OSC2/CLKOUT pin, and can be used for testing or
synchronizing other logical circuits.

Following a supply, oscillator starts oscillating. Oscillation at first has an unstable period and
amplitude, but after some period of time it becomes stabilized.

To prevent such inaccurate clock from influencing microcontroller's performance, we need to


keep the microcontroller in reset state during stabilization of oscillator's clock. Diagram above
shows a typical shape of a signal which microcontroller gets from the quartz oscillator.

3.6 Push buttons


Buttons are mechanical devices used to execute a break or make connection between
two points. They come in different sizes and with different purposes. Buttons that are used here
are also called "dip-buttons". They are soldered directly onto a printed board and are common
in electronics. They have four pins (two for each contact) which give them mechanical stability.

Example of connecting buttons to microcontroller pins


Button function is simple. When we push a button, two contacts are joined together and
connection is made. Still, it isn't all that simple. The problem lies in the nature of voltage as an
electrical dimension, and in the imperfection of mechanical contacts. That is to say, before
contact is made or cut off, there is a short time period when vibration (oscillation) can occur as
a result of unevenness of mechanical contacts, or as a result of the different speed in pushing a
button (this depends on person who pushes the button). The term given to this phenomena is
called SWITCH (CONTACT) DEBOUNCE. If this is overlooked when program is written, an
error can occur, or the program can produce more than one output pulse for a single button
push. In order to avoid this, we can introduce a small delay when we detect the closing of a
contact. This will ensure that the push of a button is interpreted as a single pulse. The debounce
delay is produced in software and the length of the delay depends on the button, and the
purpose of the button. The problem can be partially solved by adding a capacitor across the
button, but a well-designed program is a much-better answer. The program can be adjusted
until false detection is completely eliminated. Image below shows what actually happens when
button is pushed.
As buttons are very common element in electronics, it would be smart to have a macro for
detecting the button is pushed. Macro will be called button. Button has several parameters that
deserve additional explanation.

Figure below shows the block diagram of the circuit of this microcontroller based robot. The
important components of this robot are DTMF decoder, Microcontroller and motor driver. An
HT9170 series DTMF decoder is used in this circuit, which uses the digital counting techniques
to detect and decode all sixteen DTMF tone pairs into a four bit code output. The built-in dial
tone rejection circuit eliminates the need for pre filtering.
Phone on the transmitting side:

The person who wants to switch on/off any device kept at the controller side calls from a phone
and, once the call gets picked up, enters the password and tones for a corresponding device.
Every key has to be pressed for a minimum amount of time to get it latched at the decoder IC.

Mobile phone on the receiving side:

The mobile phone on the receiver side picks up the phone automatically after 5seconds, and
then makes the tones available to the DTMF tone decoder IC through the headphone jack of the
phone.

DTMF Tone Decoder IC HT9170:


Features
_ Operating voltage: 2.5V~5.5V
_ Minimal external components
_ No external filter is required
_ Low standby current (on power down mode)
_ Excellent performance
_ Tristate data output for _C interface
_ 3.58MHz crystal or ceramic resonator
_ 1633Hz can be inhibited by the INH pin
_ HT9170B: 18-pin DIP package

The HT9170 series are Dual Tone Multi Frequency (DTMF) receivers integrated with digital
decoder and bandsplit filter functions. The HT9170B and HT9170D types supply power-down
mode and inhibit mode operations. All types of the HT9170 series use digital counting
techniques to detect and decode all the 16 DTMF tone pairs into a 4-bit code output. Highly
accurate switched capacitor filters are employed to divide tone (DTMF) signals into low and
high group signals. A built-in dial tone rejection circuit is provided to eliminate the need for
pre-filtering.

The DTMF tone decoder IC converts the received tones to their respective binary values and
then gives them as an input to the microcontroller through D3-D0.
The DTMF tone decoder IC’s internal architecture consists of a band split filter section which
separates the low and the high tone of the received tone pair, followed by a digital
decode(counting) section which verifies both the frequency and duration of the received tones
before passing resultant 4-bit code to the output bus.

THE WORKING:

In order to control the robot, we make a call to the phone attached to the robot from any phone.
Now the phone is picked up by the phone on the robot through auto answer mode (which is in
the phone already just we have to enable it). Now after the circuit is ready and all hex codes are
fetched we are ready to control the robot.
As shown in the above table, on pressing the key from mobile phone, DTMF decoder decodes
the code and conveys to microcontroller which in turn controls the motor in code allotted
direction.

FURTHER IMROVEMENTS & FUTURE SCOPE


1. IR Sensors:
IR sensors can be used to automatically detect & avoid obstacles if the robot goes beyond line
of sight. This avoids damage to the vehicle if we are maneuvering it from a distant place.

2. Password Protection:
Project can be modified in order to password protect the robot so that it can be operated only if
correct password is entered. Either cell phone should be password protected or necessary
modification should be made in the assembly language code. This introduces conditioned
access & increases security to a great extent.

3. Alarm Phone Dialer:


By replacing DTMF Decoder IC CM8870 by a 'DTMF Transceiver IC‟ CM8880, DTMF tones
can be generated from the robot. So, a project called 'Alarm Phone Dialer' can be built which
will generate necessary alarms for something that is desired to be monitored (usually by
triggering a relay). For example, a high water alarm, low temperature alarm, opening of back
window, garage door, etc. When the system is activated it will call a number of programmed
numbers to let the user know the alarm has been activated. This would be great to get alerts of
alarm conditions from home when user is at work.

You might also like