Touchscreen Report
Touchscreen Report
The aim of this project is to build a Touch Screen based application interface for high
voltage electrical lamp dimming operation over wireless. The program running inside
microcontroller can develop a virtual on screen keypad and a control panel. The status of lamp
intensity can be viewed on mobile screen. No need to have mechanical rotational based control
system or push buttons for this operation. Users can control the lamp intensity with gentle
finger touch.
1
SYNOPSIS
The project aims in designing a system which helps in increasing or decreasing lamp
intensity as required with simple touch. 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
2
CHAPTER – 1
2 . Receiver
RF TRIAC TRIAC
Rx driver
Micro
RF Reset LAMP
controller
Decoder
SL.NO SWITCH NO % OF
BRIGHTNESS
1 1 10
2 2 30
3 3 50
4 4 80
5 5 100
4
CHAPTER 2
5
2.2. CIRCUIT DIAGRAM DESCRIPTION:
6
CHAPTER 3
HARDWARE DESCRIPTION
POWER SUPPLY
SOFTWARE
7
DESCRIPTION OF EQUIPMENT
3.1.1. Introduction
The central processing unit can execute some instructions resulting in some outcomes.
This instructions define the architecture of the controllers central processor in a macro scale.
This gives rise to the a major classifications in processor architecture as
To learn about controllers, processors and architectures in a general and abstract manner
is tedious, time consuming and at-times dry. So here we are considering a simple
microcontroller – the PIC 16F877a as an example to begin with PIC 16F877a is a mid-range
microcontroller from microchip inc (www.microchip.com). It is a CMOS FLASH-based 8-bit
microcontroller with a RISC architecture that can handle 35 instructions. When studying any
electronic device or part, the bible is its datasheet.
The data sheet describes in detail the architecture, capabilities and requirements of the
part. PIC16F877a ‘s datasheet can be found here. Download it and keep it for further reference
throughout the tutorial. A printout of section 15 of the datasheet (only 6 pages) will be a great
help during the programming exercises.
8
3.1.2. Architecture – A General Introduction
The firmware (program) resides in the program memory. Once the processor is reset
and ready to go, the program counter, which is simply a counter that acts as a pointer to the
program instructions points to the initial location of the program memory.
The execution unit fetches the program instruction in this first location. This will be one
of the 35 instructions that the PIC can handle in our case. These instructions are stored in the
program memory in an encoded fashion. It will be a binary number that has encoded
9
information relevant to the instruction.For example, the instruction movlw 0xff will be
encoded as 11 0000 11111111 when stored in the PIC 16f877a program memory.
This 14 bit encoded binary contains the instruction, the scratch pad memory location to be
used and the literal value 0xff. A complete list of instructions and their encoding is given in
page 160 of the datasheet.
The task of the execution unit, in simple words, is to fetch the instructions pointed to by
the program counter (PC), understand it (Decode) and execute it.Execution of a command can
include a wide variety of tasks like moving some data from one RAM location to another, or
storing it in a non-volatile, EEPROM location, or communicating with an external device like
a PC. These tasks vary from micro controller to micro controller. A user side view of these
tasks can be obtained by analyzing the instruction set of the specific device we are planning to
use.
RAM is the volatile memory integrated within the controller package. It provides
working space for the data manipulation during the command execution. The amount of RAM
available is an important metric as the speed of operation and instruction set for a micro
controller. Scratch pad memory registers are high speed memory registers which are integral to
10
the processing center architecture. The concept is from processor architecture, since the
external memory access which will be much slower can be a bottleneck to the high speed
operations within the processor. Microcontrollers usually have one or two such registers only.
Based on the memory organization, processor architectures can be divided into two as
Our point of interest here is that the Von Neumann architecture has a common bus for
program memory and data memory (RAM), where as the Havard architecture maintains
separate buses.PIC 16F877a has the Havard architecture, as it can be noticed from the
architecture diagram above.
We will analyze the architecture in light of the general introduction in the previous
section. The blocks are identified below.
The instructions are encoded and stored in the non-volatile Flash Program memory.
Upon reset, the program counter points to memory location 0x00. This point is the reset vector
and contains the first instruction of the steps that are to be done once the controller is reset.
Details of the actual reset mechanism and other details will be dealt with later on. Under
regular circumstances, the program counter increments by one every execution cycle
11
(explained later, as of now, consider it as each clock). This new location is used by the
execution unit to fetch the next instruction.
The stack has 8 levels. i.e the PIC can perform upto 8 jump instructions after which it can
return to the original location without errors in execution.A detailed explanation if the
instruction set will follow later on in the tutorial, but for easy understanding of many of the
concepts, it is advised to thoroughly go through the instruction set summary given in
section 15 of the datasheet (6pages) before proceeding further. A port is the microcontrollers
interface into the real world. All the data manipulation and operations that are done within the
microcontroller ultimately manifests as output signals through the ports.
To make the concept clear, let us consider an air conditioning system built around a
microcontroller. The temperature sensors measure the room temperature and give it as input to
the microcontroller through the ports. The data coming in through the ports will be stored in
some GPR by the microcontroller. The data in this GPR will be compared against a set
temperature. If the external temperature reported by the sensor is higher that the threshold, the
microcontroller switches on the air conditioning mechanism. This is done by switching on the
corresponding port pin.
Physically, ports are some of the pins that are seen in the IC package. There are 6 ports
for PIC 16f877a. They are named as PORTA, PORTB, PORTC, PORTD and PORTE. Ports
B, C and D are 8 bit wide (8 pins each), while PORTA is 5bitand PORTE is 3 bit wide. The
pin allocations of the ports are given in the IC pin diagram in page 3 of the data sheet and is
reproduced below. The individual port pins are named 0 through. For eg. 1st pin of PORTA
will be RA0.
13
3.1.4. Pin Diagram Of PIC16F877A
As it can be seen from the pin diagram, the port pins are bi-directional and and most of
them are multiplexed in function. i.e the pins act as regular general purpose I/O as required for
the air conditioning example, or as the I/O s of some of the internal modules of the
microcontroller. For example, port pins RC7 and RC6 (pin number 25 and 26) are regular I/Os
as well as the interface to the UART module that handles the RS-232 protocol, which is
commonly used to interface the PIC to a regular computer.
The RS-232 based UART module requires only two data lines to effectively transmit
and receive data from a regular computer to the PIC or even a printer or PDA with a serial
14
port. This module is integrated into the PIC package and can be configured using firmware
instructions. Exact way of doing this will be discussed later.
Each port has a corresponding SFR in the RAM register block. Therefore, when we are
referring to switching a port pin on as in the air conditioner, it is actually writing data into the
corresponding port register. Similarly, receiving data from the registers is actually, reading the
data stored in the corresponding data register.
Along with the data holding port registers, there is a set of configuration registers
associated with the ports. These are the TRIS registers that configure the ports to be in input or
output mode. These also reside in the RAM register banks as SFRs. Writing a 1 into the
corresponding TRIS bit configure the port pin as an input pin, and the data coming in through
the port pin will be latched into the corresponding PORT bit in the immediately next execution
cycle.
The code snippet below is to read a byte from PORTB and write it to file
location 0x120. Note that the TRIS registers are in bank1 whereas the PORT registers are in
bank 0 and file register 0x120 is in bank 2. This bank selection concept is to be kept in mind
whenever we are dealing with RAM registers of the PIC. The list bank location listing is in
page 17of the data sheet.
A touch screen is an electronic visual display that the user can control through simple or
multi-touch gestures by touching the screen with one or more fingers. Some touchscreens can
also detect objects such as a stylus or ordinary or specially coated gloves. The user can use the
touchscreen to react to what is displayed and to control how it is displayed (for example by
zooming the text size).
The touchscreen enables the user to interact directly with what is displayed, rather than
using a mouse, touchpad, or any other intermediate device (other than a stylus, which is
15
optional for most modern touchscreens). Touch screens are common in devices such as game
consoles, all-in-one computers, tablet computers, and smartphones. They can also be attached
to computers or, as terminals, to networks. They also play a prominent role in the design of
digital appliances such as personal digital assistants (PDAs), satellite navigation devices,
mobile phones, and video games.
The popularity of smart phones, tablets, and many types of information appliances is
driving the demand and acceptance of common touchscreens for portable and functional
electronics. Touchscreens are popular in the medical field and in heavy industry, as well as in
kiosks such as museum displays or room automation, where keyboard and mouse systems do
not allow a suitably intuitive, rapid, or accurate interaction by the user with the display's
content.
Historically, the touch screen sensor and its accompanying controller-based firmware
have been made available by a wide array of after-market system integrators, and not by
display, chip, or motherboard manufacturers. Display manufacturers and chip manufacturers
worldwide have acknowledged the trend toward acceptance of touchscreens as a highly
desirable user interface component and have begun to integrate touchscreens into the
fundamental design of their products.
Resistive touchscreen
A resistive touchscreen panel comprises several layers, the most important of which are
two thin, transparent electrically-resistive layers separated by a thin space. These layers face
each other with a thin gap between. The top screen (the screen that is touched) has a coating on
the underside surface of the screen. Just beneath it is a similar resistive layer on top of its
substrate. One layer has conductive connections along its sides, the other along top and
bottom. A voltage is applied to one layer, and sensed by the other. When an object, such as a
fingertip or stylus tip, presses down on the outer surface, the two layers touch to become
connected at that point: The panel then behaves as a pair of voltage dividers, one axis at a
16
time. By rapidly switching between each layer, the position of a pressure on the screen can be
read.
Resistive touch is used in restaurants, factories and hospitals due to its high resistance
to liquids and contaminants. A major benefit of resistive touch technology is its low cost.
Additionally, as only sufficient pressure is necessary for the touch to be sensed, they may be
used with gloves on, or by using anything rigid as a finger/stylus substitute. Disadvantages
include the need to press down, and a risk of damage by sharp objects. Resistive touchscreens
also suffer from poorer contrast, due to having additional reflections from the extra layer of
material placed over the screen.
Surface acoustic wave (SAW) technology uses ultrasonic waves that pass over the
touchscreen panel. When the panel is touched, a portion of the wave is absorbed. This change
in the ultrasonic waves registers the position of the touch event and sends this information to
the controller for processing. Surface wave touchscreen panels can be damaged by outside
elements. Contaminants on the surface can also interfere with the functionality of the
touchscreen.
17
Fig 3.5 Using UA 741 op-amp IC
As shown in the waveform, for a reference voltage 0V, when the input sine wave passes
through zero and goes in positive direction, the output voltage Vout is driven into negative
saturation. Similarly, when the input voltage passes through zero and goes in the negative
direction, the output voltage is driven to positive saturation. The diodes D1 and D2 are also
called clamp diodes. They are used to protect the op-amp from damage due to increase in input
voltage. They clamp the differential input voltages to either +0.7V or -0.7V.
18
In certain applications, the input voltage may be a low frequency waveform. This
means that the waveform only changes slowly. This causes a delay in time for the input
voltage to cross the zero-level. This causes further delay for the output voltage to switch
between the upper and lower saturation levels. At the same time, the input noises in the op-
amp may cause the output voltage to switch between the saturation levels. Thus zero crossing
are detected for noise voltages in addition to the input voltage. These difficulties can be
removed by using a regenerative feedback circuit with a positive feedback that causes the
output voltage to change faster thereby eliminating the possibility of any false zero crossing
due to noise voltages at the op-amp input.
19
Fig 3.6 Using 741 IC Waveforms
For an input sine wave, the output of the zero-crossing detector being a square wave, is
further passed through an RC series circuit. This is shown in the figure below.
If the time constant RC is very small compared to the period T of the input sine wave, then the
voltage across R of the RC circuit network called Vr will be a series of positive and negative
pulses. If the voltage Vr is applied to a clipper circuit using a diode D, the load voltage Vload
will have only positive pulses and will clip away the negative pulses. Thus, a zero-crossing
detector whose input is a sign wave has been converted into a train of positive pulses at
interval T by adding a RC network and a clipping circuit.
20
Fig 3.8 Timing Marker Generator Waveform
A zero-crossing detector can be used for the measurement of phase angle between two
voltages. The working will be the same as explained in the above circuit. A train of pulses in
the positive and negative cycles are obtained and the time interval between the pulse of sine
21
wave voltage and that of second sine wave voltage is measured. This interval of time is
proportional to the phase difference between the two input sine wave voltages. The range of
use of phasemeter for measurement is 0° to 360°.
A zero-crossing detector using an 8 pin DIP unit 311 IC is shown in the figure below.
The output of the 311 op-amp IC is connected to an open collector NPN transistor. A 20
kiloohm load resistor is connected to the output of the transistor.
For a positive input signal, that is, for an input sine wave above 0 volt, the output of the
op-amp sets the transistor OFF, and the output of the transistor goes HIGH. The low condition
resembles a -10 volt in the circuit and a HIGH condition resembles -10 volt in the circuit.
22
The output of the transistor indicates whether the input is more than or less than 0 volt.
In short, if the input signal is a positive voltage, the output of the transistor will be LOW. If the
input signal is a negative voltage, the output of the transistor will be HIGH.
3.5.1. Introduction
The ac voltage, typically 220V rms, is connected to a transformer, which steps that ac
voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave
rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage.
This resulting dc voltage usually has some ripple or ac voltage variation.
A regulator circuit removes the ripples and also remains the same dc value even if the
input dc voltage varies, or the load connected to the output dc voltage changes. This voltage
regulation is usually obtained using one of the popular voltage regulator IC units.
IC REGULATOR
TRANSFORMER RECTIFIER FILTER LOAD
Transformer
The transformer will step down the power supply voltage (0-230V) to (0-6V) level.
Then the secondary of the potential transformer will be connected to the precision rectifier,
which is constructed with the help of op–amp. The advantages of using precision rectifier are
it will give peak voltage output as DC; rest of the circuits will give only RMS output.
23
Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called as bridge
rectifier. The input to the circuit is applied to the diagonally opposite corners of the network,
and the output is taken from the remaining two corners.
Let us assume that the transformer is working properly and there is a positive potential,
at point A and a negative potential at point B. the positive potential at point A will forward
bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At this time D3
and D1 are forward biased and will allow current flow to pass through them; D4 and D2 are
reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL, through D3,
through the secondary of the transformer back to point B. this path is indicated by the solid
arrows. Waveforms (1) and (2) can be observed across D1 and D3.
One-half cycle later the polarity across the secondary of the transformer reverse,
forward biasing D2 and D4 and reverse biasing D1 and D3. Current flow will now be from
point A through D4, up through RL, through D2, through the secondary of T1, and back to
point A. This path is indicated by the broken arrows. Waveforms (3) and (4) can be observed
across D2 and D4. The current flow through RL is always in the same direction. In flowing
through RL this current develops a voltage corresponding to that shown waveform (5). Since
current flows through the load (RL) during both half cycles of the applied voltage, this bridge
rectifier is a full-wave rectifier.
One advantage of a bridge rectifier over a conventional full-wave rectifier is that with a
given transformer the bridge rectifier produces a voltage output that is nearly twice that of the
conventional full-wave circuit.
24
This may be shown by assigning values to some of the components shown in views A
and B. assume that the same transformer is used in both circuits. The peak voltage developed
between points X and y is 1000 volts in both circuits. In the conventional full-wave circuit
shown—in view A, the peak voltage from the center tap to either X or Y is 500 volts. Since
only one diode can conduct at any instant, the maximum voltage that can be rectified at any
instant is 500 volts.
The maximum voltage that appears across the load resistor is nearly-but never exceeds-
500 v0lts, as result of the small voltage drop across the diode. In the bridge rectifier shown in
view B, the maximum voltage that can be rectified is the full secondary voltage, which is 1000
volts. Therefore, the peak output voltage across the load resistor is nearly 1000 volts. With
both circuits using the same transformer, the bridge rectifier circuit produces a higher output
voltage than the conventional full-wave rectifier circuit.
IC voltage regulators
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the
circuitry for reference source, comparator amplifier, control device, and overload protection all
in a single IC. IC units provide regulation of either a fixed positive voltage, a fixed negative
voltage, or an adjustable set voltage. The regulators can be selected for operation with load
currents from hundreds of milliamperes to tens of amperes, corresponding to power ratings
from milliwatts to tens of watts.
The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts.
Similarly, the series 79 regulators provide fixed negative regulated voltages from 5 to 24 volts.
25
Fig: 3.11 Circuit diagram (Power supply)
26
SOFTWARE TOOLS
MPLAB
MPLAB IDE is an integrated development environment that provides development
engineers with the flexibility to develop and debug firmware for various Microchip devices.
Assemble, compile and link source code using various language tools. An assembler,
linker and librarian come with MPLAB IDE. C compilers are available from Microchip
and other third party vendors.
Debug the executable logic by watching program flow with a simulator, such as
MPLAB SIM, or in real time with an emulator, such as MPLAB ICE. Third party
emulators that work with MPLAB IDE are also available.
Program firmware into devices with programmers such as PICSTART Plus or PRO
MATE II.
Find quick answers to questions from the MPLAB IDE on-line Help
MPLAB SIMULATOR
MPLAB SIM is a discrete-event simulator for the PIC microcontroller (MCU) families.
It is integrated into MPLAB IDE integrated development environment. The MPLAB
27
SIM debugging tool is designed to model operation of Microchip Technology's PIC
microcontrollers to assist users in debugging software for these devices
IC PROG
The PRO MATE II is a Microchip microcontroller device programmer. Through
interchangeable programming socket modules, PRO MATE II enables you to quickly and
easily program the entire line of Microchip PICmicro microcontroller devices and many of the
Microchip memory parts.
PRO MATE II may be used with MPLAB IDE running under supported Windows OS's
(see Read me for PRO MATE II.txt for support list), with the command-line controller
PROCMD or as a stand-alone programmer
The PIC start plus programmer gives the product developer ability to program user
software in to any of the supported microcontrollers. The PIC start plus software running
under MPLAB provides for full interactive control over the programmer.
28
TRIAC CONTROL CIRCUIT
TRIAC
A TRIAC, or TRIODE for alternating current is an electronic component approximately
equivalent to two silicon-controlled rectifiers (SCRs/Thyristors) joined in inverse parallel
(paralleled but with the polarity reversed) and with their gates connected together. This results
in a bidirectional electronic switch which can conduct current in either direction when it is
triggered (turned on). It can be triggered by either a positive or a negative voltage being
applied to its gate electrode.
Once triggered, the device continues to conduct until the current through it drops below
a certain threshold value, such as at the end of a half-cycle of alternating current (AC) mains
power. This makes the TRIAC a very convenient switch for AC circuits, allowing the control
of very large power flows with milliampere-scale control currents. In addition, applying a
trigger pulse at a controllable point in an AC cycle allows one to
29
Fig: 3.13 Triac
control the percentage of current that flows through the TRIAC to the load (so-called phase
control).
30
CHAPTER – 4
PCB DESIGN
CONTROLLER DESIGN
31
POWER SUPPLY DESIGN
32
SOFTWARE REQUIRED
Embedded C.
PIC Boot loader.
CCS C Complier
33
CHAPTER – 5
PROGRAM CODING
34
CHAPTER – 6
APPLICATION
2. Home usages
35
CHAPTER 7
COST ESTIMATION
36
CHAPTER 8
CONCLUSION
Though the Touch screen technology contains some limitations it is user friendly, fast,
accurate and easy to operate. In our presentation, we will touch on the history behind touch
screen technology while also explaining in detail how the different methods of touch screen
technologies work. More specifically, we will spend a considerable amount of time describing
the different technologies found in devices that use touch screen. We will also delve into the
The objective of the project is to realise the smart living, more specifically the home lighting
control system using Bluetooth Technology. Robot and smartphones are a perfect match,
especially mobile robots. As phones and mobile devices are each time more powerful, using
them as robot for building robot with advanced feature such as voice recognition. Android blue
tooth-enable phones and Bluetooth module communication among blue tooth devices. It is
concluded that smart living will gradually turn into reality that consumer can control their
home remotely and wirelessly.
FUTURE WORK:
The knowledge is ever expanding and so are the problems which the mankind
strive to solve. In this spirit, it is hoped that the current activity will lead to further
enhancements. For example; work on future for military purpose by the robot.
37
CHAPTER 9
BIBLIOGRAPHY
Remote Healthcare Monitoring System for Drivers Community Based On IOT, Shilpa
D.Choudhari. International Journal of Emerging Technologies in Engineering Research
(IJETER) , Volume 4, Issue 7, July (2016).
S.M.RIAZUL ISLAM1, DAEHAN KWAK “The Internet of Things for Health Care: A
Comprehensive Survey” 2015 IEEE ACCESS.
CHEN Xican, Woogeun RHEE, WANG Zhihua “Low Power Sensor Design for IoT
and Mobile Healthcare Applications”.
REFERRED WEBSITES
https://en.wikipedia.org
http://electronicsforu.com/newelectronics
http://pic-microcontroller.com
38
CHAPTER 10
PHOTO COPY
39
40