Data RF
Data RF
Data RF
OVERVIEW
INTRODUCTION
Now a day's every system is automated in order to face new challenges in the present
day situation. Automated systems have less manual operations, so that the flexibility,
reliabilities are high and accurate. Owing to this the demand, hence every field prefers
automated control systems. Especially in the field of electronics automated systems are
doing better performance. In the present scenario of war situations, unmanned systems
plays very important role to minimize human losses. So this robot is very useful to do
operations, such as detection of enemies and to find human bodies and so many things.
Robot
OBJECTIVE
The main objective of this project is to control the direction of the robot using RF
communication.
1
CHAPTER 2
MICROCONTROLLER
The 8051 is an 8-bit processor meaning that the CPU can work only on 8 bits data
at a time. Data larger than 8 bits has to be broken into 8 bits pieces to be processed by the
CPU. The 8051 has a total of four I\O ports each 8 bit wide.
There are many versions of 8051 with different speeds and amount of on-chip
ROM and they are all compatible with the original 8051. This means that if you write a
program for one it will run on any of them.
The 8052 is an original member of the 8051 family. There are two other members
in the 8051 family of microcontrollers. They are 8052 and 8031. All the three
microcontrollers will have the same internal architecture, but they differ in the following
aspects.
8031 has 128 bytes of RAM, two timers and 6 interrupts.
89S51 has 4KB ROM, 128 bytes of RAM, two timers and 6
interrupts.
89S52 has 8KB ROM, 128 bytes of RAM, three timers and 8
interrupts.
2
Of the three microcontrollers, 89S51 is the most preferable. Microcontroller
supports both serial and parallel communication.
In the concerned project 89S52 microcontroller is used. Here microcontroller used
is AT89S52, which is manufactured by ATMEL laboratories.
The AT89S52 provides the following standard features: 8Kbytes of Flash, 256
bytes of RAM, 32 I/O lines, three 16-bit timer/counters, six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition,
the AT89S52 is designed with static logic for operation down to zero frequency and
supports two software selectable power saving modes. The Idle Mode stops the CPU
while allowing the RAM, timer/counters, serial port, and interrupt system to continue
functioning. The Power down Mode saves the RAM contents but freezes the oscillator,
disabling all other chip functions until the next hardware reset.
3
• 256 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-Bit Timer/Counters
• Eight vector two level Interrupt Sources
• Programmable Serial Channel
• Low Power Idle and Power Down Modes
In addition, the AT89S52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes.The Idle Mode stops
the CPU while allowing the RAM, timer/counters, serial port and interrupt system to
continue functioning. The Power down Mode saves the RAM contents but freezes the
oscillator disabling all other chip functions until the next hardware reset.
4
2.4 Block Diagram of Microcontroller
5
2.5 Pin Configurations
6
Pin Description
• VCC
Pin 40 provides Supply voltage to the chip. The voltage source is +5v
• GND.
• Port 0
Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. As an output
port each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can
be used as high-impedance inputs. Port 0 may also be configured to be the multiplexed
low-order address/data bus during accesses to external program and data memory. In this
mode P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming, and outputs the
code bytes during program verification. External pull-ups are required during program
verification.
• Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups from pin 1 to 8. The
Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins
they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1
pins that are externally being pulled low will source current (IIL) because of the internal
pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external
count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as
shown in following table.
7
Port 1 also receives the low-order address bytes during Flash programming and
program verification.
• Port 2
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to 28.
The Port 2 output buffers can sink / source four TTL inputs. When 1s are written to Port
2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs,
Port 2 pins that are externally being pulled low will source current (IIL) because of the
internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that uses 16-bit addresses (MOVX
@ DPTR). In this application it uses strong internal pull-ups when emitting 1s. During
accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
• Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to 17.
The Port 3 output buffers can sink / source four TTL inputs. When 1s are written to
Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As
inputs, Port 3 pins that are externally being pulled low will source current (IIL)
because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89C52 as
listed below:
8
Table 2.1Special Features of port3
Port 3 also receives some control signals for Flash programming and
programming verification.
• RST
Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this pin,
the microcontroller will reset and terminate all activities. A high on this pin for two
machine cycles while the oscillator is running resets the device.
• ALE/PROG
Address Latch is an output pin and is active high. Address Latch Enable output
pulse for latching the low byte of the address during accesses to external memory.
This pin is also the program pulse input (PROG) during Flash programming. In
normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and
may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external Data
Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if
the microcontroller is in external execution mode.
9
PSEN
Program Store Enable is the read strobe to external program memory. When the
AT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
• EA/VPP
• XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
• XTAL2
• Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on chip oscillator, as shown in Figure
5.3. Either a quartz crystal or ceramic resonator may be used. To drive the device from an
10
external clock source, XTAL2 should be left unconnected while XTAL1 is driven as
shown in Figure.
There are no requirements on the duty cycle of the external clock signal, since the
input to the internal clocking circuitry is through a divide-by two flip-flop, but minimum
and maximum voltage high and low time specifications must be observed.
11
• Idle Mode
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active.
The mode is invoked by software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle mode can be terminated
by any enabled interrupt or by a hardware reset. It should be noted that when idle is
terminated by a hardware reset, the device normally resumes program execution, from
where it left off, up to two machine cycles before the internal reset algorithm takes
control.
On-chip hardware inhibits access to internal RAM in this event, but access to the
port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin
when Idle is terminated by reset, the instruction following the one that invokes Idle
should not be one that writes to a port pin or to external memory.
In the power down mode the oscillator is stopped, and the instruction that invokes
power down is the last instruction executed. The on-chip RAM and Special Function
Registers retain their values until the power down mode is terminated. The only exit from
power down is a hardware reset. Reset redefines the SFRs but does not change the on-
chip RAM. The reset should not be activated before VCC is restored to its normal
operating level and must be held active long enough to allow the oscillator to restart and
stabilize.
Table 2.2Status of External Pins during Idle and Power down Mode
12
• Program Memory Lock Bits
On the chip are three lock bits which can be left unprogrammed (U) or can be
programmed (P) to obtain the additional features listed in the table 5.4. When lock bit 1 is
programmed, the logic level at the EA pin is sampled and latched during reset. If the
device is powered up without a reset, the latch initializes to a random value, and holds
that value until reset is activated. It is necessary that the latched value of EA be in
agreement with the current logic level at that pin in order for the device to function
properly.
TIMERS
• Timer 0 and 1
Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer
1 in the AT89S52.
Register pairs (TH0, TL1), (TH1, TL1) are the 16-bit counter registers for timer/c;
ounters 0 and 1.
13
• Timer 2
14
• Capture Mode
In the capture mode, two options are selected by bit EXEN2 in T2CON. If
EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2 in
T2CON.This bit can then be used to generate an interrupt. IfEXEN2 = 1, Timer 2
performs the same operation, but a 1-to-0 transition at external input T2EX also causes
the current value in TH2 and TL2 to be captured into RCAP2H andRCAP2L,
respectively. In addition, the transition at T2EXcauses bit EXF2 in T2CON to be set. The
EXF2 bit, likeTF2, can generate an interrupt.
15
Table 2.6 T2CON-Timer/Counter2 Control Register
16
2.5 Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0
and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These
interrupts are all shown in Figure 2.5
Note that Table shows that bit position IE.6 is unimplemented. In the AT89C51,
bit position IE.5 is also unimplemented. User software should not write 1s to these bit
positions, since they may be used in future AT89 products.
17
Table 2.7Interrupts Enable Register
Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register
T2CON. Neither of these flags is cleared by hardware when the service routine is
vectored to. In fact, the service routine may have to determine whether it was TF2 or
EXF2 that generated the interrupt, and that bit will have to be cleared in software.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in
which the timers overflow. The values are then polled by the circuitry in the next cycle.
However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which
the timer overflows.
18
2.6 Special function registers:
Special function registers are the areas of memory that control specific
functionality of the 89c52 microcontroller.
a) Accumulator (0E0h)
b) B register (oFoh)
The B register is very similar to accumulator. It may hold 8-bit value. The B
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher byte
of the products gets stored in B register. In DIV AB the quotient gets stored in B with the
remainder in A.
The stack pointer holds 8-bit value. This is used to indicate where the next value
to be removed from the stack should be taken from. When a value is to be pushed on to
the stack, the 8052 first store the value of SP and then store the value at the resulting
memory location. When a value is to be popped from the stack, the 8052 returns the value
from the memory location indicated by SP and then decrements the value of SP.
The SFRs DPL and DPH work together to represent a 16-bit value called the data
pointer. The data pointer is used in operations regarding external RAM and some
instructions code memory. It is a 16-bit SFR and also an addressable SFR.
19
e) Program counter
The program counter is a 16 bit register, which contains the 2 byte address, which tells
the next instruction to execute to be found in memory. When the 8052 is initialized PC
starts at 0000h and is incremented each time an instruction is executes. It is not
addressable SFR.
The power control SFR is used to control the 8052’s power control modes.
Certain operation modes of the 8052 allow the 8052 to go into a type of “sleep mode”
which consumes low power.
The timer mode control SFR is used to configure and modify the way in which
the 8052’s two timers operate. This SFR controls whether each of the two timers is
running or stopped and contains a flag to indicate that each timer has overflowed.
Additionally, some non-timer related bits are located in TCON SER. These bits are used
to configure the way in which the external interrupt flags are activated, which are set
when an external interrupt occur.
20
h)TMOD(Timer Mode,89h)
The timer mode SFR is used to configure the mode of operation of each of the
two timers. Using this SR your program may configure each timer to be a 16-bit timer, or
13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally you may
configure the timers to only count when an external pin is activated or to count “events”
that are indicated on an external pin.
Gate C/ T M1 M0 Gate C/ T M1 M0
TIMER1 TIMER0
These two SFRs together represent timer 0. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up. What
is configurable is how and when they increment value.
These two SFRs together represent timer 1. Their exact behavior depends on how
the timer is configured in the TMOD SFR; however, these timers always count up. What
is configurable is how and when they increment in value.
21
k) P0 (Port 0, address 80h, bit addressable)
This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0
of port 0 is pin P0.0, bit 7 is pin P0.7. Writing a value of 1 to a bit of this SFR will send a
high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.
This is port 1 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 1 is first written on P1 register. For e.g., bit 0
of port 1 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR will send a
high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.
This is port 2 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 2 is first written on P2 register. For e.g., bit 0
of port 2 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR will send a
high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.
This is port 3 latch. Each bit of this SFR corresponds to one of the pins on a micro
controller. Any data to be outputted to port 3 is first written on P3 register. For e.g., bit 0
of port 3 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR will send a
high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.
22
The interrupt enable SFR is used to enable and disable specific interrupts. The
low 7 bits of the SFR are used to enable/disable the specific interrupts, where the MSB
bit is used to enable or disable all the interrupts. Thus, if the high bit of IE 0 all interrupts
are disabled regardless of whether an individual interrupt is enabled by setting a lower
bit.
___
EA ET2 ES ET1 EX1 ET0 EX0
The interrupt priority SFR is used to specify the relative priority of each interrupt.
On 8052, an interrupt may be either low or high priority. An interrupt may interrupt
interrupts. For e.g., if we configure all interrupts as low priority other than serial
interrupt. The serial interrupt always interrupts the system; even if another interrupt is
currently executing no other interrupt will be able to interrupt the serial interrupt routine
since the serial interrupt routine has the highest priority.
___ ___
PT2 PS PT1 PX1 PT0 PX0
The Program Status Word is used to store a number of important bits that are set
and cleared by 8052 instructions. The PSW SFR contains the carry flag, the auxiliary
carry flag, the parity flag and the overflow flag. Additionally, it also contains the register
bank select flags, which are used to select, which of the “R” register banks currently in
use.
24
Instructions that use indirect addressing access the upper128 bytes of RAM. For
example, the following indirect addressing instruction, where R0 contains 0A0H,
accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H)
.MOV @R0, #data
Note that stack operations are examples of indirect addressing, so the upper 128 bytes of
data RAM are available as stack space.
25
CHAPTER 3
KIT DISCRIPTION
Circuit diagram
Rx:
26
Circuit diagram
Tx:
27
WORKING PRINCIPLE:
3.1 TRANSMITTER
Port 0:
It will be acting as both input port as well as output port. Upon reset port0 will
be acting as output port and if we want to use it as input port we have to connect pull up
resistances to make port0 as input port. Here, in this particular project prot0 is left
unconnected.
Port 1:
Port 1 can act as both input port as well as output port. Upon reset port1
will be acting as input port. The port 1 first four pins are connected to the transmitter
circuit. We are using HT12E IC which is a 18 pin IC. This encoder will encode the data
send by the microcontroller and then transmits the encoded data to the receiver through
air. In encoder IC, 10 to 13 pins are connected to Port 1 (P1.0 to P1.3 pins). Through
these pins the microcontroller will send data to the transmitter. This transmitter will sends
this data to the receiver circuit. Here data transmission is wireless.
Port 2:
This Port2 is used as both input as well as output port. In this port 2 first pin
is connected to Buzzer. In this two DC motors are connected which can move the robot
28
wheels in different directions. The first four pins of this particular Port2 (P2.4 TO P2.7)
are connected to transistor driver circuits. These transistors will get sufficient input from
the microcontroller where the microcontroller is in turn receiving this data from the
transmitter section wirelessly, to drive the motors which in turn rotate the wheels of the
robot to rotate in different desired directions and the data is send from the transmitter
section wirelessly.
Port 3:
This port is used as both input as well as output port. The port 3 first pin is
connected to temperature sensor. In temperature sensor circuit we are having thermistor
whose resistance valure is inversely proportional to temperature. The thermistor is having
negative temperature coefficient ie when temperature increases, the resistance of the
thermistor decreases.
When ever we increase the temperature, the transistor will start conducting. When the
transistor is ON the output of the collector will be zero which is connected to the
microcontroller. So microcontroller will receives logic 0 at the port 3.1 pin. When
microcontroller receives logic 0 it will make the buzzer ON, which is connected to the
other robot. It will send that signal to the encoder Ic. Here we are using HT12E as
encoder. This encoder will encode the data which is given by the micro controller into RF
signal. That signal will be transmitted through RF transmitter.
The port 3 second pin is connected to smoke sensor. When ever this smoke sensor
detects any smoke it will send logic 1 to the base of the transistor. Then the transistor
starts conducting which in turn produces logic 0 at the collector output. The output of the
collector is connected to the micro controller second pin (P3.1). When the micro
controller receives logic 0 at this pin it will send that signal to the other robot which in
turn makes the buzzer ON.
The 3rd pin of this particular Port3 (P3.2) is connected to TSOP. This TSOP will send
logic1 always to microcontroller. When ever any obstacle or any object comes in front it
29
receives the signal back then it sends logic 0 to the microcontroller. Then the
microcontroller will stop the robot movement and change the angle.
The 4th pin of port 3 is connected is micro switch. When the robot dashes any object this
switch will becomes zero. Then later when ever the robot senses any obstacle it will turn
left or right or moves back. In this way the robot will learn. So by this way we are able to
produce self learning to the robot.
3.2RECEIVER
OPERATION OF THE RECEIVER
Port 3:
The port 1 first four pins are connected to the Receiver circuit. We are using
HT12D IC which is a 18 pin IC. This decoder IC will decode the data received from the
air which is send from the Transmitter section. In decoder IC, 8 to 11 pins are connected
to Port 1 (P1.0 to P1.3 pins). Through these pins the microcontroller will be getting the
data from the decoder output. Here data receiving is wireless.
Port 2:
This port is used as both input as well as output port. In this two DC motors are
connected which can move the robot wheels in different directions. The first four pins of
this particular Port2 (P2.4 TO P2.7) are connected to transistor driver circuits. These
transistors will get sufficient input from the microcontroller where the microcontroller is
30
in turn receiving this data from the transmitter section wirelessly, to drive the motors
which in turn rotate the wheels of the robot to rotate in different desired directions and
the data is send from the transmitter section wirelessly.
Port 3:
This port is used as both input as well as output port. The 3rd pin of this particular
Port3 (P3.2) is connected to TSOP. This TSOP will send logic1 always to
microcontroller. When ever any obstacle or any object comes in front it receives the
signal back then it sends logic 0 to the microcontroller. Then the microcontroller will stop
the robot and change the angle.
3.3.1 Description:
31
supply is included with the Beginner Kit and the Microcontroller Beginner Kit.). To
make a 5 volt power supply, we use a LM7805 voltage regulator IC .
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect
the negative lead to the Common pin and then when you turn on the power, you get a 5
volt supply from the Output pin.
Circuit Features:
Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA
32
• Design testing: Based on datasheet example circuit, I have used this circuit
successfully as part of many electronics projects
• Applications: Part of electronics devices, small laboratory power supply
• Power supply voltage: Unregulated DC 8-18V power supply
• Power supply current: Needed output current + 5 mA
• Component costs: Few dollars for the electronics components + the input
transformer cost
33
Basic Power Supply Circuit:
34
18.33. Here you would use at least the standard 25V or higher (absolutely not 16V).With
our rectifier diodes or bridge they should have a PIV rating of 2.828 times the Vsec or at
least 29V. Don't search for this rating because it doesn't exist. Use the next highest
standard or even higher. The current rating should be at least twice the load current
maximum i.e. 2 X 0.5A or 1A. A good type to use would be 1N4004, 1N4006 or 1N4008
types.
These are rated 1 Amp at 400PIV, 600PIV and 1000PIV respectively. Always be
on the lookout for the higher voltage ones when they are on special.
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. Although the internal construction of the IC is
somewhat different from that described for discrete voltage regulator circuits, the external
operation is much the same. IC units provide regulation of either a fixed positive voltage,
a fixed negative voltage, or an adjustably set voltage.
A power supply can be built using a transformer connected to the ac supply line to
step the ac voltage to desired amplitude, then rectifying that ac voltage, filtering with a
capacitor and RC filter, if desired, and finally regulating the dc voltage using an IC
regulator. The regulators can be selected for operation with load currents from hundreds
of mill amperes to tens of amperes, corresponding to power ratings from mill watts to
tens of watts.
Three-Terminal Voltage Regulators:
Fixed Positive Voltage Regulators:
IN OUT
Vin 78XX
Vout
GND
C1 C2
35
Fig shows the basic connection of a three-terminal voltage regulator IC to a load.
The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to one input
terminal, a regulated output dc voltage, Vo, from a second terminal, with the third
terminal connected to ground. While the input voltage may vary over some permissible
voltage range, and the output load may vary over some acceptable range, the output
voltage remains constant within specified voltage variation limits. A table of positive
voltage regulated ICs is provided in table. For a selected regulator, IC device
specifications list a voltage range over which the input voltage can vary to maintain a
regulated output voltage over a range of load current. The specifications also list the
amount of output voltage change resulting from a change in load current (load regulation)
or in input voltage (line regulation).
7805 +5
7806 +6 35V
7808 +8
7810 +10
7812 +12
7815 +15
7818 +18
7824 +24 40V
36
3.4 Relays
Description:
General purpose double pole, double throw 12V relay with magnetic coil
37
• Can be used to isolate float switches from spiking voltage or
excessive current.
• Avoids risk that spiking pump voltage will hurt float switches
• Works with our 12 Volt Wall Transformer
• Specifications:
o Coil voltage: 12VD
o Coil resistance: 160 Ohms
o Contact rating: 15A at 110VAC or 24VDC
SPST Relays allow one circuit to switch a second circuit which can be
completely separate from the first. For example a low voltage battery circuit can
use a relay to switch a 230V AC mains circuit. There is no electrical connection
inside the relay between the two circuits; the link is magnetic and mechanical.
The relay's switch connections are usually labeled COM, NC and NO:
38
• NO = Normally Open, COM is connected to this when the relay
coil is on.
• Connect to COM and NO if you want the switched circuit to be on
when the relay coil is on.
• Connect to COM and NC if you want the switched circuit to be on
when the relay coil is off.
If the coil is energized with DC, a diode is frequently installed across the
coil, to dissipate the energy from the collapsing magnetic field at deactivation,
39
which would otherwise generate a spike of voltage and might cause damage to
circuit components
Relay coils produce brief high voltage 'spikes' when they are switched off
and this can destroy transistors and ICs in the circuit. To prevent damage you
must connect a protection diode across the relay coil.
Transistors and ICs (chips) must be protected from the brief high voltage
'spike' produced when the relay coil is switched off. The diagram shows how a
signal diode (e.g. 1N4148) is connected across the relay coil to provide this
protection. Note that the diode is connected 'backwards' so that it will normally
not conduct. Conduction only occurs when the relay coil is switched off, at this
moment current tries to continue flowing through the coil and it is harmlessly
diverted through the diode. Without the diode no current could flow and the coil
would produce a damaging high voltage 'spike' in its attempt to keep the current
flowing.
Advantages of relays:
Relays can switch AC and DC, transistors can only switch DC.
40
• Relays are a better choice for switching large currents (> 5A).
• Relays can switch many contacts at once.
Disadvantages of relays:
Relays require more current than many chips can provide, so a low power
transistor may be needed to switch the current for the relay's coil.
ULN is mainly suited for interfacing between low-level circuits and multiple peripheral
power loads,. The series ULN20XX high voltage, high current Darlington arrays feature
continuous load current ratings.
41
The driver makes use of the ULN2003 driver IC, which contains an array of 7 power
Darlington arrays, each capable of driving 500mA of current. At an approximate duty
cycle, depending on ambient temperature and number of drivers turned on,
simultaneously typical power loads totaling over 230w can be controlled.
The device has base resistors, allowing direct connection to any common logic
family. All the emitters are tied together and brought out to a separate terminal. Output
protection diodes are included; hence the device can drive inductive loads with minimum
extra components. Typical loads include relays, solenoids, stepper motors, magnetic print
hammers, multiplexed LED, incandescent displays and heaters.
42
collector-current rating of each Darlington pair is 500 mA. The Darlington pairs
may be connected in parallel for higher current capability.
Features:
• 500-mA Rated Collector Current (Single Output)
• High-Voltage Outputs . . . 50 V
4.3 IC Description:
43
Figure 3.5.2 logic diagram
Applications:
The applications include relay drivers, hammer drivers, lamp drivers,
display drivers (LED and gas discharge), line drivers, and logic buffers. The
ULN2803A has a 2.7-kΩ series base resistor for each Darlington pair for
operation directly with TTL or 5-V CMOS devices
44
3.6 DC MOTORS
A unit which creates mechanical energy from electrical energy and which
transmits mechanical energy through the gearbox at a reduced speed is a Gear
motor.
A gear head and motor combination is to reduce the speed of the motor to obtain
the desired speed or torque.
Gear motors of all types and sizes include single / multiphase, universal,
servo, induction and synchronous types. DC gear motors are configured in many
types and sizes, including brushless and servo. A DC gear motor consists of a
rotor and a permanent magnetic field stator and an integral gearbox or gear head.
The magnetic field is maintained using either permanent magnets or
electromagnetic windings. DC motors are most commonly used in variable speed
and torque applications. A DC servomotor has an output shaft that can be
positioned by sending a coded signal to the motor. As the input to the motor
changes, the angular position of the output shaft changes as well. Servomotors
are generally small and powerful for their size, and easy to control. Common
types of DC servomotors include brushless or gear motor types. Stepper motors
are classes of motors that provide incremental motion, or steps, in response to
pulses of current that alternately change the polarity of the stator poles; step
motors do not require feedback and are sometimes used in "Open Loop," or no-
feedback applications.
45
Important performance specifications to consider when searching for gear
motors include shaft speed, continuous torque, continuous current, and continuous
output power. The terminal voltage is the design DC motor voltage. The
continuous torque is the output torque capability of the motor under constant
running conditions. Continuous current is the maximum rated current that can be
supplied to the motor windings without overheating. Continuous output power is
the mechanical power provided by the motor output.
Important DC motor specifications to consider include terminal voltage,
motor construction and commutation. The terminal voltage is the design DC
motor voltage. Motor construction choices include permanent magnet, shunt
wound, series wound, compound wound, disc armature, and coreless or slot less.
Important gearing specifications to consider for gear motors and gear heads
include the gearing arrangement, gearbox ratio, and gearbox efficiency. Gearing
arrangement choices for gear motors or gear heads include spur, planetary,
harmonic, worm, and bevel. Gearbox ratio is the ratio of input speed to output
speed. A ratio greater than one, therefore, indicates speed reduction, while a ratio
less than one indicates speed increase. Efficiency is the percentage of power or
torque that is transferred through the gearbox. Losses occur due to factors such as
friction and slippage inside the gearbox. Feedback choices for gear motors
include integral encoder, integral resolver, and integral tachometer. Other
important parameters to consider when specifying gear motors include shaft
orientation or type and number of shafts, design units, motor shape, diameter or
width, housing length, NEMA frame size, enclosure options and special or
extreme environment construction. Common features include multi-speed,
reversible, integral driver electronics, integral brake, integral clutch, and brake
and clutch combination.
3.7 BATTERIES
46
The Ultra life lithium 9-volt battery is a consumer-replaceable battery that lasts up to 5
times longer than ordinary alkaline 9V batteries and 10 times longer than carbon-zinc
batteries. This primary battery has the highest energy density, flattest discharge voltage
curve, longest shelf life, widest operating temperature range, and lightest weight of any
comparable 9-volt battery.
These batteries are most widely used in smoke sensors and also for robotic
applications.
Capped 9v batteries are for applications where the 9 volts will be traveling
extensively. The cap is a detachable terminal protector that safeguards + and - leads from
shorting out during travel against conducting metal objects such as wires, other batteries,
loose change in your pocket etc.
47
FIGURE: 3.7.1 BLOCKS DIAGRAM OF BATTERY
Do I need 9v caps?
Capped 9v batteries are for applications where the 9 volts will be traveling
extensively. The cap is a detachable terminal protector that safeguards + and - leads from
shorting out during travel against conducting metal objects such as wires, other batteries,
loose change in your pocket (ouch!), etc. Most applications do not need them.
3.8 RECEIVER
48
RF Receiver Module RX433
Click these images for a larger view.
This compact radio frequency (RF) receiver module is suitable for remote control or
telemetry applications. The double sided circuit board is pre-populated with Surface
Mount Devices (SMD) and is tuned to 433MHz. No module assembly or adjustments are
required. RF receiver module RX433 receives RF control signals from the 8 channel RF
remote control transmitter K8058 and performs as an RF receiver interface when used
on the 8 channel remote control relay board K8056. (Only one RX433 RF receiver is
needed for full RF remote control operation of the 8 channel relay board K8056). RF
receiver module RX433 is a highly sensitive passive design that is easy to implement
with a low external parts count. (Download datasheet with hook-up schematic below)
RF remote receiver module RX433 can also be used with 433MHz RF Transmitter
TX433N for your custom remote control or telemetry requirements. (However, the FCC
has restrictions on the sale of the TX433N transmitter module in the U.S., so we don't
have these transmitters available).
Specifications
49
• modulation: AM
• modulate mode: ASK
• circuit shape: LC
• sensitivity: 3µVrms
• power supply: 4.5 - 5.5V DC
• data rate: 4800 bps
• receiver selectivity: -106 dB
• channel spacing: 1 MHz
• digital and linear output
• RF receiver module pin numbers
o 1: gnd
o 2: digital output
o 3: linear output
o 4: Vcc
o 5: Vcc
o 6: gnd
o 7: gnd
o 8: antenna: 11.8" - 13.77" (30cm - 35cm)
3.9 TRANSMITTER
Modulation : AM
RF output : 8mW
VIEW LARGER
IMAGE Power supply : 3 - 12Vdc
50
Power Supply and All Input /
Output Pins: -0.3 to +12.0 V
*Non-Operating Case Temperature: -20 to +85
*Soldering Temperature ( 10 Seconds ) : 230 ( 10 Seconds )
Features
no adjustments required
stable output
suitable for remote controls, telemetry, ..
Specifications
CHAPTER 4
4.1 PROGRAMMING
Source code:
/*************************************
TRASMITTER***************************************************
RF TE PIN
51
***********************************************************
**************************************/
#include<reg51.h>
sbit TE=P2^0;
sbit SW1=P2^1;
sbit SW2=P2^2;
sbit SW3=P2^3;
sbit SW4=P2^4;
delay(unsigned int)
void main(void)
TE=0;
SW1=0;
SW2=0;
SW3=0;
SW4=0;
while(1)
if(SW1==1)
P1=0X31;
TE=1;
52
delay(300);
TE=0;
if(SW2==1)
P1=0X32;
TE=1;
delay(300);
TE=0;
if(SW3==1)
P1=0X33;
TE=1;
delay(300);
TE=0;
if(SW4==1)
P1=0X34;
TE=1;
delay(300);
TE=0;
53
}
delay(unsigned int k)
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
delay(unsigned int k)
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
/*************************************
TRASMITTER***************************************************
RF TE PIN
********************************************************************
*****************************/
54
#include<reg51.h>
sbit TE=P2^0;
sbit SW1=P2^1;
sbit SW2=P2^2;
sbit SW3=P2^3;
sbit SW4=P2^4;
delay(unsigned int);
void main(void)
TE=0;
SW1=0;
SW2=0;
SW3=0;
SW4=0;
while(1)
if(SW1==1)
P1=0X31;
TE=1;
delay(300);
TE=0;
55
}
if(SW2==1)
P1=0X32;
TE=1;
delay(300);
TE=0;
if(SW3==1)
P1=0X33;
TE=1;
delay(300);
TE=0;
if(SW4==1)
P1=0X34;
TE=1;
delay(300);
TE=0;
56
delay(unsigned int k)
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
delay(unsigned int k)
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
/*************************************
RECEIVER***************************************************
PORT2-,5,6,7 USED FOR CTRL SIGNALS FOR LCD AND P2.0 FOR RF VT
PIN
57
********************************************************************
*****************************/
#include<reg51.h>
sbit VT=P2^0;
sbit L_MOTORFORWARD=P1^0;
sbit L_MOTORBACKWARD=P1^1;
sbit R_MOTORFORWARD=P1^6;
sbit R_MOTORBACKWARD=P1^7;
delay(unsigned int);
void main(void)
unsigned char l;
L_MOTORFORWARD=0;
L_MOTORBACKWARD=0;
R_MOTORFORWARD=0;
R_MOTORBACKWARD=0;
while(1)
if(VT==0);
l=P3;
if(l==0x31)
L_MOTORFORWARD=1;
58
R_MOTORFORWARD=1;
delay(150); //FORWARD
L_MOTORFORWARD=0;
R_MOTORFORWARD=0;
if(l==0x32)
L_MOTORFORWARD=1;
delay(150);
L_MOTORFORWARD=0; //LEFT
L_MOTORBACKWARD=0;
R_MOTORFORWARD=0;
R_MOTORBACKWARD=0;
if(l==0x33)
R_MOTORFORWARD=1;
delay(150);
R_MOTORFORWARD=0;
L_MOTORFORWARD=0;
L_MOTORBACKWARD=0; //RIGHT
R_MOTORBACKWARD=0;
if(l==0x34)
59
{
L_MOTORBACKWARD=1;
R_MOTORBACKWARD=1;
delay(150); //BACK
L_MOTORBACKWARD=0;
R_MOTORBACKWARD=0;
delay(unsigned int k)
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
4.2 CONCLUSION
The project “RF ROBOTICS” has been successfully designed and tested.
It has been developed by integrating features of all the hardware components used.
Presence of every module has been reasoned out and placed carefully thus contributing to
the best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the
project has been successfully implemented.
60
Finally we conclude that RF ROBOTICS” is an emerging field and there is a huge scope
for research and development.
The field of robotics has created a large class of robots with basic physical and
navigational competencies. At the same time, society has begun to move towards
incorporating robots into everyday life, from entertainment to health care. Moreover,
robots could free a large number of people from hazardous situations, essentially
allowing them to be used as replacements for human beings. Many of the applications
being pursued by AI robotics researchers are already fulfilling that potential. In addition,
robots can be used for more commonplace tasks such as janitorial work. Whereas robots
were initially developed for dirty, dull, and dangerous applications, they are now being
considered as personal assistants. Regardless of application, robots will require more
rather than less intelligence, and will thereby have a significant impact on our society in
the future as technology expands to new horizons.
4.4 REFERENCES
61
The 8051 Micro controller Architecture,
Programming & Applications
-Kenneth J.Ayala
-B.Ram
-Ramesh S.Gaonkar
Electronic Components
-D.V.Prasad
Wireless Communications
- Theodore S. Rappaport
62
63