Introduction To Serial Data Communication
Introduction To Serial Data Communication
Introduction To Serial Data Communication
CHARACTERISTICS OF SERIAL
COMMUNICATION
1. VOLTAGE LEVELS
Two voltage levels are required to represent
binary data. The RS-232 standard specifies
these values.
3. SLEW RATE
Slew rate is the transition rate from one
value to another. The baud value
indicates the number of bits per second
that can be sent. Of course the baud
value is limited by the slew rate.
4. DISTANCE
The RS-232 specification states that the specification is intended for
connections of 50ft or less. Beyond 50ft, the signals may be degraded by
noise, attenuated, or rounded, and reliable transmission is not assured.
5. DATA BITS
The RS-232 standard does not define the bits send between the start and
stop bits, but 5, 6, 7, or 8 bits are most commonly used. At an idle state signal
is at mark value. Transmission begins when the line goes to the space value,
as the beginning of the start bit. Next comes the user data bits. After data bits,
there may be a parity bit, which is used to check errors. Finally after the parity
bit, line goes to the mark value. This is the beginning of the stop bit.
1. Framing error: - exists when the receiver expects a stop bit but does not
get one. This may be caused by noise or signal degradation which caused the
stop bit to look like the opposite signal state. The receiver character is
therefore not framed properly by the start and stop bit.
2. Overrun error: - occurs when a new character appears at the receiver
circuitry before the previous character has been handled and disposed of
completely.
3. Parity error: - occurs when the parity bit received with the character bit
indicates that one or more of the data bits has an error. This indicates that the
entire group is successfully received, but one of the received bits may be
wrong.
1. Temperature meter
In a temperature meter application an electronic meter is used to monitor the
temperature at a remote, dangerous location.
2. Computer to Terminal
3. Computer to Computer
UART
A universal asynchronous receiver/transmitter (usually abbreviated UART) is a
type of "asynchronous Receiver / transmitter", a piece of computer hardware that
translates data between parallel and serial forms. UARTs are commonly used in
conjunction with other communication standards such as EIA RS-232.
Structure:
A UART usually contains the following components:
• A clock generator, usually a multiple of the bit rate to allow sampling in the middle
of a bit period.
• Input and output shift registers
• transmit/receive control
• read/write control logic
• transmit/receive buffers (optional)
• Parallel data bus buffer (optional)
• First-in, first-out (FIFO) buffer memory
(Optional)
Features:
Operation speed is up to 19.2Kbaud.
Choice of 5,6,7, or 8 bit characters.
Parity or no parity.
Provision of one, one & a half, or 2 stop bits.
Support for various handshake lines.
MULTITASKING PROGRAMMABLE ROBOT DESIGN
The Robot is the ideal platform to
start working into the field of
wireless communication and
autonomous robotics.The iBoard
mini is a controller board, simple yet
feature packed so as to cater to a
wide range of applications. This kit
is based around the widely used
ATmega8 microcontroller based on
the AVR architecture. It strives to
bridge the gap between concepts
been taught in the classrooms and
actually implementing them
practically. Robot is essentially
related to a variety of fields
comprising of embedded C programming, microcontrollers, wireless communication,
electronics and mechanics.
With this kit we had a hands-on experience of working with line
sensors, use of different actuators like DC geared and stepper motors, their drivers,
interfacing wireless modules, serial communication with the PC, inter PC wireless
communication.
PARTS OF ROBOT
1. CONTROL SECTION
The Robot controller board
is designed around the
ATmega8 microcontroller.
Features:
Parts Identification:
Power Switch: It’s a basic push to on - push to off type switch.
IC 7805: It’s a three terminal linear 5 volt regulator used to supply the microcontroller
and other peripherals.
Reset Switch: This switch is used to reset the microcontroller.
I/O Port (Sensor port) : At a time, 18 individual sensor modules can be connected
to this port. The port also provides a 5V supply needed to drive the sensors.
Switches: Two general purpose switches are connected in the active LOW
configuration.
2. SENSOR SECTION
Sensor section of the Robot
consist of 5 light sensor units
each comprising of a pair of IR
LED and a Photodiode. The
section can be connected to the
microcontroller’s input port in
order to receive and interpret thr
surrouding physical factors.
The ON/OFF voltage levels of
the sensors can be adjusted by
the Trim Pot.
Power Ratings:
-Max o/p current: 800mA
-Max i/p Voltage: 36V
This kit can be used in many applications where light sensing robots have to be
designed. The most primary one is the Path follower (or Line Follower).
In the early stages of our project, we designed a black Line follower robot with
ability to perform its function under various possible conditions. Sensor outputs were
taken to the input port (PORTB) of the microcontroller where it was interpreted as
per programmed set of instructions. Microcontroller sent its commands to the output
port (PORTC) which was connected to the Motor Driver section. Thus, an
autonomous output was generated by the robot through its motion.
OTHER APPLICATIONS
This follows a modular approach throughout its construction, so the user can easily
add new features and behaviours from line following, obstacle avoiding to swarm
robotics and a basic micro mouse. It can also be used as a generic embedded
systems development platform.
Wireless communication module enables this robot to spread out its horizon towards
development of unmanned remotely (Wired or Wireless) controlled systems.
Some of the applications are:
1. Path Finder.
2. Obstacle Detector.
3. Security monitoring system.
4. Grid Solver.
5. Micro mouse.
6. Household robots.
7. Military applications etc.
PC CONTROLLED ROBOT
Developmental stages:
1. Interface set up between PC and the Robot using RS-232 interfacing with the
help of UART communication module.
2. Algorithm design for data transmission and reception by the microcontroller
(ATMEGA8).
3. Microcontroller programming for data communication in C language with the
help of the programmer kit (RS-232 interfacing module).
4. Set up of communication link between robot and PC on hyperterminal –
Characters were received and transmitted back by the robot.
5. Algorithm design and programming for Robot motion control according to the
data bytes received from the PC.
Configure motors and sensors and different functions for various motions.
Yes No
Is
i>=j
Stop
GPS DATA RECEPTION, EXTRACTION & ANALYSIS
INTRODUCTON
GPS stands for the Global Positioning System. It refers to a system of satellites
and receivers that allow people and devices to pinpoint their precise location on the
earth. The heart of the system relies on 24 satellites that orbit the earth twice per
day. Devices that are equipped with GPS
equipment receive transmissions from at least a
few of the satellites and are able to discern very
precise positioning data.
GPS uses a one-way ranging technique from the GPS satellite that is also
broadcasting their estimated position. Signals from four satellites are used with the
user generated replica signal and the receiver phase is measured. Using
triangulation the location of the receiver is fixed. Four unknowns can be determined
using the four satellites and appropriate geometry .Latitude, Longitude, altitude, and
a correction to user’s clock. The GPS ranging signal is broadcast at two frequencies:
a primary signal at 1575.42 MHz (L1) and a secondary broadcast at 1227.6MHz
(L2).Civilians uses L1 frequency which has two modulation,viz. C/A or clear
acquisition code and p or precise or protected codes. P codes are mainly for the
military use.
TRILATERATION
A GPS receiver calculates its position by carefully timing the signals sent by the
constellation of GPS satellites high above the Earth. Each satellite continually
transmits messages containing the time the message was sent, a precise orbit for
the satellite sending the message (the ephemeris), and the general system health
and rough orbits of all GPS satellites (the almanac). These signals travel at the
speed of light through outer space, and slightly slower through the atmosphere. The
receiver uses the arrival time of each message to measure the distance to each
satellite thereby establishing that the GPS receiver is approximately on the surfaces
of spheres centred at each satellite. The GPS receiver also uses, when appropriate,
the knowledge that the GPS receiver is on (if vehicle altitude is known) or near the
surface of a sphere centred at the earth centre. This information is then used to
estimate the position of the GPS receiver as the intersection of sphere surfaces. The
resulting coordinates are converted to a more convenient form for the user such as
latitude and longitude, or location on a map, and then displayed.
ERRORS IN GPS
1. Ephemeris error
4.Atmospheric delay
Applications
GPS has become a widely used aid to navigation worldwide, and a useful tool for
map-making, land surveying, commerce, scientific uses, tracking and surveillance,
and hobbies such as geo caching and way marking. The precise time reference
provided by GPS is used in many applications including the scientific study of
earthquakes and as a time synchronization source for cellular network protocols.
DATA FORMATS
- $GPGGA
- $GPRMC
- $GPGLL
- $GPGSV
- $GPGRS
Each format has different data syntax where character bytes are separated by
comma (,). For GPS data interpretation, we have used GPGGA format to determine
latitude , longitude, time and other relevant information as GPGGA covers all of them
in a simple and easily understandable syntax. Some examples of the data formats
are given below:
Data Acquisition:
The GPS was connected to PC for testing via RS-232 cable. We have used GPGGA
sentence as it serves our purpose in an efficient and effective manner.
Data Processing:
The algorithm was designed to identify only GPGGA sentences. The bytes are then
stored in a buffer. The data packets are separated using commas so the algorithm
counts the number of commas to identify start bytes, latitude, longitude, time, HDOP
and number of satellites.
Eg. $GPGGA, 123519,4807.038, N, 01131.000, E, 1, 08, 0.9, 545.4, M, 46.9, M,, *47
Algorithm:
(A) Define port 1 0x3F8
Define port 2 0x2F8
(B) Global Declaration n=0,data.
1. Start
2. Define O/P ports.
3. Create file f_all (.xls).
4. If (n>=2000), goto step 11, else goto step 5.
5. Counter=0;
6. Store output of GPS in buffer[i] till kbhit()==27 (esc).
7. for (j=0 to j<6), check if (buffer[j]=="$GPGGA"),counter++.
8. If (counter>=6), print the line i.ebuffer[].
8.1 flag=0;
8.2 read buffer[j] & if (buffer[j]==','),flag++.
8.2.1 if (flag==0), n1=j+2.
if (flag==1), n2=j+2.
...
…
if (flag==7), n8=j+2.
if (flag==8), n9=j+1.
8.3 open files f_all,f_time,f_lat,f_lon,f_hdop (.xls).
8.4 for (k=n1;k<n2;k++) store buffer[k] in f_all&f_time.
8.5 for (k=n2;k<n3;k++) store buffer[k] in f_all&f_lat.
8.6 similarly, we store all the data in respective files.
9. close all files.
10. n++.
11. open file f_latlon in append mode.
12. read all the data from f_lat& store row-wise is f_latlon.
13. repeat step 13, read data from f_lon.
14. close all files.
15. Stop
DATA ANALYSIS
GPS data (GPGGA) was successfully received and extracted with the help of
developed algorithm. Data was observed as follows:
HDOP = 50
HDOP = 7.7
b. Using Hyperterminal
DATA COLLECTION
Obtained GPGGA sentences and extracted information were collected and recorded
in different excel files. Almost 500 readings were collected and extracted during the
process for proper analysis.
1. The f_all.xls- Contains information about all the relevant parameters i.e.
Time, Latitude, Longitude, Direction, No. of Satellite & HDOP value.
7352.8
7352.8
7352.8
7352.8
7352.8
7352.8
7352.8
7352.8
7352.8
1834.85 1834.85 1834.85 1834.85 1834.86 1834.86 1834.86 1834.86 1834.86 1834.86
APPLICATIONS AND FUTURE SCOPE
The GPS system is widely used in various applications. The most important
advantage of this system is that it can be used intervene potentially lethal
environment. Thus it can be used in several Unmanned Ground Vehicles.
- Warfare
- Landslides
- Earthquakes
- Mine Collapse
- Floods
- Fire
This system is an aid to any vehicle which moves in more than one axis, vehicles
moving in air, sea, under sea and even on land.
This system may find a broad range of future applications in different fields like:
Features
•Control16hobbyservosfromPCandMicrocontroller
•UARTinterface
•Independentrangesettingforeachservo
•0.5uSresolution
•50Hzupdaterate
•28PinDIPSizechip
•Outputpulserangeof200through2400microseconds
•Simplehardwarerequiredtomakeitfunctional
•Easytousesoftware
•Servosequencerwithspeed,delay,gotoandmanyother
Features
•Homeandneutralpositionsetting
• VariableBaudrate—Workson9600bps,19200bps, 38400bps,
57600bpsor115200bps
•Auto-detectionofBaudrate
Thebasicideaofthischipistocontrolupto16servos
foranyoftheprojectwhichusesservos. Itworksonserialcommands
andsoonceanycommandissentthroughUARTitholdsormoves theservos
tocommandpositionuntilthenextcommand isreceived.Thissaves alotof coding time
atm i c r o c o n t r o l l e r orP C e n d . Additionallythet i m e r s and I /Opins
ofmicrocontrollerarefreetodosomeo th e r worka n d interfacewith
a d d i t i o n a l hardwareandsensors.
Thehardwareisverysimplea n d canevenbebuilteasilyonBreadboardorGeneralPurp
osePCBinminutes.
SERVO CONTROLLER MECHANISM
HardwareSetup
HardwarerequiresfollowingcomponentswiththeSerialServoControllerChip
• 1- 5VregulatorIregulatedpower
supplyI+5V&GNDlinesfromMCUBoard
• 1- 16MHzcrystal
• 2- 22pfceramic capacitors
• 1-LED
• 1-100flFwattResistor
• 2- 40X1Maleheaderstrips
AdditionalhardwarerequiredtoconnectwithPC
• PC-MCUSeriallinkorUSB-UARTlink
ThecircuitcanbeassembledonBreadboard,Generalpurpose
PCBorSpecialPurposePCBas
perrequirements.WeusethesamechiponourUSB16Servocontroller.Ittakestheseri
al commands fromPCthroughUSB-UARTBridge.
Pinconnections
SERVO COMMANDS
BasicServocommandstructure:
Startbyte(S) Command ServoByte DataByte DataByte
+ (Servo) 1 (DB1) 2 (DB2)
Databyte(C
)
Startbyteisalways0XAA(Decimal170).
Allotherbytesmustbelessthan0X80(Decimal128).
Servobytewillselectservonumber.0X00(Servo1)to0X0F
(Servo16).
Databyte2isnotusedinsomeofthecommandsandifnotused donotsendany
extracharacters.
Shortnamesarewritteninbracketinaboveline.
Servocommands:
2OO+(17*Data)uSPulse
MaxData=OX7F(Decim
al127)
2OO+(8.5*data)uSPuls
e
MaxData=OXFF(Decim
al255)
ResponsesfromServocontrollerchip:
‘a’:Command Accepted andActionwillStartaccording tothe
command
‘e’:Errorincommand
‘d’:DataError
‘s’:ErrorinServoNumber
‘m’:Minimumvaluegreat
APPLICATIONS
Manipulator arm acts as an excellent prototype to work on various Robots and
unmanned systems. It is used as a model to develop, interpret and modify our
designed systems as per the required standards and output levels.
DRDO R&DE (Engrs), Pune has used similar arm in their recent developments like
DAKSH (ROV), Takshak etc. The arm that has been used in DAKSH has 6 degrees
of freedom for its movement in almost all possible directions.Thearm is widely used
in artificially intelligent and robotic systems. Some of its applications are listed below:
1. Robotic arms
2. Walkers
3. Bipeds
4. Military purpose Robots
5. Humanoid
6. Industrial Robots
7. Unmanned Vehicles.
DIGITAL COMPASS
INTRODUCTION TO DIGITAL COMPASS (HMR3000)
The Honeywell HMR3000 is a digital compass module thatprovides heading, pitch,
and roll outputs for navigation. Thethree of Honeywell’s magneto-resistive sensors
are oriented inorthogonal directions plus a fluid tilt sensor is employed tomeasure the
vector components of the earth’s magnetic fieldand a gravitational reference. These
solid-state sensors createa strap down compass that is both rugged and reliable.
The dataoutput is serial full-duplex RS-232 or half-duplex RS-485 with1200 to
19,200 data rates.
The HMR3000 uses Honeywell magnetic sensors with proven MR technology and a
two-axis tilt sensor to bring you theheading information. This electronically gimballed
compass gives accurate heading even when the compass is tilted up to45 degrees.
This low power, small device is housed in a non-magnetic metallic enclosure that
can be easily installed onany platform.
The HMR3000 allows the user to configure compass output to include any
combination of six NMEA standard messagesand to change measurement
parameters for the magnetometer to suit the application. The sophisticated auto
compasscalibration routines will correct for the hard-iron magnetic effects of the
platform. The wide dynamic range of themagnetometer (±1 G or 100 μT) allows the
HMR3000 to be useful in applications with moderate local magnetic fields.
SPECIFICATIONS OF HMR3000
PIN CONFIGURATION
NMEA SENTENCES
HMR3000 Serial Data Communication
$TNHCQ,HDG*27<cr><lf>
$TNHCQ,HDT*34<cr><lf>
$TNHCQ,XDR*22<cr><lf>
$PTNT,HPR*78<cr><lf>
$PTNT,RCD*67<cr><lf>
$PTNT,CCD*76<cr><lf>
Format of NMEA Sentence Outputs
HDG Heading, Deviation, & Variation
$HCHDG,x.x,x.x,a,x.x,a*hh<cr><lf>
If either the deviation or variation parameter has not been programmed, the
corresponding field will be null (per NMEA0183 version 2.1, section 5.2.2.3).
Parameters have not been programmed if their absolute values are greater than
3200mils or 180.0 degrees. Positive deviation and variation is indicated by a = E;
negative values by a = W. Heading field willbe null if it cannot be calculated (see
HPR proprietary sentence). NMEA requires that units for heading measurement be
degrees.
Eg. In Degree Mode
$HCHDG,85.8,0.0,E,0.0,E*77
$HCHDG,271.2,0.0,E,0.0,E*44
$HCHDG,271.1,10.7,E,12.2,W*52
$HCHDG,0.0,10.7,E,12.2,W*57
Mil Mode is not allowed by NMEA standard
$HCXDR,A,x.x,D,PITCH,A,x.x,D,ROLL,G,x.x,,MAGX,G,x.x,,MAGY,G,x.x,,MAGZ,G,x
.x,,MAGT*hh<cr><lf>
Each of the six possible measurements - pitch; roll; and magnetic x, y, z, and total—
can be individually included in orexcluded from the message (see “XDR has …”
parameters). See NMEA 0183 for a detailed description of the “Type-Data-Units-ID”
field encoding. The “Data” field of an included measurement will be null if its contents
cannot be determined dueto saturated measurements. Only units of degrees are
allowed by NMEA for pitch and roll measurements.
Applications
Applications include: Compassing & Navigation, DeadReckoning Backup to GPS
Systems, Marine Navigation,Antenna Positioning, and Land Surveying.