SlideShare a Scribd company logo
NATIONAL INSTITUTE OF TECHNOLOGY CALICUT
Department of Electronics and Communication Engineering
Monsoon 2016
EMBEDDED SYSTEM DESIGN LAB REPORT
SUBMITTED BY
BHUKYA RAMESH NAIK
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
TABLE OF CONTENTS:
S.NO NAME OF THE EXPERIMENT PAGE.NO
1 BLINKING LEDS
A. Blink a LED at a low frequenc 4
B. Running-light effect using 4 LEDs. 5
2 SWITCH INTERFACE
A. LED toggle when a push button is pressed 7
B. 4-bit binary counter 9
3 LCD INTERFACE
A. Scroll a message across the LCD 11
B. Print decimal number on the LCD 12
4 STOP WATCH (10 seconds) 14
5 TIMERS 16
6 PROGRAMMABLE GAIN AMPLIFIER 18
7 PWM 21
8 ANALOG TO DIGITAL CONVERTER 23
9 PSoC 4
A. Blink led using software 26
B. Blink led using hardware 29
10 BLINK LED USING PWM 32
11 TOGGLE RGB LED
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
A.Toggle using software 35
B.Toggle using interrupt 38
12 CAPSENSE 42
13 PROJECT
CONTROLLING HOME APPLIANCES USING DTMF 46
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT- 1
A. BLINKING LED
AIM:
Blink a LED at a low frequency using delay( ) loop
BLOCK DIAGRAM:
PORT CONNECTIONS:
LED CONFIGURATION PORT CONFIGURATION
C CODE:
PART A
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
B. RUNNING LEDS
AIM:
To create a running-light effect using 4 LEDs without using the LED User Module
BLOCK DIAGRAM:
PORT CONNECTIONS:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PORT CONFIGURATION
C CODE:
RESULT:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT - 2
A. SWITCH INTERFACE
AIM:
To make a LED toggle when a push button is pressed.
BLOCK DIAGRAM:
PORT CONNECTIONS
PORT CONFIGURATION
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
B. 4 BIT BINARY COUNTER
AIM:
To create a 4-bit binary counter, that counts up when a push button is pressed.
BLOCK DIAGRAM:
PORT CONNECTIONS:
LED CONFIGURATION PORT CONFIGURATION
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT - 3
A. LCD INTERFACE
AIM:
To
BLOCK DIAGRAM:
PORT CONNECTIONS:
PORT CONFIGURATION LCD CONFIGURATION
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
B. LCD INTERFACE
AIM:
To code a function to display decimal numbers on the LCD
BLOCK DIAGRAM:
PORT CONNECTIONS:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PORT CONFIGURATION LCD CONFIGURATION
C CODE:
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT - 4
STOP WATCH
AIM:
To create a 10 seconds stop watch
BLOCK DIAGRAM:
PORT CONNECTIONS:
PORT CONFIGURATION LCD CONFIGURATION
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT 5
TIMER
AIM:
To generate a 1kHz square wave with 50% duty-cycle using a Timer module
BLOCK DIAGRAM:
PORT CONNECTIONS:
CLOCK SETTINGS TIMER CONFIGURATION
PART B
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
CONNECTION DIAGRAM
OUTPUT INTERCONNCTION
C CODE:
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT 6
PROGRAMMABLE GAIN AMPLIFIER
AIM:
To make a digital variable gain amplifier.
BLOCK DIAGRAM:
PORT CONNECTIONS:
CONFIGURATIONS
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
CONNECTION DIAGRAM
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT -7
PWM
AIM:
To make a LED glow at different brightness levels using a PWM module
BLOCK DIAGRAM:
PORT CONNECTIONS:
CONFIGURATIONS
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
CONNECTION DIAGRAM
C CODE:
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT-8
ADC
AIM:
To make a simple voltmeter using ADC and LCD
BLOCK DIAGRAM:
PORT CONNECTIONS:
ADC CONFIGURATION CLOCK SETTINGS
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
CONNECTION DIAGRAM
C CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
RESULTS:
The program is executed successfully and output is verified on PSoC1 kit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT-9
A. BLINK LED
AIM :
Blink the RGB LED at a frequency of 1Hz using the inbuilt delay function CyDelay()
and configure RGB as RED
COMPONENTS USED
Creator Components:
CyPins
Hardware Used:
PSoC 4 Pioneer Kit
BLOCK DIAGRAM
SCHEMATIC DIAGRAM
SET-3
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
SPECIFICATIONS OF THE COMPONENTS/MODULES USED
Digital output pin red with HW connection disabled
PIN CONFIGURATIONS :
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
C CODE
INFERENCE/RESULT/CONCLUSION
Hardware connection should be disabled if external hardware is not used.
RGB LED inside PSoC pioneer kit is active low.
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
B. BLINK LED USING HARDWARE
AIM
Blink the RGB LED at a frequency of 1Hz using hardware connections only and configure
RGB as RED
COMPONENTS USED
Creator Components:
CyPins
Toggle Flip-Flop[1.1v]
Logic High
Clock
Hardware Used:
PSoC 4 Pioneer Kit
BLOCK DIAGRAM
SCHEMATIC DIAGRAM
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
SPECIFICATIONS OF THE COMPONENTS/MODULES USED
T flip-flop is rising edge triggered internally
PIN CONFIGURATIONS :
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
C CODE
INFERENCE/RESULT/CONCLUSION
PSoC have the flexibility to use to complete a task with hardware connections only.
Reduction in code length reduces the memory usage and workload of processor.
T- flip-flop is positive edge triggered
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT-10
BLINK LED USING PWM
AIM:
Blink two LEDs (say RED and GREEN in RGB module) alternatively using TPCWM
component with duty cycle 50%
COMPONENTS USED:
Creator components:
TCPWM[v1.0]
Clock[v2.10]
cy-Pins1
cy- RGB LED
BLOCK DIAGRAM:
SCHEMATIC DIAGRAM
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PIN CONFIGURATION:
Pin_1: P1[6] Pin_2: 0[2]
CODE
MODULE SPECIFICATIONS
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PWM ALIGNMENT:
INFERENCE/RESULT/CONCLUSION
TCPWM[v1.0] is down counter.
To blink LEDs, period value should be properly set and timer register contents could be
captured to get required output.
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT-11
A. TOGGLING RGB LED
AIM:
Toggle RGB Led in the kit between RED > GREEN > BLUE when a switch is pressed, Implement
by Polling Gpio pin status.
COMPONENTS USED:
Creator components.
Cy pins
Hardware used:
No external hardware is used. RGB LED and push button switch is used.
BLOCK DIAGRAM:
SCHEMATIC DIAGRAM
PORT ASSIGNMENT
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
red : P1[6]; green: P0[2]; blue: P0[3] ; switch1: P0[7]
MODULE SPECEFICATION
Pushbutton hardware connection enabled and drive mode resistive pull up mode
CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
INFERENCE/RESULT/CONCLUSION
Push button in PSoC 4 pioneer kit is connected to ground. When switch is pressed connected
port receives active low signal. So the drive mode of the switch should be in pull up mode.
RGB LED s are inside the same casing, turning ON more than one will result in
complementary colours. So care should be taken turning ON and OFF each of them in
practical applications.
Hardware (edge triggering) or software measures should be taken while using a switch in
order to avoid false transitions.
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
B.TOGGLING USING INTERRUPT
AIM:
Toggle RGB Led in the kit between RED > GREEN > BLUE when a switch is
pressed, Implement by Gpio pin Interrupt.
COMPONENTS USED
Creator components:
Cy pins
Cy isr
Hardware used:
No external hardware is used. RGB LED and push button switch is used.
BLOCK DIAGRAM:
SCHEMATIC DIAGRAM
PORT ASSIGNMENT
red : P1[6]; green: P0[2]; blue: P0[3] ; switch1: P0[7]
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
MODULE SPECEFICATION
Interrupt enabled in switch
Interrupt vector with priority settings
Isr with default settings
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
Output pins with hardware connection disabled
CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
INFERENCE/RESULT/CONCLUSION
Interrupts can be generated from input module by activating it.
Priority of interrupts and interrupt vector can be set.
ISR function should be activated and global interrupts should be enabled before using
interrupt.
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
EXPERIMENT-12
CAPSENSE
AIM:
Configure the CapSense module in the Pioneer Kit as button and on sensing capacitive touch at
each button,glow an led use three Capsense buttons to glow RED, GREEN, BLUE in the RGB
module, and for remaining two Capsense buttons by wiring additional Leds to Gpio pins.
COMPONENTS USED:
Creator components:
Capsense csd module
Cy-pins
Hardware used:
LEDs .
BLOCK DIAGRAM
SCHEMATIC DIAGRAM:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PIN CONFIGURATION:
CODE:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
MODULE SPECIFICATION:
Output pins with hardware connection disabled
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
INFERENCE/RESULT/CONCLUSION
In capsense the scanning of widgets and capacitance measurements takes some time, so
proper delay or looping should be given before using the output values.
For switch operation button mode is used in capsense. `
RESULTS:
The program was executed successfully and desired output was obtained.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PROJECT
CONTROLLING HOME APPLIANCES USING DTMF
ABSTRACT
Traditionally electrical appliances in a home are controlled via switches that
regulate the electricity to these devices. As the world gets more and more technologically
advanced, we find new technology coming in deeper and deeper into our personal lives even
at home. Home automation is becoming more and more popular around the world and is
becoming a common practice. The process of home automation works by making everything
in the house automatically controlled using technology to control and do the jobs that we
would normally do manually.
This project proposes a unique system for Home automation utilizing Dual Tone Multi
Frequency (DTMF) that is paired with a wireless module to provide seamless wireless control
over many devices in a house. This user console has many keys, each corresponding to the
device that needs to be activated. The encoder encodes the user choice and sends via a
transmitter. The receiver receives the modulated signal and demodulates it and the user choice
is determined by the DTMF decoder. Based upon this the required appliance is triggered.
SOFTWARE TOOL: PSOC DESIGNER 5.4
COMPONENTS: DTMF Circuit Consists of Various Components:
Resistors
LEDs
Capacitors
Crystal Oscillator
ICs
Resistors:
The resistor is a component that has one purpose and that is to resist current and voltage by
means of combining conductive material with a nonconductive one to form a substance that allows
electrons to flow through its self but not as efficiently as a typical wire. Most commonly used
resistors in electronic circuits have a wattage rating of 1/2W or 1/4W.There are smaller resistors
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
(1/8W and 1/16W) and higher (1W, 2W, 5W, etc.). Resistance value detailed above are a constant
and do not change if the voltage or current-flow alters. But there are circuits that require resistors
to change value with a change in temperate or light. This function may not be linear, hence the
name nonlinear resistors.
Fig: Resistors
The unit of measuring how much the resistor will oppose current is measured in ohms and to
LEDs:
LEDs emit light when an electric current passes through them. LEDs are available in red,
orange, amber, yellow, green, blue and white. The colour of an LED is determined by the
semiconductor material, not by the colouring of the 'package'.
Fig: LEDs of Different Colour
LED is a solid-state device that controls current without heated filaments and is therefore
very reliable.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
Capacitors:
Capacitors store electric charge. They are used with resistors in timing circuit because it
takes time for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting
as a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC
(changing) signals but they block DC (constant) signal.
Fig: Different Types of Capacitors
Crystal Oscillator:
Crystal is a circuit element commonly used in the clock. The frequency of the crystal
connected to the 8051 family can vary from 4MHz to 30MHz. The crystal clock frequency
provide higher speed. Usually a system shares a single crystal, easy to synchronize the various
parts.
Fig: Crystal Oscillator of 11.0592MHz frequency
Overview of Software Used:
In this project we use Psoc1 designer software. In which we can use two languages for
coding. 1
1. Embedded C
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
2. Assembly language
Embedded C:
C is probably the most widely used programming language today. It has a number of features
that make it a good choice for both small-scale embedded projects, as well as large-scale projects.
Features like:
It is easier and less time consuming.
C is easier to modify and update.
DTMF BASED HOME AUTOMATION
Dual Tone Multiple frequency techniques used to control home appliances. By
using this we can control lights, fans.
Fig. Block Diagram
Description:
The brain of the circuit is the M8C microprocessor of Psoc1. The M8C microprocessor
examines incoming signals through DTMF decoder and controls the outputs by relays. The audio
output from the cell phone is connected to the input of DTMF decoder. The incoming call is
answered by the cell phone.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
DTMF detection and decoding is provided by DTMF decoder block. An IC MT 8870, is a
complete DTMF receiver, which is able to detect and decode all 16 DTMF tone pairs into a 4-bit
code. When a valid DTMF digit is detected the 4-bit code is available at the output pins and a
VALID SIGNAL output, is set to logic high. For its operation the integrated circuit requires a clock
signal, generated in this case by the quartz crystal of 3.579545MHz.
Characteristics:
Frequency Tolerance:
Tolerance Frequency ±1.5 % is allowed for valid DTMF tone. Tones with offset ±3.5%
must be Rejected.
Signal Duration:
A signal with the duration of 40 ms must be considered valid. Tones with duration 23 ms or less
must be rejected.
Signal Interruption:
A valid DTMF signal interrupted for 10 ms or less should not be detected as two distinct tones.
Signal Pause:
A valid DTMF signal separated by 40 ms pause or more must be detected as two distinct
characters.
Signal-to-Noise Ratio (SNR):
The DTMF detector must correctly process signal with SNR at 15 db.
Tone Twist:
The detector must correctly decode DTMF codes when row frequency signal is 8 dB larger
than column frequency signal. The detector must correctly operate when column frequency signal
is 4db larger than row signal.
Talk-Off:
The detector should operate in the presence of speech and music without incorrectly identifying
the speech signal as valid DTMF signals.
Basics of DTMF Based Home Automation:
A DTMF signal is the sum of two sinusoidal waveforms with predefined frequencies,
a user can interact with the DTMF dialer using a keypad with 16 characters.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
Table :DTMF Frequency table
The function of the DTMF detector is based on filtering the routing the input signal to the band
pass filters. Input signal into row and column groups, calculating the sine wave period and
independently comparing them with predefined values. First, two 4pole band pass filters split the
DTMF signal into two components low frequency (697 Hz 941 Hz) and high frequency (1209
Hz 1633Hz). Each filter output is routed to a Schmidt trigger input for converting a sine wave
into a square wave. This square sign -bit timer through a
comparator bus.
begins to increase, it is converted into a square wave front and this front initiates the capture
mechanism of a digital timer block. The captured value is stored in a circular RAM buffer for further
processing. To minimize measurement errors, the analyzing procedure begins once eleven values
are captured and stored in the RAM buffer. Then the frequency estimate is made for ten periods of
the sine wave.
The frequency channel consists of:
Input amplifier (IN_AMP) used for amplification and routing the input signal to the band pass
filters.
Band pass filters tuned to pass low/high bands of DTMF frequencies. They only pass low/high
DTMF frequency bands and block other frequencies.
Schmidt trigger, which converts sine wave and increases and decreases into square wave rising
and falling edges, respectively.
16-bit timer.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
In a DTMF signal generation, a DTMF keypad could be used for digit entry, when a button is
pressed, both the row and column tones are generated by the telephone or touch tone instrument.
These two tones will be distinctive and different from tones of other keys. So there is a low and
high frequency associated with a button, it is essentially the sum of two waves is transmitted.
1. DTMF decoder IC (M-8870)
2.
3. Capacitors (0.1µFx 2)
4. Crystal oscillator (3.579545MHz)
The operation of DTMF method are as follows:
Caller generates a dial tone consisting of two frequencies. It is transmitted via the telephone line
(communication media).
Telephone exchange consists of a DTMF decoder, which decodes the frequencies in to digital code.
These codes are the address of destination subscriber; it is read and processed by a computer which
connects caller to the destination subscriber.
Working of DTMF decoder circuit.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
DTMF keypads are employed in almost all landline and mobile handsets. Thus this technology is
used in the telephone switching centres to identify the number dialled by the caller.
The decoder distinguishes the DTMF tones and produces the binary sequence equivalent to key
pressed in a DTMF (Dual Tone Multi Frequency) keypad.
The circuit uses M-8870 DTMF decoder IC which decodes tone generated by the keypad of cell
phone.
DTMF signals can be tapped directly from the microphone pin of cell phone device. Cut the
microphone wire and you will get two wires red and green. The red wire is the DTMF input to the
circuit.
The signals from the microphone wire are processed by the DTMF decoder IC which generates an
equivalent binary sequence as a parallel output like Q1, Q2, Q3, and Q4
There is an inbuilt Op amp present inside the M-8870 decoder IC. The electrical signals from
capacitance (0.1 µF).
The non inverting input of Op-amp is connected to a reference voltage (pin4 -VREF). The voltage
at VREF pin is Vcc/2.
Pin 3 (GS) is the output of internal Op Amp, the feedback signal is given by connecting the output
pin (pin3- GS) to inverting input pin (pin2- IN-
The output of Op Amp is passed through a pre filter, low group and high group filters (filter
networks). These filters contain switched capacitors to divide DTMF tones into low and high group
signals (High group filters bypass the high frequencies whereas low group filter pass low
frequencies).
Next processing sections inside the IC are frequency detector and code detector circuits. Filtered
frequency passed through these detectors.
At last the four digit binary code is latched at the output of M-8870 DTMF decoder IC.
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
Uses of other pins:
The entire process from frequency detection to latching of the data, is controlled by steering control
5th Pin, INH is an active high pin, inhibits detection of A, B, C, D tones of character.
6th Pin, PWDN is an (active high), inhibits the working of oscillator thus stops the working of our
circuit.
The 10th pin 10; TOE is the output enable pin which is active high logic and enables the latching
of the data on the data pins Q0, Q1, Q2, and Q3.
15th Pin StD is the Data valid pin, turn out to be high on detection of valid DTMF tone or else it
remains low.
Pins 7 (OS1) and 8 (OS2) are used to connect crystal oscillator. An oscillator of frequency 3.579545
MHz is used here.
Each row and column of the keypad corresponds to a certain tone and creates a specific frequency.
Each button lies at the intersection of the two tones.
For each pair, one of the tones is selected from a low group of four frequencies, and the other from
a high group of four frequencies. The correct detection of a digit requires both a valid tone pair and
the correct timing intervals.
The frequencies generated on pressing different phone keys are shown in the
DTMF Frequencies generated on Key press
Button Low DTMF
frequency (Hz)
High DTMF
frequency (Hz)
DTMF signals are decoded and forwarded to the microcomputer processor. The microprocessor
stores the last four signals received in memory. If more than four button presses are detected the
microprocessor begins again writing over the first button press stored in memory. For example, if
the sequence entered by the user was: 1, 7, 5, 3, 6, 2
The microprocessor would see this sequence in memory as: 6, 2, 5, 3
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
Working of DTMF Based Home Automation:
When you press any keys in your mobile Phone while call in progress, the other person will hear
some tones with respect to keys pressed. These tones are based on the DTMF (Dual Tone Multi
Frequency) technology. Data transmitted in terms of pair of tones. The receiver detects the valid
frequency pair and gives the appropriate BCD code as the output of the DTMF decoder IC. DTMF
signal can be tapped directly from the microphone pin of cell phone device. DTMF signal can be
tapped directly from the microphone pin of cell phone device.
See the figure below, Cut the microphone wire and you will be able to see 4 wires. Among these
wires you need only 2 wires Ground and Right as shown in the below figure.
Fig Headphone jack
Select the right wire and connect it as the DTMF input to the decoder circuit. Ground should be
connected to common ground of our circuit. The signals from the microphone wire are processed
by the DTMF decoder IC which generates the equivalent binary sequence as a parallel output as
Q1, Q2, Q3, and Q4.
DTMF Low and High frequency tones and decoded output
Button
Low DTMF
frequency
(Hz)
High DTMF
frequency
(Hz)
Binary coded output
Q1 Q2 Q3 Q4
1 697 1209 0 0 0 1
2 697 1336 0 0 1 0
3 697 1477 0 0 1 1
4 770 1209 0 1 0 0
5 770 1336 0 1 0 1
6 770 1477 0 1 1 0
7 852 1209 0 1 1 1
8 852 1336 1 0 0 0
9 852 1477 1 0 0 1
0 941 1336 1 0 1 0
* 941 1209 1 0 1 1
# 941 1477 1 1 0 0
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
When we press the digit 1 on the keypad, you generate the tones 1209 Hz and 697 Hz. Pressing the
digit 2 will generate the tones 1336 Hz and 697 Hz. Sure, the tone 697 is the same for both digits,
but it takes two tones to make a digit and the equipment knows the difference between the 1209 Hz
that would complete the digit 1, and a 1336 Hz that completes a digit 2.
When the user has entered what they believe to be the correct code the pound key (#) is pressed on
the phone pad and the microprocessor looks at the code it has stored in memory. The received code
is then compared against a firmware defined code. If the code does not match, the software begins
counting the failed access attempts.
If the failed attempt count reaches three, the microprocessor enters a three-minute lockdown mode
where further remote access to the system is denied. This lockdown mode is designed to discourage
unauthorized access to the system. If the user believes that they have pressed a wrong key, they can
clear the code stored in memory by pressing the star (*) key with no penalty. If the pound button is
pressed and an incorrect code was entered, there is no way for the user to delete the failed attempt,
except by hanging up and redialling. If the system is in lockdown mode when a person attempts to
dial in the system, it will not respond until the three-minute lockdown has finished running its
course.
Once the correct code sequence has been entered and confirmed correct by the microprocessor, the
user is granted access to activate any number of the desired subsystems. The subsystems are
numbered 0-9, *, and #. The subsystem to activate is chosen by DTMF decoding just as the code
was entered. At this point in the program any key press will activate a subsystem and a subsystem
can be activated multiple times if the user desires. As the subsystems are self-contained, they only
require a pulse to begin their respective tasks. To disconnect from the system, the user simply hangs
up the phone that they are calling from. The subsystems will finish their jobs with no need for the
user to stay on the line. By using a band-split filter, the signal is broken into two sine wave
components. The peaks of each sine wave are counted over some known time frame. This will tell
the user the period of each sine wave.
By knowing the period, users can know the operating frequency of each sine wave. Once the
frequencies are calculated, they are compared against valid DTMF frequency ranges. If a valid
frequency is found to correspond to the row and column of a DMTF tone, a binary output is placed
on the output of the CM8870. A control line is driven high on the chip to indicate that a valid code
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
has been decoded and is present on the four-bit binary port. This decoded DTMF tone will remain
present on the output port until the CM8870 receives an enable signal from the microprocessor
controlling circuitry. At this point, the CM8870 will start the DTMF decoding process over.
FLOW CHART:
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
CODE
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
PSOC LAB REPORT NITC
BHUKYA RAMESH NAIK
APPLICATIONS:
Home Automation
Telephone Answering Machine(IVR)
Remote controlling System
CONCLUSION
This project presents a DTMF based home appliances controlling by M8C of
PSoC1.Experimental work has been carried out carefully. Here we are controlling 5 home appliances
controlling through DTMF technology effectively secured with password and timer. Here very easy to
use for any applications with the help of M8C Processor of PSoC1.
REFERENCES
[1] Embedded Systems- An Integrated Approach by Lyla B. Das.
[2] DTMF Based Remote Control System - R. Sharma, K. Kumar, and S. Viq, IEEE International
Conference ICIT, pp. 2380-2383, December 2006.

More Related Content

PDF
Esp8266 basics
PDF
Mips opcodes
DOCX
Control Units : Microprogrammed and Hardwired:control unit
DOCX
Embedded System
PPTX
Orcad pspice intro and basics
PDF
Microcontroller pic 16f877 architecture and basics
PPTX
Binary to grey code conversion
PDF
Report on arduino
Esp8266 basics
Mips opcodes
Control Units : Microprogrammed and Hardwired:control unit
Embedded System
Orcad pspice intro and basics
Microcontroller pic 16f877 architecture and basics
Binary to grey code conversion
Report on arduino

What's hot (20)

PDF
USB protocol
PDF
Decimal adder
ODP
Introduction to Arduino
PDF
FIFO Design
PPT
PIC 16F877A by PARTHIBAN. S.
DOCX
EC6612 VLSI Design Lab Manual
PPTX
Evolution of Microprocessor
PPTX
Microprocessor Presentation
PDF
Introduction to ESP32 Programming [Road to RIoT 2017]
PPTX
Il cuore di Arduino: Un sistema di sviluppo basato su microcontrollore Atmel ...
PPTX
[OOP - Lec 19] Static Member Functions
PPTX
UNSIGNED AND SIGNED BINARY DIVISION
PPTX
NAND and NOR implementation and Other two level implementation
PPTX
What is Adder-Half and Full Adder
PPTX
File handling in C
PPTX
Arithmetic & Logic Unit
PDF
MICROPROCESSOR 8085 WITH PROGRAMS
PPTX
Intel 8051 Programming in C
PDF
ARM CORTEX M3 PPT
USB protocol
Decimal adder
Introduction to Arduino
FIFO Design
PIC 16F877A by PARTHIBAN. S.
EC6612 VLSI Design Lab Manual
Evolution of Microprocessor
Microprocessor Presentation
Introduction to ESP32 Programming [Road to RIoT 2017]
Il cuore di Arduino: Un sistema di sviluppo basato su microcontrollore Atmel ...
[OOP - Lec 19] Static Member Functions
UNSIGNED AND SIGNED BINARY DIVISION
NAND and NOR implementation and Other two level implementation
What is Adder-Half and Full Adder
File handling in C
Arithmetic & Logic Unit
MICROPROCESSOR 8085 WITH PROGRAMS
Intel 8051 Programming in C
ARM CORTEX M3 PPT
Ad

Viewers also liked (20)

DOCX
color tracking robot
PPTX
Embedded based home security system
PDF
Report
PPTX
Pid control for line follwoers
DOCX
Arduino embedded systems and advanced robotics
PDF
Line Follower Final Report
PPTX
Line follower Robot using PID algorithm
PDF
Trends and Implications in Embedded Systems Development
PDF
Digital System Design Lab Report - VHDL ECE
PDF
Training Report on Embedded System
PPTX
Embedded based home security system
PDF
Design Engineering Report
DOC
embedded system report
DOCX
Report on Embedded Based Home security system
DOCX
Final report on line follower
DOC
De 1b report
DOCX
Design engineering report
PDF
SMART FARMING USING IOT
DOCX
Design report
PPTX
introduction to Embedded System Security
color tracking robot
Embedded based home security system
Report
Pid control for line follwoers
Arduino embedded systems and advanced robotics
Line Follower Final Report
Line follower Robot using PID algorithm
Trends and Implications in Embedded Systems Development
Digital System Design Lab Report - VHDL ECE
Training Report on Embedded System
Embedded based home security system
Design Engineering Report
embedded system report
Report on Embedded Based Home security system
Final report on line follower
De 1b report
Design engineering report
SMART FARMING USING IOT
Design report
introduction to Embedded System Security
Ad

Similar to Embedded system design psoc lab report (20)

PDF
Integrated circuit
DOCX
Real Time Clock Interfacing with FPGA
PDF
publish manual
PDF
Assembly programming II
PDF
Assembly programming II
PDF
Assembly programming II
PPTX
Introduction to Integrated Circuits
PPTX
Electronic code lock device
DOCX
ECET 365 Success Begins /newtonhelp.com 
DOCX
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
DOCX
ECET 365 Success Begins/Newtonhelp.com
PDF
70 interesting circuits
PPT
Monitoring and data logging system for a generator
PPTX
Digital clock workshop
PDF
Timers and Endge-aligned PWM
PDF
Ecet 365 Enhance teaching / snaptutorial.com
DOCX
ECET 365 Exceptional Education / snaptutorial.com
PDF
Digital Alarm Clock 446 project report
PPT
Physical prototyping lab2-analog_digital
PPT
Physical prototyping lab2-analog_digital
Integrated circuit
Real Time Clock Interfacing with FPGA
publish manual
Assembly programming II
Assembly programming II
Assembly programming II
Introduction to Integrated Circuits
Electronic code lock device
ECET 365 Success Begins /newtonhelp.com 
#MicroXplorer Configuration settings - do not modifyFile.Versio.docx
ECET 365 Success Begins/Newtonhelp.com
70 interesting circuits
Monitoring and data logging system for a generator
Digital clock workshop
Timers and Endge-aligned PWM
Ecet 365 Enhance teaching / snaptutorial.com
ECET 365 Exceptional Education / snaptutorial.com
Digital Alarm Clock 446 project report
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Pre independence Education in Inndia.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Institutional Correction lecture only . . .
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
Cell Structure & Organelles in detailed.
PPH.pptx obstetrics and gynecology in nursing
Pre independence Education in Inndia.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Basic Mud Logging Guide for educational purpose
Institutional Correction lecture only . . .
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Pharma ospi slides which help in ospi learning
O5-L3 Freight Transport Ops (International) V1.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Cell Types and Its function , kingdom of life
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Week 4 Term 3 Study Techniques revisited.pptx
O7-L3 Supply Chain Operations - ICLT Program

Embedded system design psoc lab report

  • 1. NATIONAL INSTITUTE OF TECHNOLOGY CALICUT Department of Electronics and Communication Engineering Monsoon 2016 EMBEDDED SYSTEM DESIGN LAB REPORT SUBMITTED BY BHUKYA RAMESH NAIK
  • 2. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK TABLE OF CONTENTS: S.NO NAME OF THE EXPERIMENT PAGE.NO 1 BLINKING LEDS A. Blink a LED at a low frequenc 4 B. Running-light effect using 4 LEDs. 5 2 SWITCH INTERFACE A. LED toggle when a push button is pressed 7 B. 4-bit binary counter 9 3 LCD INTERFACE A. Scroll a message across the LCD 11 B. Print decimal number on the LCD 12 4 STOP WATCH (10 seconds) 14 5 TIMERS 16 6 PROGRAMMABLE GAIN AMPLIFIER 18 7 PWM 21 8 ANALOG TO DIGITAL CONVERTER 23 9 PSoC 4 A. Blink led using software 26 B. Blink led using hardware 29 10 BLINK LED USING PWM 32 11 TOGGLE RGB LED
  • 3. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK A.Toggle using software 35 B.Toggle using interrupt 38 12 CAPSENSE 42 13 PROJECT CONTROLLING HOME APPLIANCES USING DTMF 46
  • 4. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT- 1 A. BLINKING LED AIM: Blink a LED at a low frequency using delay( ) loop BLOCK DIAGRAM: PORT CONNECTIONS: LED CONFIGURATION PORT CONFIGURATION C CODE: PART A
  • 5. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit. B. RUNNING LEDS AIM: To create a running-light effect using 4 LEDs without using the LED User Module BLOCK DIAGRAM: PORT CONNECTIONS:
  • 6. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PORT CONFIGURATION C CODE: RESULT: The program is executed successfully and output is verified on PSoC1 kit.
  • 7. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT - 2 A. SWITCH INTERFACE AIM: To make a LED toggle when a push button is pressed. BLOCK DIAGRAM: PORT CONNECTIONS PORT CONFIGURATION C CODE:
  • 8. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 9. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK B. 4 BIT BINARY COUNTER AIM: To create a 4-bit binary counter, that counts up when a push button is pressed. BLOCK DIAGRAM: PORT CONNECTIONS: LED CONFIGURATION PORT CONFIGURATION C CODE:
  • 10. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 11. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT - 3 A. LCD INTERFACE AIM: To BLOCK DIAGRAM: PORT CONNECTIONS: PORT CONFIGURATION LCD CONFIGURATION C CODE:
  • 12. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit. B. LCD INTERFACE AIM: To code a function to display decimal numbers on the LCD BLOCK DIAGRAM: PORT CONNECTIONS:
  • 13. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PORT CONFIGURATION LCD CONFIGURATION C CODE: RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 14. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT - 4 STOP WATCH AIM: To create a 10 seconds stop watch BLOCK DIAGRAM: PORT CONNECTIONS: PORT CONFIGURATION LCD CONFIGURATION C CODE:
  • 15. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 16. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT 5 TIMER AIM: To generate a 1kHz square wave with 50% duty-cycle using a Timer module BLOCK DIAGRAM: PORT CONNECTIONS: CLOCK SETTINGS TIMER CONFIGURATION PART B
  • 17. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK CONNECTION DIAGRAM OUTPUT INTERCONNCTION C CODE: RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 18. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT 6 PROGRAMMABLE GAIN AMPLIFIER AIM: To make a digital variable gain amplifier. BLOCK DIAGRAM: PORT CONNECTIONS: CONFIGURATIONS
  • 19. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK CONNECTION DIAGRAM C CODE:
  • 20. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 21. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT -7 PWM AIM: To make a LED glow at different brightness levels using a PWM module BLOCK DIAGRAM: PORT CONNECTIONS: CONFIGURATIONS
  • 22. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK CONNECTION DIAGRAM C CODE: RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 23. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT-8 ADC AIM: To make a simple voltmeter using ADC and LCD BLOCK DIAGRAM: PORT CONNECTIONS: ADC CONFIGURATION CLOCK SETTINGS
  • 24. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK CONNECTION DIAGRAM C CODE:
  • 25. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK RESULTS: The program is executed successfully and output is verified on PSoC1 kit.
  • 26. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT-9 A. BLINK LED AIM : Blink the RGB LED at a frequency of 1Hz using the inbuilt delay function CyDelay() and configure RGB as RED COMPONENTS USED Creator Components: CyPins Hardware Used: PSoC 4 Pioneer Kit BLOCK DIAGRAM SCHEMATIC DIAGRAM SET-3
  • 27. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK SPECIFICATIONS OF THE COMPONENTS/MODULES USED Digital output pin red with HW connection disabled PIN CONFIGURATIONS :
  • 28. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK C CODE INFERENCE/RESULT/CONCLUSION Hardware connection should be disabled if external hardware is not used. RGB LED inside PSoC pioneer kit is active low. RESULTS: The program was executed successfully and desired output was obtained.
  • 29. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK B. BLINK LED USING HARDWARE AIM Blink the RGB LED at a frequency of 1Hz using hardware connections only and configure RGB as RED COMPONENTS USED Creator Components: CyPins Toggle Flip-Flop[1.1v] Logic High Clock Hardware Used: PSoC 4 Pioneer Kit BLOCK DIAGRAM SCHEMATIC DIAGRAM
  • 30. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK SPECIFICATIONS OF THE COMPONENTS/MODULES USED T flip-flop is rising edge triggered internally PIN CONFIGURATIONS :
  • 31. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK C CODE INFERENCE/RESULT/CONCLUSION PSoC have the flexibility to use to complete a task with hardware connections only. Reduction in code length reduces the memory usage and workload of processor. T- flip-flop is positive edge triggered RESULTS: The program was executed successfully and desired output was obtained.
  • 32. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT-10 BLINK LED USING PWM AIM: Blink two LEDs (say RED and GREEN in RGB module) alternatively using TPCWM component with duty cycle 50% COMPONENTS USED: Creator components: TCPWM[v1.0] Clock[v2.10] cy-Pins1 cy- RGB LED BLOCK DIAGRAM: SCHEMATIC DIAGRAM
  • 33. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PIN CONFIGURATION: Pin_1: P1[6] Pin_2: 0[2] CODE MODULE SPECIFICATIONS
  • 34. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PWM ALIGNMENT: INFERENCE/RESULT/CONCLUSION TCPWM[v1.0] is down counter. To blink LEDs, period value should be properly set and timer register contents could be captured to get required output. RESULTS: The program was executed successfully and desired output was obtained.
  • 35. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT-11 A. TOGGLING RGB LED AIM: Toggle RGB Led in the kit between RED > GREEN > BLUE when a switch is pressed, Implement by Polling Gpio pin status. COMPONENTS USED: Creator components. Cy pins Hardware used: No external hardware is used. RGB LED and push button switch is used. BLOCK DIAGRAM: SCHEMATIC DIAGRAM PORT ASSIGNMENT
  • 36. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK red : P1[6]; green: P0[2]; blue: P0[3] ; switch1: P0[7] MODULE SPECEFICATION Pushbutton hardware connection enabled and drive mode resistive pull up mode CODE:
  • 37. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK INFERENCE/RESULT/CONCLUSION Push button in PSoC 4 pioneer kit is connected to ground. When switch is pressed connected port receives active low signal. So the drive mode of the switch should be in pull up mode. RGB LED s are inside the same casing, turning ON more than one will result in complementary colours. So care should be taken turning ON and OFF each of them in practical applications. Hardware (edge triggering) or software measures should be taken while using a switch in order to avoid false transitions. RESULTS: The program was executed successfully and desired output was obtained.
  • 38. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK B.TOGGLING USING INTERRUPT AIM: Toggle RGB Led in the kit between RED > GREEN > BLUE when a switch is pressed, Implement by Gpio pin Interrupt. COMPONENTS USED Creator components: Cy pins Cy isr Hardware used: No external hardware is used. RGB LED and push button switch is used. BLOCK DIAGRAM: SCHEMATIC DIAGRAM PORT ASSIGNMENT red : P1[6]; green: P0[2]; blue: P0[3] ; switch1: P0[7]
  • 39. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK MODULE SPECEFICATION Interrupt enabled in switch Interrupt vector with priority settings Isr with default settings
  • 40. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK Output pins with hardware connection disabled CODE:
  • 41. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK INFERENCE/RESULT/CONCLUSION Interrupts can be generated from input module by activating it. Priority of interrupts and interrupt vector can be set. ISR function should be activated and global interrupts should be enabled before using interrupt. RESULTS: The program was executed successfully and desired output was obtained.
  • 42. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK EXPERIMENT-12 CAPSENSE AIM: Configure the CapSense module in the Pioneer Kit as button and on sensing capacitive touch at each button,glow an led use three Capsense buttons to glow RED, GREEN, BLUE in the RGB module, and for remaining two Capsense buttons by wiring additional Leds to Gpio pins. COMPONENTS USED: Creator components: Capsense csd module Cy-pins Hardware used: LEDs . BLOCK DIAGRAM SCHEMATIC DIAGRAM:
  • 43. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PIN CONFIGURATION: CODE:
  • 44. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK MODULE SPECIFICATION: Output pins with hardware connection disabled
  • 45. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK INFERENCE/RESULT/CONCLUSION In capsense the scanning of widgets and capacitance measurements takes some time, so proper delay or looping should be given before using the output values. For switch operation button mode is used in capsense. ` RESULTS: The program was executed successfully and desired output was obtained.
  • 46. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK PROJECT CONTROLLING HOME APPLIANCES USING DTMF ABSTRACT Traditionally electrical appliances in a home are controlled via switches that regulate the electricity to these devices. As the world gets more and more technologically advanced, we find new technology coming in deeper and deeper into our personal lives even at home. Home automation is becoming more and more popular around the world and is becoming a common practice. The process of home automation works by making everything in the house automatically controlled using technology to control and do the jobs that we would normally do manually. This project proposes a unique system for Home automation utilizing Dual Tone Multi Frequency (DTMF) that is paired with a wireless module to provide seamless wireless control over many devices in a house. This user console has many keys, each corresponding to the device that needs to be activated. The encoder encodes the user choice and sends via a transmitter. The receiver receives the modulated signal and demodulates it and the user choice is determined by the DTMF decoder. Based upon this the required appliance is triggered. SOFTWARE TOOL: PSOC DESIGNER 5.4 COMPONENTS: DTMF Circuit Consists of Various Components: Resistors LEDs Capacitors Crystal Oscillator ICs Resistors: The resistor is a component that has one purpose and that is to resist current and voltage by means of combining conductive material with a nonconductive one to form a substance that allows electrons to flow through its self but not as efficiently as a typical wire. Most commonly used resistors in electronic circuits have a wattage rating of 1/2W or 1/4W.There are smaller resistors
  • 47. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK (1/8W and 1/16W) and higher (1W, 2W, 5W, etc.). Resistance value detailed above are a constant and do not change if the voltage or current-flow alters. But there are circuits that require resistors to change value with a change in temperate or light. This function may not be linear, hence the name nonlinear resistors. Fig: Resistors The unit of measuring how much the resistor will oppose current is measured in ohms and to LEDs: LEDs emit light when an electric current passes through them. LEDs are available in red, orange, amber, yellow, green, blue and white. The colour of an LED is determined by the semiconductor material, not by the colouring of the 'package'. Fig: LEDs of Different Colour LED is a solid-state device that controls current without heated filaments and is therefore very reliable.
  • 48. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK Capacitors: Capacitors store electric charge. They are used with resistors in timing circuit because it takes time for a capacitor to fill with charge. They are used to smooth varying DC supplies by acting as a reservoir of charge. They are also used in filter circuits because capacitors easily pass AC (changing) signals but they block DC (constant) signal. Fig: Different Types of Capacitors Crystal Oscillator: Crystal is a circuit element commonly used in the clock. The frequency of the crystal connected to the 8051 family can vary from 4MHz to 30MHz. The crystal clock frequency provide higher speed. Usually a system shares a single crystal, easy to synchronize the various parts. Fig: Crystal Oscillator of 11.0592MHz frequency Overview of Software Used: In this project we use Psoc1 designer software. In which we can use two languages for coding. 1 1. Embedded C
  • 49. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK 2. Assembly language Embedded C: C is probably the most widely used programming language today. It has a number of features that make it a good choice for both small-scale embedded projects, as well as large-scale projects. Features like: It is easier and less time consuming. C is easier to modify and update. DTMF BASED HOME AUTOMATION Dual Tone Multiple frequency techniques used to control home appliances. By using this we can control lights, fans. Fig. Block Diagram Description: The brain of the circuit is the M8C microprocessor of Psoc1. The M8C microprocessor examines incoming signals through DTMF decoder and controls the outputs by relays. The audio output from the cell phone is connected to the input of DTMF decoder. The incoming call is answered by the cell phone.
  • 50. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK DTMF detection and decoding is provided by DTMF decoder block. An IC MT 8870, is a complete DTMF receiver, which is able to detect and decode all 16 DTMF tone pairs into a 4-bit code. When a valid DTMF digit is detected the 4-bit code is available at the output pins and a VALID SIGNAL output, is set to logic high. For its operation the integrated circuit requires a clock signal, generated in this case by the quartz crystal of 3.579545MHz. Characteristics: Frequency Tolerance: Tolerance Frequency ±1.5 % is allowed for valid DTMF tone. Tones with offset ±3.5% must be Rejected. Signal Duration: A signal with the duration of 40 ms must be considered valid. Tones with duration 23 ms or less must be rejected. Signal Interruption: A valid DTMF signal interrupted for 10 ms or less should not be detected as two distinct tones. Signal Pause: A valid DTMF signal separated by 40 ms pause or more must be detected as two distinct characters. Signal-to-Noise Ratio (SNR): The DTMF detector must correctly process signal with SNR at 15 db. Tone Twist: The detector must correctly decode DTMF codes when row frequency signal is 8 dB larger than column frequency signal. The detector must correctly operate when column frequency signal is 4db larger than row signal. Talk-Off: The detector should operate in the presence of speech and music without incorrectly identifying the speech signal as valid DTMF signals. Basics of DTMF Based Home Automation: A DTMF signal is the sum of two sinusoidal waveforms with predefined frequencies, a user can interact with the DTMF dialer using a keypad with 16 characters.
  • 51. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK Table :DTMF Frequency table The function of the DTMF detector is based on filtering the routing the input signal to the band pass filters. Input signal into row and column groups, calculating the sine wave period and independently comparing them with predefined values. First, two 4pole band pass filters split the DTMF signal into two components low frequency (697 Hz 941 Hz) and high frequency (1209 Hz 1633Hz). Each filter output is routed to a Schmidt trigger input for converting a sine wave into a square wave. This square sign -bit timer through a comparator bus. begins to increase, it is converted into a square wave front and this front initiates the capture mechanism of a digital timer block. The captured value is stored in a circular RAM buffer for further processing. To minimize measurement errors, the analyzing procedure begins once eleven values are captured and stored in the RAM buffer. Then the frequency estimate is made for ten periods of the sine wave. The frequency channel consists of: Input amplifier (IN_AMP) used for amplification and routing the input signal to the band pass filters. Band pass filters tuned to pass low/high bands of DTMF frequencies. They only pass low/high DTMF frequency bands and block other frequencies. Schmidt trigger, which converts sine wave and increases and decreases into square wave rising and falling edges, respectively. 16-bit timer.
  • 52. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK In a DTMF signal generation, a DTMF keypad could be used for digit entry, when a button is pressed, both the row and column tones are generated by the telephone or touch tone instrument. These two tones will be distinctive and different from tones of other keys. So there is a low and high frequency associated with a button, it is essentially the sum of two waves is transmitted. 1. DTMF decoder IC (M-8870) 2. 3. Capacitors (0.1µFx 2) 4. Crystal oscillator (3.579545MHz) The operation of DTMF method are as follows: Caller generates a dial tone consisting of two frequencies. It is transmitted via the telephone line (communication media). Telephone exchange consists of a DTMF decoder, which decodes the frequencies in to digital code. These codes are the address of destination subscriber; it is read and processed by a computer which connects caller to the destination subscriber. Working of DTMF decoder circuit.
  • 53. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK DTMF keypads are employed in almost all landline and mobile handsets. Thus this technology is used in the telephone switching centres to identify the number dialled by the caller. The decoder distinguishes the DTMF tones and produces the binary sequence equivalent to key pressed in a DTMF (Dual Tone Multi Frequency) keypad. The circuit uses M-8870 DTMF decoder IC which decodes tone generated by the keypad of cell phone. DTMF signals can be tapped directly from the microphone pin of cell phone device. Cut the microphone wire and you will get two wires red and green. The red wire is the DTMF input to the circuit. The signals from the microphone wire are processed by the DTMF decoder IC which generates an equivalent binary sequence as a parallel output like Q1, Q2, Q3, and Q4 There is an inbuilt Op amp present inside the M-8870 decoder IC. The electrical signals from capacitance (0.1 µF). The non inverting input of Op-amp is connected to a reference voltage (pin4 -VREF). The voltage at VREF pin is Vcc/2. Pin 3 (GS) is the output of internal Op Amp, the feedback signal is given by connecting the output pin (pin3- GS) to inverting input pin (pin2- IN- The output of Op Amp is passed through a pre filter, low group and high group filters (filter networks). These filters contain switched capacitors to divide DTMF tones into low and high group signals (High group filters bypass the high frequencies whereas low group filter pass low frequencies). Next processing sections inside the IC are frequency detector and code detector circuits. Filtered frequency passed through these detectors. At last the four digit binary code is latched at the output of M-8870 DTMF decoder IC.
  • 54. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK Uses of other pins: The entire process from frequency detection to latching of the data, is controlled by steering control 5th Pin, INH is an active high pin, inhibits detection of A, B, C, D tones of character. 6th Pin, PWDN is an (active high), inhibits the working of oscillator thus stops the working of our circuit. The 10th pin 10; TOE is the output enable pin which is active high logic and enables the latching of the data on the data pins Q0, Q1, Q2, and Q3. 15th Pin StD is the Data valid pin, turn out to be high on detection of valid DTMF tone or else it remains low. Pins 7 (OS1) and 8 (OS2) are used to connect crystal oscillator. An oscillator of frequency 3.579545 MHz is used here. Each row and column of the keypad corresponds to a certain tone and creates a specific frequency. Each button lies at the intersection of the two tones. For each pair, one of the tones is selected from a low group of four frequencies, and the other from a high group of four frequencies. The correct detection of a digit requires both a valid tone pair and the correct timing intervals. The frequencies generated on pressing different phone keys are shown in the DTMF Frequencies generated on Key press Button Low DTMF frequency (Hz) High DTMF frequency (Hz) DTMF signals are decoded and forwarded to the microcomputer processor. The microprocessor stores the last four signals received in memory. If more than four button presses are detected the microprocessor begins again writing over the first button press stored in memory. For example, if the sequence entered by the user was: 1, 7, 5, 3, 6, 2 The microprocessor would see this sequence in memory as: 6, 2, 5, 3
  • 55. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK Working of DTMF Based Home Automation: When you press any keys in your mobile Phone while call in progress, the other person will hear some tones with respect to keys pressed. These tones are based on the DTMF (Dual Tone Multi Frequency) technology. Data transmitted in terms of pair of tones. The receiver detects the valid frequency pair and gives the appropriate BCD code as the output of the DTMF decoder IC. DTMF signal can be tapped directly from the microphone pin of cell phone device. DTMF signal can be tapped directly from the microphone pin of cell phone device. See the figure below, Cut the microphone wire and you will be able to see 4 wires. Among these wires you need only 2 wires Ground and Right as shown in the below figure. Fig Headphone jack Select the right wire and connect it as the DTMF input to the decoder circuit. Ground should be connected to common ground of our circuit. The signals from the microphone wire are processed by the DTMF decoder IC which generates the equivalent binary sequence as a parallel output as Q1, Q2, Q3, and Q4. DTMF Low and High frequency tones and decoded output Button Low DTMF frequency (Hz) High DTMF frequency (Hz) Binary coded output Q1 Q2 Q3 Q4 1 697 1209 0 0 0 1 2 697 1336 0 0 1 0 3 697 1477 0 0 1 1 4 770 1209 0 1 0 0 5 770 1336 0 1 0 1 6 770 1477 0 1 1 0 7 852 1209 0 1 1 1 8 852 1336 1 0 0 0 9 852 1477 1 0 0 1 0 941 1336 1 0 1 0 * 941 1209 1 0 1 1 # 941 1477 1 1 0 0
  • 56. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK When we press the digit 1 on the keypad, you generate the tones 1209 Hz and 697 Hz. Pressing the digit 2 will generate the tones 1336 Hz and 697 Hz. Sure, the tone 697 is the same for both digits, but it takes two tones to make a digit and the equipment knows the difference between the 1209 Hz that would complete the digit 1, and a 1336 Hz that completes a digit 2. When the user has entered what they believe to be the correct code the pound key (#) is pressed on the phone pad and the microprocessor looks at the code it has stored in memory. The received code is then compared against a firmware defined code. If the code does not match, the software begins counting the failed access attempts. If the failed attempt count reaches three, the microprocessor enters a three-minute lockdown mode where further remote access to the system is denied. This lockdown mode is designed to discourage unauthorized access to the system. If the user believes that they have pressed a wrong key, they can clear the code stored in memory by pressing the star (*) key with no penalty. If the pound button is pressed and an incorrect code was entered, there is no way for the user to delete the failed attempt, except by hanging up and redialling. If the system is in lockdown mode when a person attempts to dial in the system, it will not respond until the three-minute lockdown has finished running its course. Once the correct code sequence has been entered and confirmed correct by the microprocessor, the user is granted access to activate any number of the desired subsystems. The subsystems are numbered 0-9, *, and #. The subsystem to activate is chosen by DTMF decoding just as the code was entered. At this point in the program any key press will activate a subsystem and a subsystem can be activated multiple times if the user desires. As the subsystems are self-contained, they only require a pulse to begin their respective tasks. To disconnect from the system, the user simply hangs up the phone that they are calling from. The subsystems will finish their jobs with no need for the user to stay on the line. By using a band-split filter, the signal is broken into two sine wave components. The peaks of each sine wave are counted over some known time frame. This will tell the user the period of each sine wave. By knowing the period, users can know the operating frequency of each sine wave. Once the frequencies are calculated, they are compared against valid DTMF frequency ranges. If a valid frequency is found to correspond to the row and column of a DMTF tone, a binary output is placed on the output of the CM8870. A control line is driven high on the chip to indicate that a valid code
  • 57. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK has been decoded and is present on the four-bit binary port. This decoded DTMF tone will remain present on the output port until the CM8870 receives an enable signal from the microprocessor controlling circuitry. At this point, the CM8870 will start the DTMF decoding process over. FLOW CHART:
  • 58. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK CODE
  • 59. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK
  • 60. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK
  • 61. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK
  • 62. PSOC LAB REPORT NITC BHUKYA RAMESH NAIK APPLICATIONS: Home Automation Telephone Answering Machine(IVR) Remote controlling System CONCLUSION This project presents a DTMF based home appliances controlling by M8C of PSoC1.Experimental work has been carried out carefully. Here we are controlling 5 home appliances controlling through DTMF technology effectively secured with password and timer. Here very easy to use for any applications with the help of M8C Processor of PSoC1. REFERENCES [1] Embedded Systems- An Integrated Approach by Lyla B. Das. [2] DTMF Based Remote Control System - R. Sharma, K. Kumar, and S. Viq, IEEE International Conference ICIT, pp. 2380-2383, December 2006.