d2automation.ind2automation.in/embedded/project report.doc · web viewhd 44780 based lcds are most...
TRANSCRIPT
EMBEDDED SYSTEM
INDIVIDUAL MODULES
1. Embedded System
2. Microcontroller unit
3. Power Supply
4. Liquid crystal display(LCD)
5. Motor driver
6. Seven segment display
7. Ultrasonic sensor
8. Bluetooth
9. Relay
10. Light emitting diode
11. IR reflector sensor
12. DC motors
13. RFID
14. MQ5
15. Arduino Detail
16. GPS
17. GSM
18. Servo Motor
19. Solar Panel
20. LM35
21. DHT11
22. Fire Sensor
EMBEDDED SYSTEM
Introduction Microcontroller are widely used in Embedded System products. An Embedded product
uses the microprocessor(or microcontroller) to do one task & one task only. A printer
is an example of Embedded system since the processor inside it perform one task only
namely getting the data and printing it. Although microcontroller are preferred choice
for many Embedded systems, There are times that a microcontroller is inadequate for
the task. For this reason in recent years many manufactures of general purpose
microprocessors such as INTEL, Motorolla, AMD & Cyrix have targeted their
microprocessors for the high end of Embedded market.One of the most critical needs
of the embedded system is to decrease power consumptions and space. This can be
achieved by integrating more functions into the CPU chips. All the embedded
processors have low power consumptions in additions to some forms of I/O,ROM all
on a single chip. In higher performance Embedded system the trend is to integrate
more & more function on the CPU chip & let the designer decide which feature he/she
wants to use.
1.1Embedded SystemAn Embedded System employs a combination of hardware & software to perform a specific
function. Software is used for providing features and flexibility hardware(Processors,
Memory...) is used for performance & sometimes security.An embedded system is a special
purpose system in which the computer is completely encapsulated by the device it controls.
Unlike a general purpose computer, such as a PC, an embedded system performs predefined
task’s usually with very specific tasks design engineers can optimize it reducing the size and
cost of the product.
Embedded systems are often mass produced, so the cost savings may be multiplied by millions
of items.The core of any embedded system is formed by one or several microprocessor or
micro controller programmed to perform a small number of tasks. In contrast to a general
purpose computer, which can run any software application, the user chooses, the software on
an embedded system is semi-permanent, so it is often called firmware.
1.3 Examples
1) Automated tiller machines (ATMS).
2) Integrated system in aircraft and missile.
3) Cellular telephones and telephonic switches.
4) Computer network equipment, including routers timeservers and firewalls
5) Computer printers, Copiers.
6) Disk drives (floppy disk drive and hard disk drive)
7) Engine controllers and antilock brake controllers for automobiles.
8) Home automation products like thermostat, air conditioners sprinkles and security
monitoring system.
9) House hold appliances including microwave ovens, washing machines, TV sets DVD
players/recorders.
10) Medical equipment.
11) Measurement equipment such as digital storage oscilloscopes, logic analyzers and
spectrum analyzers.
12) Multimedia appliances: internet radio receivers, TV set top boxes.
13) Small hand held computer with P1M5 and other applications.
14) Programmable logic controllers (PLC’s) for industrial automation and monitoring.
15) Stationary video game controllers.
1.4Microprocessor (MPU) A microprocessor is a general-purpose digital computer central processing unit(CPU).
Although popularly known as a “computer on a chip” is in no sense a complete digital
computer. The block diagram of a microprocessor CPU is shown, which contains an
arithmetic and logical unit (ALU), a program counter (PC), a stack pointer (SP),some
working registers, a clock timing circuit, and interrupt circuits.
Figure 1.1: Block Diagram of Microprocessor.
1.5Microcontroller (MCU)
Figure shows the block diagram of a typical microcontroller. The design incorporates all of
the features found in micro-processor CPU: ALU, PC, SP, and registers. It also added the
other features needed to make a complete computer: ROM, RAM, parallel I/O, serial I/O,
counters, and clock circuit.
Figure 1.2: Block Diagram of Microcontroller.
1.6 Comparision Between Microprocessor And MicrocontrollerThe microprocessor must have many additional parts to be operational as a computer whereas
microcontroller requires no additional external digital parts.
1) The prime use of microprocessor is to read data, perform extensive calculations on that data
and store them in the mass storage device or display it. The prime functions of
microcontroller is to read data, perform limited calculations on it, control its environment
based on these data. Thus the microprocessor is said to be general-purpose digital
computers whereas the microcontroller are intend to be special purpose digital controller.
2) Microprocessor need many opcodes for moving data from the external memory to the CPU,
microcontroller may require just one or two, also microprocessor may have one or two
types of bit handling instructions whereas microcontrollers have many.
3) Thus microprocessor is concerned with the rapid movement of the code and data from the
external addresses to the chip, microcontroller is concerned with the rapid movement of the
bits within the chip.
4) Lastly, the microprocessor design accomplishes the goal of flexibility in the hardware
configuration by enabling large amounts of memory and I/O that could be connected to the
address and data pins on the IC package. The microcontroller design uses much more
limited.
2. THE 8051 ARCHITECTURE
2.1 IntroductionThe Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The
Short and Standard chips are often available in DIP (dual in-line package) form, but the
Extended 8051 models often have a different form factor, and are not "drop-in compatible".
Figure 2.1: Block Diagram of 8051.
All these things are called 8051 because they can all be programmed using 8051 assembly
language, and they all share certain features (although the different models all have their own
special features).Some of the features that have made the 8051 popular are:
4KB on chip program memory.
128 bytes on chip data memory (RAM).
4 register banks.
8-bit data bus.
16-bit address bus.
32 general purpose registers each of 8 bits.
16 bit timers (usually 2, but may have more, or less).
3 Internal and 2 external interrupts.
Bit as well as byte addressable RAM area of 16 bytes.
Four 8-bit ports, (short models have two 8-bit ports).
16-bit program counter and data pointer.
1 Microsecond instruction cycle with 12 MHz Crystal.
8051 models may also have a number of special, model-specific features, such as UARTs,
ADC, OpAmps, etc.
2.2 Typical applications8051 chips are used in a wide variety of control systems, telecom applications, and robotics as
well as in the automotive industry. By some estimation, 8051 family chips make up over 50%
of the embedded chip market. The 8051 has been in use in a wide number of devices, mainly
because it is easy to integrate into a project or build a device around. The following are the
main areas of focus:
2.2.1 Energy Management: Efficient metering systems help in controlling energy usage
in homes and industrial applications. These metering systems are made capable by
incorporating microcontrollers.
2.2.2 Touch screens: A high number of microcontroller providers incorporate touch-
sensing capabilities in their designs. Portable electronics such as cell phones, media
players and gaming devices are examples of microcontroller-based touch screens.
2.2.3 Automobiles: The 8051 finds wide acceptance in providing automobile solutions.
They are widely used in hybrid vehicles to manage engine variants. Additionally,
functions such as cruise control and anti-brake system have been made more
efficient with the use of microcontrollers. So the microcontroller 8051 has great
advantage in the field of the automobiles.
2.2.4 Medical Devices: Portable medical devices such as blood pressure and glucose
monitors use microcontrollers will to display data, thus providing higher reliability
in providing medical results.
2.3 Pin out DescriptionPin 1-8 (Port 1): Each of these pins can be configured as an input or an output.
Pin 9(RST): A logic one on this pin disables the microcontroller and clears the contents of
most registers. In other words, the positive voltage on this pin resets the microcontroller.
Figure 2.2: Pin diagram of the 8051 DIP.
By applying logic zero to this pin, the program starts execution from the beginning. Pin 9 is
the RESET pin. It is an input and is active high. Upon applying a high pulse to this pin the
microcontroller well reset and terminate all activities. This is often referred to as a power on
reset .Activating a power on reset will cause all values the registers to be lost. It will set
program counter to all 0s.In order for the RESET input to be effective it must have a minimum
duration of two machine cycles. In other words the high pulse must be high for a minimum of
two machine cycles before it is allowed to go low.
Pin 10-17(Port 3): Similar to port 1, each of these pins can serve as general input or output.
Besides, all of them have alternative functions:
Pin 10(RXD): Serial asynchronous communication input or Serial synchronous
communication output.
Pin 11(TXD): Serial asynchronous communication output or Serial synchronous
communication clock output.
Pin 12(INT0): Interrupt 0 input.
Pin 13(INT1): Interrupt 1 input.
Pin 14(T0): Counter 0 clock input.
Pin 15(T1): Counter 1 clock input.
Pin 16(WR): Write to external (additional) RAM.
Pin 17(RD): Read from external RAM.
Pin 18, 19(X2, X1): Internal oscillator input and output. The 8051 has an on chip oscillator
but requires an external clock to run it. Most often a quartz crystal oscillator is connected to
inputs XTAL1 (pin 19) and XTAL2 (pin 18). The quartz crystal oscillator connected to
XTAL1 and XTAL2 also needs two capacitors of 30PF value. One side of each capacitor is
connected to the ground. Speed refers to the maximum oscillator frequency connected to
XTAL.
Figure 2.3: Oscillator Circuit and Timing.
Pin 20(GND): Ground.
Pin 21-28(Port 2): If there is no intention to use external memory then these port pins are
configured as general inputs/outputs. In case external memory is used, the higher address byte,
i.e. addresses A8-A15 will appear on this port. Even though memory with capacity of 64Kb is
not used, which means that not all eight port bits are used for its addressing, the rest of them
are not available as inputs/outputs.
Pin 29(PSEN): This is an output pin. PSEN stands for “program store enable”. If external
ROM is used for storing program then a logic zero (0) appears on it every time the
microcontroller reads a byte from memory.
Pin 30(ALE): ALE stands for “address latch enable. It is an output pin and is active high.
When connecting an 8031 to external memory, port 0 provides both address and data. In other
words the 8031 multiplexes address and data through port 0 to save pins. The ALE pin is used
for de-multiplexing the address and data. Prior to reading from external memory, the
microcontroller puts the lower address byte (A0-A7) on P0. In other words, this port is used
for both data and address transmission.
Pin 31(EA): EA which stands for “external access” is pin number 31 in the DIP packages. It
is an input pin and must be connected to either VCC or GND. In other words it cannot be
unconnected. By applying logic zero to this pin, P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. It means that even
there is a program written to the microcontroller, it will not be executed. Instead, the program
written to external ROM will be executed. By applying logic one to the EA pin, the
microcontroller will use both memories, first internal then external (if exists).
Pin 32-39(Port 0): Similar to P2, if external memory is not used, these pins can be used as
general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the ALE
pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low (0).
Pin 40(VCC):+5V power supply.
2.4 PORTS P0-P3All the ports upon RESET are configured as input, since P0-P3 have value FFH on them. The
following is a summary of features of P0-P3.
2.4.1 PORT 0:
Port 0 is also designated as AD0-AD7 allowing it to be used for both address and data. When
connecting an 8051/31 to an external memory, port 0 provides both address and data. The
8051 multiplexes address and data through port 0 to save pins. ALE indicates if p0 has address
A0-A7.in the 8051 based systems where there is no external memory connection the pins of
P0 must be connected externally to 10k-ohm pull-up resistor. This is due to the fact that P0 is
an open drain, unlike P1, P2 and P3. Open drain is a term used for MOS chips in the same way
that open collector is used for TTL chips. In many systems using the 8751, 89c51 or
DS89c4*0 chips we normally connect P0 to pull up resistors.
2.4.2 PORT 1, PORT 2:
In 8051 based systems with no external memory connection both P1 and P2 are used as simple
I/O. however in 8031/51 based systems with external memory connections P2 must be used
along with P0 to provide the 16-bit address for the external memory. P2 is also designated as
A8-A15 indicating its dual function. Since an 8031/51 is capable of accessing 64k bytes of
external memory it needs a path for the 16 bits of address. While P0 provides the lower 8 bits
via A0-a7 it is the job P2 to provide bits A8-A15 of the address. In other words when the
8031/51 is connected to external memory P2 is used for the upper 8 bits of the 16 bit address
and it cannot be used for I/O.
2.4.3 PORT 3:
Port 3 occupies a total of 8 pins 10 through 17. It can be used as input or output. P3 does not
need any pull-up resistors the same as P1 and P2 did not. Although port 3 is configured as
input port upon reset this is not the way it is most commonly used. Port 3 has the additional
function of providing some extremely important signals such as interrupts.
Port 3 Bit Function Pin
P3.0 RXD 10
P3.1 TXD 11
P3.2 INT0 12
P3.3 INT1 13
P3.4 T0 14
P3.5 T1 15
P3.6 WR 16
P3.7 RD 17
Table 2.1: Port 3 Alternate function
2.5 Programming Model of 8051In programming model of 8051 we have different types of registers are available and these
registers are used to store temporarily data is then the information could be a byte of data to be
processed or an address pointing to the data to be fetched the majority of registers is 8051 are
8-bikt registers.
2.6 Accumulator (Register A)Accumulator is a mathematical register where all the arithmetic and logical operations are
done is this register and after execution of instructions the outpour data is stored in the register
is bit addressable near. We can access any of the single bit of this register.A register is a
general-purpose register used for storing intermediate results obtained during operation. Prior
to executing an instruction upon any number or operand it is necessary to store it in the
accumulator first. All results obtained from arithmetical operations performed by the ALU are
stored in the accumulator. Data to be moved from one register to another must go through the
accumulator. In other words, the A register is the most commonly used register and it is
impossible to imagine a microcontroller without it. More than half instructions used by the
8051 microcontroller use somehow the accumulator.
Figure 2.4: Accumulator Register.
2.7 B RegisterB register is same as that of accumulator of. It is also an 8 bit register and every bit of this is
accessible. This is also a mathematical register B which is used mostly for multiplication and
division.
Figure 2.5: B Register.
2.8 PSW (Program Status Word) RegisterProgram status word register is an 8 bit register. It is also referred to as the flag register.
Although the PSW register is 8 bits wide, only 6 bits of it are used by the 8051. The unused
bits are user-definable flags. Four of the flags are called conditional flags, meaning that they
Indicate some conditions that result after an instruction is executed. These four are CY (carry),
AC (auxiliary carry), P (parity) and OV (overflow).
Figure 2.6: Program Status Word Register
PSW register is one of the most important SFRs. It contains several status bits that reflect the
current state of the CPU. Besides, this register contains Carry bit, Auxiliary Carry, two
register bank select bits, Overflow flag, parity bit and user-definable status flag.
BANK RS1 (PSW.4) RS0 (PSW.3)
Bank 0 0 0
Bank 1 0 1
Bank 2 1 0
Bank 3 1 1
Table 2.2: PSW Bit Bank selection.
P (Parity bit): If a number stored in the accumulator is even then this bit will be automatically
set (1), otherwise it will be cleared (0). It is mainly used during data transmit and receive via
serial communication.
Bit 1: This bit is intended to be used in the future versions of microcontrollers.
OV ( Overflow): Occurs when the result of an arithmetical operation is larger than 255 and
cannot be stored in one register. Overflow condition causes the OV bit to be set (1).
Otherwise, it will be cleared (0).
1RS0, RS1 (Register bank select bits): These two bits are used to select one of four register
banks of RAM. By setting and clearing these bits, registers R0-R7 are stored in one of four
banks of RAM.
F0 (Flag 0): This is a general-purpose bit available for use.
AC (Auxiliary Carry Flag): This is used for BCD operations only.
CY (Carry Flag): This is the (ninth) auxiliary bit used for all arithmetical operations and shift
instructions.
2.9 Data Pointer Register (DPTR)DPTR register is not a true one because it doesn't physically exist. It consists of two separate
registers: DPH (Data Pointer High) and (Data Pointer Low). For this reason it may be treated
as a 16-bit register or as two independent 8-bit registers. Their 16 bits are primarily used for
external memory addressing. Besides, the DPTR Register is usually used for storing data and
intermediate results.
Figure 2.7: Data Pointer Register.
2.10 Stack Pointer (SP) Register
Figure 2.8: Stack Pointer Register.
A value stored in the Stack Pointer points to the first free stack address and permits stack
availability. Stack pushes increment the value in the Stack Pointer by 1. Likewise, stack pops
decrement its value by 1. Upon any reset and power-on, the value 7 is stored in the Stack
Pointer, which means that the space of RAM reserved for the stack starts at this location. If
another value is written to this register, the entire Stack is moved to the new memory location.
2.11 Internal MemoryThe 8051 has two types of memory and these are Program Memory and Data Memory.
Program Memory (ROM) is used to permanently save the program being executed, while Data
Memory (RAM) is used for temporarily storing data and intermediate results created and used
during the operation of the microcontroller. 128 or 256 bytes of RAM is used.
2.11.1 Internal RAM
As already mentioned, Data Memory is used for temporarily storing data and intermediate
results created and used during the operation of the microcontroller. Besides, RAM memory
built in the 8051 family includes many registers such as hardware counters and timers,
input/output ports, serial data buffers etc. The previous models had 256 RAM locations, while
for the later models this number was incremented by additional 128 registers. However, the
first 256 memory locations (addresses 0-FFh) are the heart of memory common to all the
models belonging to the 8051 family. Locations available to the user occupy memory space
with addresses 0-7Fh, i.e. first 128 registers. This part of RAM is divided in several blocks.
The first block consists of 4 banks each including 8 registers denoted by R0-R7. Prior to
accessing any of these registers, it is necessary to select the bank containing it. The next
memory block (address 20h-2Fh) is bit- addressable, which means that each bit has its own
address (0-7Fh). Since there are 16 such registers, this block contains in total of 128 bits with
separate addresses (address of bit 0 of the 20h byte is 0, while address of bit 7 of the 2Fh byte
is 7Fh). The third group of registers occupy addresses 2Fh-7Fh, i.e. 80 locations, and does not
have any special functions or features.
Figure 2.9: RAM Memory Space Allocation.
2.11.2 Additional RAM
In order to satisfy the programmers’ constant hunger for Data Memory, the manufacturers
decided to embed an additional memory block of 128 locations into the latest versions of the
8051 microcontrollers. However, it’s not as simple as it seems to be… The problem is that
electronics performing addressing has 1 byte (8 bits) on disposal and is capable of reaching
only the first 256 locations, therefore. In order to keep already existing 8-bit architecture and
compatibility with other existing models a small trick was done. What does it mean? It means
that additional memory block shares the same addresses with locations intended for the SFRs
(80h- FFH). In order to differentiate between these two physically separated memory spaces,
different ways of addressing are used. The SFRs memory locations are accessed by direct
addressing, while additional RAM memory locations are accessed by indirect addressing.
2.11.3 Internal ROM
The first models of the 8051 microcontroller family did not have internal program memory. It
was added as an external separate chip. These models are recognizable by their label
beginning with 803 (for example 8031 or 8032). All later models have a few Kbyte ROM
embedded. Even though such an amount of memory is sufficient for writing most of the
programs, there are situations when it is necessary to use additional memory as well. A typical
example are so called lookup tables. They are used in cases when equations describing some
processes are too complicated or when there is no time for solving them. In such cases all
necessary estimates and approximates are executed in advance and the final results are put in
the tables (similar to logarithmic tables).EA=0In this case, the microcontroller completely
ignores internal program memory and executes only the program stored in external memory.
EA=1In this case, the microcontroller executes first the program from built-in ROM, then the
program stored in external memory. In both cases, P0 and P2 are not available for use since
being used for data and address transmission. Besides, the ALE and PSEN pins are also used.
2.11.4 Memory Expansion
In case memory (RAM or ROM) built in the microcontroller is not sufficient, it is possible to
add two external memory chips with capacity of 64Kb each. P2 and P3 I/O ports are used for
their addressing and data transmission. From the user’s point of view, everything works quite
simply when properly connected because most operations are performed by the
microcontroller itself. The 8051 microcontroller has two pins for data read RD(P3.7) and
PSEN. The first one is used for reading data from external data memory (RAM), while the
other is used for reading data from external program memory (ROM). Both pins are active
low. Even though additional memory is rarely used with the latest versions of the
microcontrollers, we will describe in short what happens when memory chips are connected
according to the previous schematic. The whole process described below is performed
automatically. Similar occurs when it is necessary to read location from external RAM.
Addressing is performed in the same way, while read and write are performed via signals
appearing on the control outputs RD (is short for read) or WR (is short for write).
2.12 Special Function Registers (SFRs)Special Function Registers (SFRs) are a sort of control table used for running and monitoring
the operation of the microcontroller. Each of these registers as well as each bit they include,
has its name, address in the scope of RAM and precisely defined purpose such as timer
control, interrupt control, serial communication control etc. Even though there are 128
memory locations intended to be occupied by them, the basic core, shared by all types of 8051
microcontrollers, has only 21 such registers. Rests of locations are intentionally left
unoccupied in order to enable the manufacturers to further develop microcontrollers keeping
them compatible with the previous versions.
3. POWER SUPPLY
3.1 IntroductionIn most of our electronic products or projects we need a power supply for converting mains
AC voltage to a regulated DC voltage. For making a power supply designing of each and
every component is essential. Here to discuss the designing of regulated 5V Power Supply.
3.2 Block Diagram of Power SupplyFigure 3.1 show the block diagram of power supply. It can be divided into following stages:
Stage1: Transformer
Stage 2: Rectifier
Stage 3: Filter
Stage 4: Regulator
Figure 3.1: Block Diagram of Power Supply.
Figure 3.2: Circuit Diagram of Power Supply.
3.2.1 Transformer
A transformer is a static electrical device that transfers energy by inductive coupling between
its winding circuits. A varying current in the primary winding creates a varying magnetic flux
in the transformer's core and thus a varying magnetic flux through the secondary winding.
This varying magnetic flux induces a varying electromotive force (EMF) or voltage in the
secondary winding. Commonly, transformers are used to increase or decrease the voltages of
alternating current in electric power applications.
A wide range of transformer designs are used in electronic and electric power applications.
Transformers are essential for the transmission, distribution, and utilization of electrical
energy.
Figure 3.3: Centre Tapped Transformer.
3.2.2 Rectifier
A rectifier is an electrical device that converts alternating current (AC), which periodically
reverses direction, to direct current (DC), which flows in only one direction. The process is
known as rectification. Physically, rectifiers take a number of forms, including vacuum tube
diodes, mercury-arc valves, copper and selenium oxide rectifiers, solid-state diodes, silicon-
controlled rectifiers and other silicon-based semiconductor switches. Historically, even
synchronous electromechanical switches and motors have been used. Early radio receivers,
called crystal radios, used a "cat's whisker" of fine wire pressing on a crystal of galena (lead
sulfide) to serve as a point-contact rectifier or "crystal detector".
A more complex circuitry device which performs the opposite function, converting DC to AC,
is known as an inverter.
Rectification based on Full Wave Rectifier either using 4-diode or using 2-diode shown in
Figure 3.4.
Figure 3.4: Rectification.
3.2.3Filter Capacitor
Filter capacitors are capacitors used for filtering of undesirable frequencies. Figure 3.5 show
the Full wave rectifier with a capacitor filter.
Figure 3.5: Full wave rectifier with a capacitor filter.
They are common in electrical and electronic equipment, and cover a number of applications,
such as:
a) Glitch removal on Direct current (DC) power rails
b) Radio frequency interference (RFI) removal for signal or power lines entering or leaving
equipment
c) Capacitors used after a voltage regulator to further smooth dc power supplies
d) Capacitors used in audio, intermediate frequency (IF) or radio frequency (RF) frequency
filters (e.g. low pass, high pass, notch, etc.)
3.2.4 Voltage Regulator
A voltage regulator is designed to automatically maintain a constant voltage level. A voltage
regulator may be a simple "feed-forward" design or may include negative feedback control
loops. It may use an electromechanical mechanism, or electronic components. Depending on
the design, it may be used to regulate one or more AC or DC voltages.
Figure 3.6: LM7805 – Pin Diagram.
Electronic voltage regulators are found in devices such as computer power supplies where
they stabilize the DC voltages used by the processor and other elements. In automobile
alternators and central power station generator plants, voltage regulators control the output of
the plant. As we require a 5V we need LM7805 Voltage Regulator IC shown in Figure 2.6.
7805 IC Rating:
a) Input voltage range 7V- 35V
b) Current rating Ic = 1A
c) Output voltage range VMax=5.2V ,VMin=4.8V.
4. LED
4.1 IntroductionLED falls within the family of P-N junction devices. The light emitting diode (LED) is a diode that will
give off visible light when it is energized. In any forward biased P-N junction there is, with in the
structure and primarily close to the junction, a recombination of hole and electrons.
LED is a component used for indication. All the functions being carried out are displayed bled The LED is
diode which glows when the current is being flown through it in forward bias condition.
Figure 4.1: LED.
The LEDs are available in the round shell and also in the flat shells. The positive leg is longer
than negative leg.
Crystal oscillators are oscillators where the primary frequency determining element is a quartz
crystal. Because of the inherent characteristics of the quartz crystal the crystal oscillator may be held to extreme
accuracy of frequency stability. Temperature compensation may be applied to crystal oscillators to improve
thermal stability of the crystal oscillator. Crystal oscillators are usually, fixed frequency oscillators
where stability and accuracy are the primary considerations. For example it is almost impossible to
design a stable and accurate LC oscillator for the upper HF and higher frequencies without
resorting to some sort of crystal control.
5.LIQUID CRYSTAL DISPLAY
5.1IntroductionLiquid crystal displays (LCD) are widely used in recent years as compares to LEDs. This is
due to the declining prices of LCD, the ability to display numbers, characters and graphics,
incorporation of a refreshing controller into the LCD, their by relieving the CPU of the task of
refreshing the LCD and also the ease of programming for characters and graphics. HD 44780
based LCDs are most commonly used. The LCD, which is used as a display in the system, is
LMB162A. The main features of this LCD are: 16 X 2 display, intelligent LCD, used for
alphanumeric characters & based on ASCII codes. This LCD contains 16 pins, in which 8 pins
are used as 8-bit data I/O, which are extended ASCII. Three pins are used as control lines
these are Read/Write pin, Enable pin and Register select pin. Two pins are used for Backlight
and LCD voltage, another two pins are for Backlight & LCD ground and one pin is used for
contrast change.
5.2 LCD Pin DescriptionLCD voltage The LCD discuss in this section has the most common connector used for the
Hitachi 44780 based LCD is 14 pins in a row and modes of operation and how to program and
interface with microcontroller is describes in this section.
Vcc
1615141312111098
654321
7
1615141312111098
654321
7
D7
E
Vcc
D4
ContrastRS
Gnd
R/W
Gnd
D0
D3
D6D5
13
2
D2D1
Figure 5.1: LCD Pin Description Diagram
5.1.1 VCC, VSS, VEE: The voltage VCC and VSS provided by +5V and ground respectively
while VEE is used for controlling LCD contrast. Variable voltage between Ground and
Vcc is used to specify the contrast (or "darkness") of the characters on the LCD screen.
5.1.2 RS (register select): There are two important registers inside the LCD. The RS pin is
used for their selection as follows. If RS=0, the instruction command code register is
selected, then allowing to user to send a command such as clear display, cursor at
home etc.. If RS=1, the data register is selected, allowing the user to send data to be
displayed on the LCD.
5.1.3 R/W (read/write): The R/W (read/write) input allowing the user to write information
from it. R/W=1, when it read and R/W=0, when it writing.
5.1.4 EN (enable): The enable pin is used by the LCD to latch information presented to its
data pins. When data is supplied to data pins, a high power, a high-to-low pulse must
be applied to this pin in order to for the LCD to latch in the data presented at the data
pins.
5.1.5 D0-D7 (data lines): The 8-bit data pins, D0-D7, are used to send information to the
LCD or read the contents of the LCD’s internal registers. To displays the letters and
numbers, we send ASCII codes for the letters A-Z, a-z, and numbers 0-9 to these pins
while making RS =1. There are also command codes that can be sent to clear the
display or force the cursor to the home position or blink the cursor.
We also use RS =0 to check the busy flag bit to see if the LCD is ready to receive the
information. The busy flag is D7 and can be read when R/W =1 and RS =0, as follows:
if R/W =1 and RS =0, when D7 =1(busy flag =1), the LCD is busy taking care of
internal operations and will not accept any information. When D7 =0, the LCD is ready
to receive new information.
5.3 Interfacing of micro controller with LCD displayIn most applications, the "R/W" line is grounded. This simplifies the application because when
data is read back, the microcontroller I/O pins have to be alternated between input and output
modes.
In this case, "R/W" to ground and just wait the maximum amount of time for each instruction
(4.1ms for clearing the display or moving the cursor/display to the "home position", 160µs for
all other commands) and also the application software is simpler, it also frees up a
microcontroller pin for other uses. Different LCD execute instructions at different rates and to
avoid problems later on (such as if the LCD is changed to a slower unit). Before sending
commands or data to the LCD module, the Module must be initialized. Once the initialization
is complete, the LCD can be written to with data or instructions as required. Each character to
display is written like the control bytes, except that the "RS" line is set. During initialization,
by setting the "S/C" bit during the "Move Cursor/Shift Display" command, after each
character is sent to the LCD, the cursor built into the LCD will increment to the next position
(either right or left). Normally, the "S/C" bit is set (equal to "1")
LC D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
8 Bit Data Busof LCD To MCUPort
Control Pins ofLCD To MCU PortPins
VC C
Figure 5.2: Interfacing of Microcontroller with LCD.
5.4 LCD Command Code
Code
(HEX)
Command to LCD Instruction
Register
1 Clear the display screen
2 Return home
4 Decrement cursor(shift cursor to left)
6 Increment cursor(shift cursor to right)
7 Shift display right
8 Shift display left
9 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on, cursor blinking
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right
18 Shift the entire display to left
1C Shift the entire display to right
80 Force cursor to the beginning of 1st line
C0 Force cursor to the beginning of 2nd line
38 2 line and 5×7 matrix
6. SEVEN SEGMENT DISPLAY
6.1 IntroductionA seven-segment display (SSD), or seven-segment indicator, is a form of electronic display
device for displaying decimal numerals that is an alternative to the more complex dot
matrix displays.
Figure 6.1: Seven segment
6.2 Displaying LetterHexadecimal digits can be displayed on seven-segment displays. A combination of uppercase
and lowercase letters is used for A–F;[6] this is done to obtain a unique, unambiguous shape for
each hexadecimal digit (otherwise, a capital D would look identical to an 0 and a capital B
would look identical to an 8)..
Figure 6.2: Zero Display On a & segment
7. ULTRASONIC SENSOR
7.1 IntroductionThe ultrasonic sensor is used for obstacle detection. Ultrasonic sensor transmits the ultrasonic
waves from its sensor head and again receives the ultrasonic waves reflected from an object.
There are many applications use ultrasonic sensors like instruction alarm systems, automatic
door openers etc. The ultrasonic sensor is very compact and has a very high performance.
Figure 7.1: ultrasonic sensor.
7.2Working principle The ultrasonic sensor emits the short and high frequency signal. These propagate in the air
at the velocity of sound. If they hit any object, then they reflect back echo signal to the
sensor. The ultrasonic sensor consists of a multi vibrator, fixed to the base. The multi
vibrator is combination of a resonator and vibrator. The resonator delivers ultrasonic wave
generated by the vibration. The ultrasonic sensor actually consists of two parts; the emitter
which produces a 40 kHz sound wave and detector detects 40 kHz sound wave and sends
electrical signal back to the microcontroller. The ultrasonic sensor enables the robot to
virtually see and recognize object, avoid obstacles, measure distance. The operating range
of ultrasonic sensor is 10 cm to 30 cm.
Figure 7.2: ultrasonic working principle
7. 3 Applications of Ultrasonic Sensor Automatic change over’s of traffic signals
Intruder alarm system
Counting instruments access switches parking meters
Back sonar of automobile
7.4 Features of Ultrasonic Sensor Compact and light weight
High sensitivity and high pressure
High reliability
Power consumption of 20mA
Pulse in/out communication
Narrow acceptance angle
Provides exact, non-contact separation estimations within 2cm to 3m
The explosion point LED shows estimations in advancement
8. MOTOR DRIVER
8.1 IntroductionAn H bridge is an electronic circuit that allows a voltage to be applied across a load in any
direction. H-bridge circuits are frequently used in robotics and many other applications to
allow DC motors to run forward & backward. These motor control circuits are mostly used in
different converters like DC-DC, DC-AC, AC-AC converters and many other types of power
electronic converters. In specific, a bipolar stepper motor is always driven by a motor
controller having two H-bridges.
8.2 L293D Motor Driver ICL293D IC is a typical Motor Driver IC which allows the DC motor to drive on any direction.
This IC consists of 16-pins which are used to control a set of two DC motors instantaneously
in any direction. It means, by using a L293D IC we can control two DC motors. As well, this
IC can drive small and quiet big motors.This L293D IC works on the basic principle of H-
bridge, this motor control circuit allows the voltage to be flowing in any direction. As we
know that the voltage must be change the direction of being able to rotate the DC motor in
both the directions. Hence, H-bridge circuit using L293D ICs are perfect for driving a motor.
Single L293D IC consists of two H-bridge circuits inside which can rotate two DC motors
separately. Generally, these circuits are used in robotics due to its size for controlling DC
motors.
8.2.1 Pin Diagram of a L293D Motor Driver IC Controller
Pin-1 (Enable 1-2): When the enable pin is high, then the left part of the IC will work
otherwise it won’t work. This pin is also called as a master control pin.
Pin-2 (Input-1): When the input pin is high, then the flow of current will be through
output 1
Pin-3 (Output-1): This output-1 pin must be connected to one of the terminals of the
motor
Pin4 &5: These pins are ground pins
Pin-6 (Output-2): This pin must be connected to one of the terminals of the motor.
Pin-7 (Input-2): When this pin is HIGH then the flow of current will be though output
2
Pin-8 (Vcc2): This is the voltage pin which is used to supply the voltage to the motor.
Pin-16 (Vss): This pin is the power source to the integrated circuit.
Pin-15 (Input-4): When this pin is high, then the flow of current will be through
output-4.
Pin-14 (Output-4): This pin must be connected to one of the terminals of the motor
Pin-12 & 13: These pins are ground pins
Pin-11 (Output-3): This pin must be connected to one of the terminals of the motor.
Pin-10 (Input-3): When this pin is high, then the flow of current will through output-3
Pin-9 (Enable3-4): When this pin is high, then the right part of the IC will work &
when it is low the right part of the IC won’t work. This pin is also called as a master control
pin for the right part of the IC.
Figure 8.1: Motor driver IC
8.3 H Bridge Motor Control Circuit Using L293d ICThe IC LM293D consists of 4-i/p pins where, pin2 and 7 on the left side of the IC and Pin 10
and 15 on the right side of the IC. Left input pins on the IC will control the rotation of a motor.
Here, the motor is connected across side and right i/p for the motor on the right hand side.
Figure 8.2: Block diagram of motor driver circuit
This motor rotates based on the inputs we provided across the input pins as Logic 0 and Logic
When a motor is connected to the o/p pins 3 and 6 on the left side of the IC. For rotating of the
motor in clockwise direction, then the i/p pins have to be provided with Logic 0 and Logic
1.When Pin-2= logic 1 & pin-7 = logic 0, then it rotates in clockwise direction.
Pin-2=logic 0 & Pin7=logic 1, then it rotates in anti clock direction
Pin-2= logic 0 & Pin7=logic 0, then it is idle (high impedance state)
Pin-2= logic 1 & Pin7=logic 1, then it is idle In a similar way the motor can also operate
across input pin-15 and pin-10 for the motor on the right hand side. The L4293D motor driver
IC deals with huge currents, due to this reason, this circuit uses a heat sink to decrease the
heat. Therefore, there are 4-ground pins on the L293D IC. When we solder these pins on the
PCB (printed circuit board), then we can get a huge metallic area between the ground pins
where the heat can be produced.
9. BLUETOOTH
9.1 IntroductionHC-05 module is an easy to use Bluetooth SPP (serial port protocol) module designed for
transparent wireless serial communication setup. Serial port Bluetooth module is fully
qualified Bluetooth V2.0+EDR(enhanced data rate) 3Mbps modulation with complete 2.4Ghz
radio transceiver transceiver and baseband. It uses CSR Bluecore 04 External single chip
Rluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping
Feature).
Figure 9.1: Bluetooth
9.2 Hardware Features
Typical 80dBm sensitivity.
Up to +4dBm RF transmits power.
Three to five Volt I/O.
PI/O(Programmable Input/output) control.
UART interface with programmable baud rate.
With integrated antenna.
With edge connector.
Software Features
Slave default Baud rate: 9600, Data bits:8, Stop bit:1,Parity:No parity.
Auto connect to the last device on power as default.
Permit pairing device to connect as default.
9.3 Pin Description
The HC-05 Bluetooth Module has 6pins. They are as follows:
9.3.1 ENABLE:
When enable is pulled LOW, the module is disabled which means the module will not turn on
and it fails to communicate. When enable is left open or connected to 3.3V, the module is
enabled i.e the module remains on and communication also takes place.
9.3.2 VCC:
Supply Voltage 3.3V to 5V
9.3.3 GND:
Ground pin
9.3.4 TXD & RXD:
These two pins acts as an UART interface for communication
9.3.5 STATE:
It acts as a status indicator.When the module is not connected to / paired with any other
bluetooth device,signal goes Low.At this low state,the led flashes continuously which denotes
that the module is not paired with other device.When this module is connected to/paired with
any other bluetoothdevice,the signal goes High.At this high state,the led blinks with a constant
delay say for example 2s delay which indicates that the module is paired.
Figure 9.2: Pins of Bluetooth
10. IR REFLECTOR SENSOR
10.1 Introduction
An IR transmitter or source converts an electrical signal to an optical signal. The two most
appropriate types of device are the light-emitting diode (LED) and semiconductor laser diode
(LD). LEDs have a naturally wide transmission pattern, and so are suited to non directed links.
Eye safety is much simpler to achieve for an LED than for a laser diode, which usually have
very narrow transmit beams. The principal advantages of laser diodes are their high energy-
conversion efficiency, their high modulation bandwidth, and their relatively narrow spectral
width. Although laser diodes offer several advantages over LEDs that could be exploited, most
short-range commercial systems currently use LEDs.
A receiver or detector converts optical power into electrical current by detecting the photon
flux incident on the detector surface. Silicon p-i-n photodiodes are ideal for wireless infrared
communications as they have good quantum efficiency in this band and are inexpensive.
Avalanche photodiodes are not used here since the dominant noise source is back-ground
light-induced shot noise rather than thermal circuit noise.
1) Transmission wavelength and Noise
The most important factor to consider when choosing a transmission wavelength is the
availability of effective, low-cost sources and detectors. The availability of LEDs and silicon
photodiodes operating in the 800 nm to 1000 nm range is the primary reason for the use of this
band. Another important consideration is the spectral distribution of the dominant noise
source: background lighting.
2) Safety
There are two safety concerns when dealing with infrared communication systems. Eye safety
is a concern because of a combination of two effects: the cornea is transparent from the near
violet to the near IR. Hence, the retina is sensitive to damage from light sources transmitting
in these bands. However, the near IR is outside the visible range of light, and so the eye does
not protect itself from damage by closing the iris or closing the eyelid.
10.2 IR Reflector Circuit
This Circuit is works on reflection of white surface. There are two cases, In First case when IR
LED emits IR rays and reflects from white surface then it is received by photodiode. When IR
rays fall on photodiode then it passes 5V to base of transistor (BC 547).Transistor gets turn on
and passes 5V from collector to emitter. The output of reflector circuit is 0. This zero send to
MCU then MCU take action according to condition which is written in program.
VC C
100K
13
2
D 2
PHOTODIODE
12
Q 1
BC 5 4 72
31
47 E
D 1
IR LED10K
5V
O/ PtoMCU
Figure 10.1: block diagram of IR sensor
In second case when IR LED emits IR rays and absorb by black surface then it is not received
by photodiode. Photodiode remains OFF and it is not pass 5V to base of transistor (BC
547).Transistor remains OFF. The output of reflector circuit is 1.This one send to MCU then
MCU take action according to condition which is written in program.
11. RELAY
11.1 IntroductionA relay is an electrically operated switch. Many relays use an electromagnet to mechanically
operate a switch, but other operating principles are also used, such as solid-state relays. Relays
are used where it is necessary to control a circuit by a separate low-power signal, or where
several circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits as amplifiers: they repeated the signal coming in from one circuit
and re-transmitted it on another circuit. Relays were used extensively in telephone exchanges
and early computers to perform logical operations.
Figure 11.1: pins of relay
11.2 ApplicationsRelays are used wherever it is necessary to control a high power or high voltage circuit with a
low power circuit. The first application of relays was in long telegraph lines, where the weak
signal received at an intermediate station could control a contact, regenerating the signal for
further transmission. High-voltage or high-current devices can be controlled with small, low
voltage wiring and pilots switches. Low power devices such as microprocessors can drive
relays to control electrical loads beyond their direct drive capability. In an automobile, a
starter relay allows the high current of the cranking motor to be controlled with small wiring
and contacts in the ignition key.
12. DC MOTOR
12.1 IntroductionElectrical motors are everywhere around us. Almost all the electro-mechanical movements we
see around us are caused either by an A.C. or a DC motor. Here we will be exploring this
kind of motors. This is a device that converts DC electrical energy to a mechanical energy.
12.2 Principle of DC MotorStructurally and construction wise a direct current motor is exactly similar to a DC generator,
but electrically it is just the opposite. Here we unlike a generator we supply electrical energy
to the input port and derive mechanical energy from the output port
Figure 12.1: left hand rule for finding direction
A DC motor relies on the fact that like magnet poles repel and unlike magnetic poles attract
each other. A coil of wire with a current running through it generates an electromagnetic field
aligned with the center of the coil. By switching the current on or off in a coil its magnetic
field can be switched on or off or by switching the direction of the current in the coil the
direction of the generated magnetic field can be switched 180°. A simple DC motor typically
has a stationary set of magnets in the stator and an armature with a series of two or more
windings of wire wrapped in insulated stack slots around iron pole pieces (called stack teeth)
with the ends of the wires terminating on a commutator. The armature includes the mounting
bearings that keep it in the center of the motor and the power shaft of the motor and the
commutator connections. The winding in the armature continues to loop all the way around
the armature and uses either single or parallel conductors (wires), and can circle several times
around the stack teeth. The total amount of current sent to the coil, the coil's size and what it's
wrapped around dictate the strength of the electromagnetic field created. The sequence of
turning a particular coil on or off dictates what direction the effective electromagnetic fields
are pointed. By turning on and off coils in sequence a rotating magnetic field can be created.
These rotating magnetic fields interact with the magnetic fields of the magnets (permanent
or electromagnets) in the stationary part of the motor (stator) to create a force on the armature
which causes it to rotate. In some DC motor designs the stator fields use electromagnets to
create their magnetic fields which allow greater control over the motor. At high power levels,
DC motors are almost always cooled using forced air.
The commutator allows each armature coil to be activated in turn. The current in the coil is
typically supplied via two brushes that make moving contact with the commutator. Now, some
brushless DC motors have electronics that switch the DC current to each coil on and off and
have no brushes to wear out or create sparks.
Different number of stator and armature fields as well as how they are connected provide
different inherent speed/torque regulation characteristics. The speed of a DC motor can be
controlled by changing the voltage applied to the armature. The introduction of variable
resistance in the armature circuit or field circuit allowed speed control. Modern DC motors are
often controlled by power electronics systems which adjust the voltage by "chopping" the DC
current into on and off cycles which have an effective lower voltage.
Figure 12.2: DC Motor
Since the series-wound DC motor develops its highest torque at low speed, it is often used in
traction applications such as electric locomotives, and trams. The DC motor was the mainstay
of electric traction drives on both electric and diesel-electric locomotives, street-cars/trams
and diesel electric drilling rigs for many years. The introduction of DC motors and
an electrical grid system to run machinery starting in the 1870s started a new second Industrial
Revolution. DC motors can operate directly from rechargeable batteries, providing the motive
power for the first electric vehicles and today's hybrid cars and electric cars as well as driving
a host of cordless tools. Today DC motors are still found in applications as small as toys and
disk drives, or in large sizes to operate steel rolling mills and paper machines.
If external power is applied to a DC motor it acts as a DC generator, a dynamo. This feature is
used to slow down and recharge batteries onhybrid car and electric cars or to return electricity
back to the electric grid used on a street car or electric powered train line when they slow
down. This process is called regenerative braking on hybrid and electric cars. In diesel electric
locomotives they also use their DC motors as generators to slow down but dissipate the energy
in resistor stacks. Newer designs are adding large battery packs to recapture some of this
energy.
12.3 DC Motor has two leads. It has bidirectional motion
If we apply positive to one lead and ground to another motor will rotate in one direction, if
we reverse the connection the motor will rotate in opposite direction.
If we keep both leads open or both leads ground it will not rotate (but some inertia will be
there).
If we apply +ve voltage to both leads then braking will occur.
13. DC MOTOR
13.1 IntroductionRFID or Radio Frequency Identification is a method in which electromagnetic waves are used
for transmitting data for the purpose of identifying tags attached to objects. An RFID system
consists of a transmitter (tag) and a reader. The tag is encrypted with a unique code and the
reader scans this code for the identification purpose. The tags are generally of two types:
active and passive. Active tags have a battery fitted to it and it transmits the unique code
periodically or in the proximity of the reader. Passive tags are powered using the
electromagnetic induction from the signal transmitted by the reader. Typical applications of
RFID are access control systems, ID cards, human identification, animal identification,
payment systems, tagging books, replacing bar codes, tagging merchandise in stores etc .
RFID tags are available in different shapes but the most common shape is in the form of a
card. The RFID readers are available in the market in the form of a module with all the
supporting hardware. This article is about interfacing RFID to 8051 microcontroller. The
images of a typical RFID card and reader are shown below.
Figure 13.1: RF Card and Reader
The RFID card is available in different sizes and shapes and the most commonly used type is
shown above. The image of a typical RFID reader module is also shown above. Basically it
contains a semiconductor memory for storing the unique ID code, modulating circuit and a
coil. The coil acts as the power source by means of electromagnetic induction while in the
vicinity of the reader and it also serves as the antenna for propagating the ID code. The
modulating circuit modulates the unique code into the transmitted wave. The reader basically
contains a coil and an electronic circuit. The coil serves as exciter for the card and also the
antenna for receiving the signal propagated by the card. The electronic circuit demodulates
this signal and converts it into a form suitable for the next stage (microcontroller). Circuit
diagram for interfacing RFID module to 8051 microcontroller is shown below. he full circuit
diagram for interfacing RFID module to 8051 is shown above. The unique ID code in the
RFID card is read by the circuit and displayed on the LED which is connected P0.0 and fake
ID code is detected on P0.7.
Figure 13.2: Interface RF Card and Reader with MCU
14. MQ5
14.1 Introduction
In this guide, we learn how to interface MQ5 Gas sensor (which is a generic Gas Sensor more
suited to detect and determine LPG concentrations) with MCU.
In this tutorial, we are using the MQ5 Gas sensor module (which is widely available in
market) . This module has two output possibilities – an analog out (A0) and a digital out (D0).
The analog out can be used to detect Gas leakage and to measure volume of Gas leakage (by
doing proper calculation of the sensor output inside program) in specific units (say ppm). The
digital out can be used to detect Gas leakage and hence trigger an alert system (say a sound
alarm or an sms activation etc). The digital out gives only two possible outputs – High and
Low (hence its more suited for detection of gas leak than to measure volume of gas presence).
We have developed a Gas Leakage Detector using MCU and MQ5 with SMS Alert, Sound
Alarm and Relay activation. You can try this interesting project to gain more knowledge and
build a practical application using MQ5 sensor.
MQ5_LPG_Sensor_Module
Interfacing MQ5 Gas Sensor Module to Arduino using Digital Out Pin. This is pretty simple.
Connect the D0 pin of MQ5 module to any digital pin of arduino. Lets connect D0 to pin of
MCU. Now we need to give power supply (Vcc) and complete the circuit by connecting to
ground (Gnd). Refer the circuit diagram given below. Take a +5V connection from arduino
and connect it to Vcc of MQ5 module. Finally connect the GND pin of MQ5 module to GND
of arduino. That’s all and we have finished the circuit.
14.2 Circuit Diagram of Interfacing MQ5 to MCU (Digital Out)
15. ARDUINO DETAIL
15.1 IntroductionArduino interface boards provide the engineers, artists, designers, hobbyists and anyone who
tinker with technology with a low-cost, easy-to-use technology to create their creative,
interactive objects, useful projects etc. A whole new breed of projects can now be built that
can be controlled from a computer.
Figure 15.1: Arduino UNO.
Arduino is a open source electronics prototyping platform based on flexible, easy-to-use
hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in
creating interactive objects or environments. It’s an open-source physical computing platform
based on a microcontroller board, and a development environment for writing software for the
board.
In simple words, Arduino is a small microcontroller board with a USB plug to connect to your
computer and a number of connection sockets that can be wired up to external electronics,
such as motors, relays, light sensors, laser diodes, loudspeakers, microphones, etc. They can
either be powered through the USB connection from the computer or from a 9V battery. They
can be controlled from the computer or programmed by the computer and then disconnected
and allowed to work independently.
Anyone can buy this device through online auction site or search engine. Since the Arduino is
an open-source hardware designs and create their own clones of the Arduino and sell them, so
the market for the boards is competitive. An official Arduino costs about $30, and a clone
often less than $20.
The name “Arduino” is reserved by the original makers. However, clone Arduino designs
often have the letters “duino” on the end of their name, for example, Freeduino or DFRduino.
The software for programming your Arduino is easy to use and also freely available for
Windows, Mac, and LINUX computers at no cost.
15.2 Hardware
15.2.1 Arduino Board Layout
Figure 15.2: Arduino Board Layout.
15.2.2 Arduino Pin Diagram
Figure 15.3: Arduino Pin Diagram.
15.2.3 Atmega8 (Microcontroller)
Figure 15.4: Atmega8.
16 MHz
8 Kbyte Flash RAM (1K taken by the boot loader)
1 Kbyte RAM (example for auto/local variables and stack)
14 digital Input/output Ports
15.2.4 Single Chip USB to Asynchronous Serial Data Transfer
Figure 15.5: Android Software Architecture.
USB 2.0 compatible
Transmit and receive LED frive signals
256 Byte receive,128 Byte transmit buffer
Data transfer rate from 300bits/sec to 2 Mb/sec
15.2.5 External Power
Figure 15.6: External Power Source.
Figure 15.7: AC Adapter.
The power requirement for ARDUINO is 9 to 12V DC, 250 mA or more, 2.1mm plug, centre
pin positive.
15.3 The OFF- The Shelf Adapter must be a DC adapter (i.e. it has to put out DC, not AC)
should be between 9V and 12V DC
must be rated for a minimum of 250mA current output, although you will likely want
something more like 500mA or 1A output, as it gives you the current necessary to power a
servo or twenty LEDs if you want to.
must have a 2.1mm power plug on the Arduino end, and
The plug must be "centre positive", that is, the middle pin of the plug has to be the +
connection.
Figure 15.8: AC Adapter.
Current rating: Since you'll probably be connecting other things to the Arduino (LEDs,
LCDs, servos) you should get an adapter that can supply at least 500mA, or even 1000 mA (1
ampere). That way you can be sure you have enough juice to make each component of the
circuit function reliably.
The Arduino's on-board regulator can actually handle up to 20V or more, so you can actually
use an adapter that puts out 20V DC. The reasons you don't want to do that are twofold: you'll
lose most of that voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the
Arduino board will actually be putting out 20V or so, which could lead to potential disaster
when you connect something expensive to what you thought was the 9V pin. Our advice is to
stick with the 9V or 12V DC adapter.
15.4 Applications of ArduinoArduino was basically designs to make the process of using electronics in multidisciplinary
projects more accessible. It is intended for artists, designers, hobbyists, and anyone interested
in creating interactive objects or environments. Arduino can sense the environment by
receiving input from a variety of sensors and can affect its surroundings by controlling lights,
motors, and other actuators. Because of these features, arduino finds extensive application in
various fields. Arduino projects can be stand-alone or they can communicate with software
running on a computer.
Arduino is used by all class of people in a different way. Some students use it in their projects,
some using arduino for fun, some went out to become entrepreneurs. This only show how
useful is this tiny device.
Figure 15.9: Arduino Fever.
ARDUINO is spreading rapidly across the globe. Arduino is actually an open source hardware
project that can be pro grammed to read temperatures, control a motor, and sense touch. The
Arduino is both a cute, blue micro controller platform that fits nicely in the palm of your hand
and an expanding community of developers who support it, distributed across two dozen
countries, four continents, and counting.
The Arduino board is for anyone who wants to build a basic level of intelligence into an
object. Once programmed, it can read sensors, make simple decisions, and control myriad
devices in the real world. Using it is a snap: first, hook up a few sensors and output devices to
the Arduino, and then program it using the free developer’s software. Next, debug your code
and disconnect the Arduino. Then, the little blue Arduino becomes a standalone computer.
The original intention of the Arduino project was to see what would happen if community
support were substituted for the corporate support that is usually required for electronics
development. The first developers — Massimo Banzi, David Cuartielles, David Mellis, and
Nicholas Zambetti — ran a series of workshops on assembling the Arduino, giving away the
board to stimulate development.
Thousands of projects have been done worldwide using this tiny little device. Some of which
to mention are:
1) Simple room temperature readout
2) Interactive real-time auditory feedback system
3) GPS receiver Module
4) Ultrasonic Sensor
5) Infrared detectors
6) SONAR
7) Various sensor projects like
Keypad security code
Sensor tube for heart monitor
Pulse rate monitor
8) Various light projects like
Multicolour light display
Seven-segment LED display
Double seven-segment LED dice
LED array
LCD module
9) Various sound projects like
Oscilloscope
Light harp
VU meter
10) Various power projects like
LCD Thermostat
Computer controlled fan
The hypnotizer
11) Miscellaneous Projects like
Lie detector
Magnetic door lock
Infrared remote
Lilypad binary clock.
16. GPS (GLOBAL POSITIONING SYSTEM)
16.1 IntroductionGPS is a navigation technology which, by use of satellites, tells the precise information about
a location. Basically a GPS system consists of group of satellites and well developed tools
such as receiver. The system, however, should comprise at least four satellites. Each satellite
and the receiver are equipped with stable atomic clock. The satellite clocks are synchronised
with each other and ground clocks. GPS receiver also has a clock but it is not synchronized
and is not stable (less stable). Any deviation of actual time of satellites from ground clock
should be corrected daily. Four unknown quantities (three coordinates and clock deviation
from satellite time) are required to be computed from the synchronized network of satellites
and the receiver. The work of the GPS receiver is to receive signals from the network of
satellites to compute three basic unknown equations of time and position.
Figure 16.1: GPS.
A GPS signal includes a pseudorandom codes and time of transmission and satellite position
at that time. The signal broadcasted by GPS is also called carrier frequency with modulation.
Further, a pseudorandom code is a sequence of zeros and ones. Practically, the receiver
position and the offset of receiver clock relative to receiver system time are computed
simultaneously, using the navigation equations to process time of flight (TOFs). TOF is the
four values that the receiver forms using time of arrival and time of transmission of the signal.
The location is usually converted to latitude, longitude and height relative to geoids
(essentially, mean sea level). Then the coordinates are displayed on the screen.
16.2 Elements of GPS
The structure of the GPS is a complex one. It consists of three major segments of a space
segment, a control segment and a user segment. Launching the satellite into medium earth
orbit is a strenuous job. The space segment comprises 24 to 32 satellites or space vehicles in
the same orbit, 8 each in three circular orbits. At least six satellites are always in line of sight
from almost everywhere on earth’s surface.
Next to space segment is control segment. In control segment there is a master control station,
an alternate master control station, ground antennae and monitor station. The user segment is
composed of thousands of civil, commercial and military positioning service. A GPS receiver
or devise consists of an antenna, tuned to the frequency transmitted by satellites. It also
includes display screen to provide location and time.
A GPS receiver is classified on the number of satellites it can monitor simultaneously, that is
number of channels. Receivers generally have four to five channels but recent advancements
have shown that up to 20 channels have also been made.
Satellite frequency: All satellite broadcast frequencies. The frequency band comprises five
types such as L1, L2, L3, L4, and L5. These bands have frequency ranges between 1176 MHz
to 1600 MHz.
How GPS worksGPS satellites rotate all around the earth two times in a day. It revolves around in a very
accurate course and sends out indication and information to the earth. The receivers of GPS
get all the information and apply triangulation to discover the accurate location of the user.
Fundamentally, the receiver of GPS contrasts the duration at which a signal was spread by a
satellite and allots the time it was received. The time difference formulates how far the
receiver is away from the satellites of the GPS. It measures the exact distance with few more
satellites and the receiver determines the position of the user and displays it on the map of the
electronic appliance.
The receiver must be locked to the signal with at least three satellites to produce a two
dimensional position and also tracks the movement of the user. By using four or more
satellites, the receiver can determine the three dimensional position of the user which consists
of altitude, latitude and longitude. After determining the position of user, the GPS unit
calculates other information such as speed, bearing, track, distance, destination, sunrise, and
sunset time.
How accurate is GPS?The receivers of the GPS are very accurate because of the parallel multi channel design. The
parallel channels are very quick and precise although certain factors like atmospheric noise
and disturbances can perturb and affect the accuracy of GPS receivers at large sometimes.
Users can also get improved precision with Differential GPS (DGPS), which corrects GPS
signals to surrounded by a regular of three to five meters. The U.S. Coast Guard operates the
most common DGPS correction service. The system contains an arrangement of towers that
obtain GPS signals and broadcast an exacted signal by beacon transmitters. With the aim of
getting the exact signal, users must have a differential beacon receiver and beacon antenna
apart from having a GPS.
16.3 GPS Module and Its WorkingGPS stands for Global Positioning System and used to detect the Latitude and Longitude of
any location on the Earth, with exact UTC time (Universal Time Coordinated). This device
receives the coordinates from the satellite for each and every second, with time and date.
Figure 16.2: GPS Module.
GPS module sends the data related to tracking position in real time, and it sends so many data in
NMEA format. NMEA format consist several sentences, in which we only need one sentence. This
sentence starts from $GPGGA and contains the coordinates, time and other useful information. This
GPGGA is referred to Global Positioning System Fix Data.
We can extract coordinate from $GPGGA string by counting the commas in the string. Suppose you
find $GPGGA string and stores it in an array, then Latitude can be found after two commas and
Longitude can be found after four commas. Now these latitude and longitude can be put in other
arrays.
16.4 Sources of GPS Signal ErrorsFactors that can corrupt the precision of GPS signals and thus influence accurateness
incorporate the following:
Ionosphere and troposphere delays - The satellite signal slows down as it crosses the
layers of atmosphere. The GPS system uses a built in model that is used to calculate the
regular duration of hindrance required to correct this type of inaccuracy.
Signal multipath- This error is occurred when the signal is reflected from the objects like
taller buildings and larger rocks before it reaches the receiver. This increases the overall
time duration of the travel of signal and causes errors and inaccuracy.
Orbital errors – These errors are also known as ephemeris errors which are used to
calculate the inaccuracies of the location of the satellite.
Number of satellites visible- accuracy depends on the exact number of satellites that a
GPS receiver can see. The factors like buildings, terrain, electronic interference blocks the
signal accuracy and reception which causes error in position and sometimes no reading in
signals. It typically does not work indoors, underwater and underground.
16.4 ApplicationsNot only for military use is a GPS machine widely known for its use in civil and commercial
services. Some civilian applications are:
[1] Astronomy: Used in Astrometry and celestial mechanics calculations.
[2] Automated vehicles: It is also used in automated vehicles (driverless vehicles) to apply
locations for cars and trucks.
[3] Cellular telephony: Modern mobile phones come equipped with GPS tracking software.
It is present because one can know one’s position and can also track nearby utilities such
as ATMs, coffee shops, restraints, etc. The first cell phone enabled GPS was launched in
1990s. In cellular telephony it is also used in detection for emergency calls and many
other applications.
[4] Disaster relief and other emergency services: In case of any natural disaster, a GPS is a
best tool to identify the location. Even prior to the disasters like cyclones, GPS helps in
calculating the estimated time.
[5] Fleet tracking: GPS is a developer tool known for its potential to track military ships
during the war time.
[6] Car location: A GPS enabled car makes it easier to track its location.
[7] Geo fencing: In geo fencing, we use GPS to track a human, an animal or a car. The
devise is attached to the vehicle, person or on animal’s collar. It provides continuous
tracking and updating.
[8] Geo tagging: one of the major applications is geotagging meaning applying local
coordinates to digital objects.
[9] GPS for mining: Uses centimetre-level positioning accuracy.
[10]GPS tours: helps in determining location of nearby point of interests.
[11]Surveying: Surveyors make use of Global Positioning System to plot maps.
17. GSM (GLOBAL SYSTEM FOR MOBILE COMMUNICATION)
17.1 IntroductionMobile communication is an emerging technology these days. GSM is the acronym for Global
System for Mobile Communication. GSM module is wireless modem that transmits data using
radio waves. GSM architecture is similar to the mobile architecture. GSM modems are
generally used in many electronic applications and they are required to interface with the
microcontrollers.
Figure 17.1: GSM Module SIM 900A.
A GSM Module is basically a GSM Modem (like SIM 900/ 900A/ 800/ 800A ) connected to a
PCB with different types of output taken from the board – say TTL Output (for Arduino, 8051
and other microcontrollers) and RS232 Output to interface directly with a PC (personal
computer). The board will also have pins or provisions to attach mic and speaker, to take out
+5V or other values of power and ground connections. These types of provisions vary with
different modules.
Lots of varieties of GSM modem and GSM Modules are available in the market to choose
from. For our project of connecting a GSM Modem or module to arduino and hence send and
receive SMS using arduino – it’s always good to choose an arduino compatible GSM Module
– that is a GSM module with TTL Output provisions.
GSM Module – Buyers Guide – are you looking to buy a GSM module? There are a handful
of product variants for GSM module – like SIM900, SIM300, and SIM800 etc. We have
created this buyers guide to help you select the right GSM module for your project needs.
17.2 Notes on GSM Module[1] We use SIM900 GSM Module – This means the module supports communication in
900MHz band. We are from India and most of the mobile network providers in this
country operate in the 900 MHz band. If you are from another country, you have to check
the mobile network band in your area. A majority of United States mobile networks
operate in 850 MHz band (the band is either 850 MHz or 1900Mhz). Canada operates
primarily on 1900 MHz band. Please read this wiki entry on GSM Frequency Bands
around the World.
[2] Check the power requirements of GSM module – GSM modules are manufactured
by different companies. They all have different input power supply specs. You need to
double check your GSM modules power requirements. In this tutorial, our GSM
module requires a 12 volts input. So we feed it using a 12V, 1A DC power supply. I
have seen GSM modules which require 15 volts and some other types which needs
only 5 volts input. They differ with manufacturers. If you are having a 5V module, you
can power it directly from Arduino’s 5V out.
Note: - GSM Modules are manufactured by connecting a particular GSM modem to a
PCB and then giving provisions for RS232 outputs, TTL outputs, Mic and Speaker
interfacing provisions etc. The most popular modem under use is SIM 900 GSM
modem from manufacturer SIMCom. They also manufacture GSM Modems in bands
850, 300 and other frequency bands.
[3] Check for TTL Output Pins in the module – You can feed the data from GSM
module directly to Arduino only if the module is enabled with TTL output pins.
Otherwise you have to convert the RS232 data to TTL using MAX232 IC and feed it
to Arduino. Most of the GSM modules in market are equipped with TTL output pins.
Just ensure you are buying the right one.
17.3 GSM Module Interfacing with MCUThe main principle of this circuit is to interface a GSM modem with the microcontroller. To
communicate with GSM modem, AT commands are required. Microcontroller sends these
commands to the GSM modem, which is then activated to perform the required operation.
The following AT commands are frequently used to control the operations of GSM modem
shown Table below:
S/No. Command Operation
1) AT + CSMS Select Message Service
2) AT + CMGF Message Format
3) AT + CMGL List Messages
4) AT + CMGR Read Message
5) AT + CMGS Send Message
6) AT + CMGD Delete Message
7) ATA Answer a call
8) ATD Dial a number
9) ATDL Dial the Last Outgoing Number
10) ATH Hang up the Call
17.4 Booting the GSM Module [1] Insert the SIM card to GSM module and lock it.
[2] Connect the adapter to GSM module and turn it ON!
[3] Now wait for some time (say 1 minute) and see the blinking rate of ‘status LED’ or
‘network LED’ (GSM module will take some time to establish connection with mobile
network)
[4] Once the connection is established successfully, the status/network LED will blink
continuously every 3 seconds. You may try making a call to the mobile number of the sim
card inside GSM module. If you hear a ring back, the GSM module has successfully
established network connection.
Okay! Now let’s see how to connect a GSM module to Microcontroller!
17.5 Connecting GSM Module to MCUThere are two ways of connecting GSM module to arduino. In any case, the communication
between Arduino and GSM module is serial. So we are supposed to use serial pins of Arduino
(Rx and Tx). So if you are going with this method, you may connect the Tx pin of GSM
module to Rx pin of Arduino and Rx pin of GSM module to Tx pin of Arduino. You read it
right ? GSM Tx –> Arduino Rx and GSM Rx –> Arduino Tx. Now connect the ground pin of
arduino to ground pin of gsm module! So that’s all! You made 3 connections and the wiring is
over! Now you can load different programs to communicate with gsm module and make it
work. Interface of GSM with MCU shown in Figure 17.2.
Figure 17.2: Interfacing of GSM with MCU.
18. SERVO MOTOR
18.1 IntroductionServo Motors are used where there is a need for accurate shaft movement or position. These
are not proposed for high speed applications. These are proposed for low speed, medium
torque and accurate position application. These motors are used in robotic arm machines,
flight controls and control systems.
Servo motors are available at different shapes and sizes. A servo motor will have mainly there
wires, one is for positive voltage another is for ground and last one is for position setting. The
RED wire is connected to power, Black wire is connected to ground and YELLOW wire is
connected to signal.
Figure 18.1: Servo Motor.
A servo motor is a combination of DC motor, position control system, gears. The position of
the shaft of the DC motor is adjusted by the control electronics in the servo, based on the duty
ratio of the PWM signal the SIGNAL pin.
Simply speaking the control electronics adjust shaft position by controlling DC motor. This
data regarding position of shaft is sent through the SIGNAL pin. The position data to the
control should be sent in the form of PWM signal through the Signal pin of servo motor.
The frequency of PWM (Pulse Width Modulated) signal can vary based on type of servo
motor. The important thing here is the DUTY RATIO of the PWM signal. Based on this
DUTY RATION the control electronics adjust the shaft.
As shown in figure below, for the shaft to be moved to 9 o’clock the TURN ON RATION
must be 1/18.ie. 1ms of ON time and 17ms of OFF time in a 18ms signal.
Figure 18.2: PWM Pulses for Servo Motor.
For the shaft to be moved to 12o clock the ON time of signal must be 1.5ms and OFF time should be
16.5ms. This ratio is decoded by control system in servo and it adjusts the position based on it.
19. SOLAR PANEL
19.1 IntroductionAs the non renewable energy resources are decreasing, use of renewable resources for
producing electricity is increasing. Solar panels are becoming more popular day by day. Solar
panel absorbs the energy from the Sun and is stored in the battery. This energy can be utilized
when required. Utilization of the energy stored in batteries is mentioned in below given
applications. Solar panels should absorb energy to a maximum extent. This can be done only if
the panels are continuously placed towards Sun direction. So solar panel should continuously
rotate in the direction of Sun. This article describes about circuit that rotates solar panel.
Figure 19.1: Sun Tracking Solar Panel Circuit Diagram.
19.2 Sun Tracking Solar Panel PrinciplesThe Sun tracking solar panel consists of two LDRs, solar panel and servo motor and Arduino
Micro controller. Two light dependent resistors are arranged on the edges of the solar panel.
Light dependent resistors produce low resistance when light falls on them. The stepper motor
connected to the panel rotates the panel in the direction of Sun. Panel is arranged in such a
way that light on two LDRs is compared and panel is rotated towards LDR which have high
intensity i.e. low resistance compared to other. Servo motor rotates the panel at certain angle.
When the intensity of the light falling on right LDR is more, panel slowly moves towards right
and if intensity on the left LDR is more, panel slowly moves towards left. In the noon time,
Sun is ahead and intensity of light on both the panels is same. In such cases, panel is constant
and there is no rotation.
19.3 Advantages of Sun Tracking Solar Panel The solar energy can be reused as it is non renewable resource.
This also saves money as there is no need to pay for energy used.
19.4 Sun Tracking Solar Panel Applications These panels can be used to power the traffic lights and streetlights
These can be used in home to power the appliances using solar power.
These can be used in industries as more energy can be saved by rotating the panel.
19.5 Limitations of Sun Tracking Solar Panel Circuit Though solar energy can be utilized to maximum extent this may create problems in rainy
season.
Although solar energy can be saved to batteries, they are heavy and occupy more space
and required to change time to time.
They are expensive.
20. LM35
20.1 IntroductionLM35 is an analog, linear temperature sensor whose output voltage varies linearly with
change in temperature. LM35 is three terminal linear temperature sensors from National
semiconductors. It can measure temperature from-55 degree Celsius to +150 degree Celsius.
The voltage output of the LM35 increases 10mV per degree Celsius rise in temperature. LM35
can be operated from a 5V supply and the stand by current is less than 60uA. The pin out of
LM35 is shown in the figure below.
We are using Arduino Uno as our board and LM35 can be connected to arduino as shown in
circuit diagram.
20.2 Circuit Diagram without LCD:
Figure 20.1: LM 35 interfaces with Arduino.
Note: - LM35 is an analog temperature sensor. This means the output of LM35 is an analog
signal. Microcontrollers don’t accept analog signals as their input directly. We need to convert
this analog output signal to digital before we can feed it to a microcontroller’s input. For this
purpose, we can use an ADC (Analog to Digital Converter). If we are using a basic
microcontroller like 8051, we need to use an external ADC to convert analog output from
LM35 to digital. We then feed the output of ADC (converted digital value) to input of 8051.
But modern day boards like Arduino and most modern day micro controllers come with
inbuilt ADC. Our arduino Uno has an in built 10 bit ADC (6 channel). We can make use of
this in built ADC of arduino to convert the analog output of LM35 to digital output. Since
Arduino Uno has a 6 channel inbuilt ADC, there are 6 analog input pins numbered from A0 to
A5. Connect analog out of LM35 to any of these analog input pins of arduino.
20.3 Circuit Diagram with LCD:
Figure 20.2: Lm35 and LCD interface with Arduino.
Connect LM35 to Arduino uno as shown in circuit diagram. The +5v for LM35 can be taken
from the +5v out pin of arduino uno. Also the ground pin of LM35 can be connected to GND
pin of arduino uno. Connect Vout (the analog out of LM35) to any of the analog input pin of
arduino uno. In this circuit diagram, we have connected Vout of LM35 to A1 of arduino.
Note:- LM35 is available in the market in 3 series variations – LM35A, LM35C and LM35D
series. The main differences between these 3 versions of LM35 IC are in their range of
temperature measurements. The LM35D series is designed to measure from 0 degree Celsius
to 100 degree Celsius, where as the LM35A series is designed to measure a wider range of -55
degree Celsius to 155 degree Celsius. The LM35C series is designed to measure from -40
degree Celsius to 110 degree Celsius.
20.4 LM35 Pin Diagram:LM35 is a precision IC temperature sensor with its output proportional to the temperature (in oC). The sensor circuitry is sealed and therefore it is not subjected to oxidation and other
processes. With LM35, temperature can be measured more accurately than with a thermistor.
It also possess low self heating and does not cause more than 0.1 oC temperature rise in still
air. The operating temperature range is from -55°C to 150°C. The output voltage varies by
10mV in response to every oC rise/fall in ambient temperature, i.e., its scale factor is 0.01V/ oC.
Figure 20.3: Pin Diagram.
20.5 Pin Description:
Pin No. Function Name
1 Supply Voltage; 5V (+35V to -2V) VCC
2 Output Voltage; (+6V to -1V) Output
3 Ground; (0V) Ground
21. DHT-11
21.1 IntroductionDHT11 is basically a temperature as well as humidity sensor. It is made up of two different
parts i.e. capacitive humidity sensor and a thermistor. DHT11 is a slow sensor but is quite
efficient for the applications where we need to do some basic analog data exchange. There is a
small chip inside this sensor which performs the function of analog to digital to analog
conversion and gives the results for temperature as well as for humidity in digital form. This
digital signal can be read easily through any micro-controller.
LM335 is another temperature sensor and to understand today’s post more properly, you
should also go through Introduction to LM335. DHT11 is a low cost sensor and is easily
available in the market now days. This property makes it more popular among the similar type
of sensors. It provides precise results with the higher efficiency. It has small size and low
power consumption. It can transmit the signal up to 20 meters. It has four pins whose detail
will be explained later. DHT11 has a lot of features including low cost, long term stability, fast
response time, excellent quality, long distance signal transmission and many more. In real life
DHT11 can be used at several different places e.g. home appliances, weather stations,
consumer goods etc. the further detail about DHT11 Arduino shown below
Figure 21.1: DHT11 Interface with Arduino.
DHT11 is an electronic device which is used to measure the temperature and humidity in real
environment. It consists of two part capacitive humidity sensor and thermistor. It is a low cost
device but provides excellent and precise results. It has an internal small chip used for analog
to digital conversions and to provide digital output. We can read this digital output easily
through any of the micro-controller. In this tutorial I am using Arduino UNO as a micro-
controller. It can be used in home appliances, weather stations, medical humidity control, data
loggers, HVAC and at several different places. DHT11 along with its pin names is shown in
the figure given below.
Figure 21.2: DHT11 Pins.
21.2 DHT11 Pins1) DHT11 temperature sensor has total four pins; each of them has different tasks to
perform.
2) All of the four pins are given in the table shown in the figure given below.
DHT11 Pins
Pin No. Pin Name Description
1 VCC Voltage Supply (5V)
2 OUT Output pin for reading DHT11 data
3 NULL Not used in this case
4 GND Ground (0V)
22. Fire Sensor
22.1 IntroductionBuild fire alarm or fire detector using Flame sensor and Arduino board, the sensor basically
detects IR (Infra Red) light wavelength between 760 nm – 1100 nm (nano meter) that is
emitted from fire flame. Most of the flame sensors came with YG1006 sensor which is a high
speed and high sensitive NPN silicon photo transistor. It is covered with black epoxy, since
the sensor is sensitive to infrared radiation. By using this concept project you can understand
how to monitor and alert about fire flame, It is most suitable for fire fighting robot, fire alarm
etc.., figure show flame sensor.
Figure 22.1: Flame Sensor.
The flame sensors available in the market with two categories one is having three pins (D0,
Gnd, Vcc) and second one is having four pins (A0, D0, Gnd, Vcc) both are can be easily
interfaced with Arduino and arduino compatible boards.