You are on page 1of 29

EXPERIMENT No.

: 01
Aim: To connect two pc using peer to peer communication.
Apparatus Used: 1. Scientech 5002A Software
2. 2-CAT5 Cables
3. 42 mm Patch Cords
Procedure:
The simplest form of a network is a peer-to-peer network. In a peer-to-peer network,
every computer can communicate directly with every other computer. By default, no
computer on a peer-to-peer network has more authority than another. However, each
computer can be configured to share only some of its resources and keep other resources
inaccessible to the network. Traditional peer-to-peer networks typically consist of two or
more general-purpose personal computers, with modest processing capabilities. Every
computer is capable of sending and receiving information to and from every other
computer, as shown in next figure

Resource sharing on a simple peer-to-peer network

A window will appear on screen as shown in next figure

Select Server on PC1

Enter the IP Address of PC1 into Client Textbox of PC2

Now you can have a chat application between server and client.
Enter data here and press Enter or click on Send Data

Note: If you want to interchange server and client, then please restart application

EXPERIMENT No. : 02
Aim: To study and generate amplitude modulation, frequency modulation and phase
modulation in MATLAB.
Apparatus Used: MATLAB R2010a
Theory:
1) Amplitude Modulation
Amplitude modulation (AM) is a modulation technique used in electronic
communication, most commonly for transmitting information via a radio carrier wave. In
amplitude modulation, the amplitude (signal strength) of the carrier wave is varied in
proportion to the waveform being transmitted.
Therefore, the modulated signal has three components: the carrier wave c(t) which is
unchanged, and two pure sine waves (known as sidebands) with frequencies slightly
above and below the carrier frequency fc.
Modulation index
The AM modulation index is a measure based on the ratio of the modulation excursions
of the RF signal to the level of the unmodulated carrier. It is thus defined as:

where
and
are the modulation amplitude and carrier amplitude, respectively; the
modulation amplitude is the peak (positive or negative) change in the RF amplitude from
its unmodulated value. Modulation index is normally expressed as a percentage, and may
be displayed on a meter connected to an AM transmitter.
2) Frequency Modulation
In telecommunications and signal processing, frequency modulation (FM) is the
encoding of information in a carrier wave by varying the instantaneous frequency of the
wave.
If the information to be transmitted (i.e., the baseband signal) is

and

the sinusoidal carrier is


, where fc is the carrier's base
frequency, and Ac is the carrier's amplitude, the modulator combines the carrier with the
baseband data signal to get the transmitted signal:

In this equation,
is the instantaneous frequency of the oscillator and
is
the frequency deviation, which represents the maximum shift away from fc in one
direction, assuming xm(t) is limited to the range 1.
Modulation index

If
, the modulation is called wideband FM and its bandwidth is
approximately
.
3) Phase Modulation
Phase modulation (PM) is a modulation pattern that encodes information as variations in
the instantaneous phase of a carrier wave.
PM changes the phase angle of the complex envelope in direct proportion to the message
signal.
Suppose that the signal to be sent (called the modulating or message signal) is
the carrier onto which the signal is to be modulated is

and

Annotated:
carrier(time) = (carrier amplitude)*sin(carrier frequency*time + phase shift)
This makes the modulated signal

The modulation signal could here be

Modulation index
As with other modulation indices, this quantity indicates by how much the modulated
variable varies around its unmodulated level. It relates to the variations in the phase of the
carrier signal:
,
where

is the peak phase deviation

Code:
clc
clear all
close all
Ac=input('Enter carrier signal amplitude:');
Am=input('Enter message signal amplitude:');
fc=input('Enter carrier frequency:');
fm=input('Enter message frequency:');% fm<fc
m=input('Enter modulation index:');
t= 0:0.001:1;
y1=sin(2*pi*fm*t);
y2=sin(2*pi*fc*t);
eq=(1+m.*y1).*(Am.*y2);
subplot(5,1,1)
plot(t,y1);
xlabel('Time');
ylabel('Amplitude');
title('Message signal');
subplot(5,1,2)
plot(t,y2);
xlabel('Time');
ylabel('Amplitude');
title('Carrier signal');
subplot(5,1,3)
plot(t,eq);
xlabel('Time');
ylabel('Amplitude');
title('Modulated signal');
y=Ac*sin(2*pi*fc*t+(m.*cos(2*pi*fm*t)));
subplot(5,1,4)
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('FM Signal');
7

p = Ac*sin(2*pi*fc*t+m.*sin(2*pi*fm*t));
subplot(5,1,5);
plot(t,p);
xlabel('Time');
ylabel('Amplitude');
title('PM Wave');

Output:

Result:
Amplitude modulated, phase modulated and frequency modulated waves studied and
generated in MATLAB

EXPERIMENT No. : 03
Aim: To Plot Efficiency of pure Aloha and slotted ALOHA in MATLAB.
Apparatus Used: MATLAB R2010a
Theory:
1) Pure Aloha
The first version of the protocol (now called "Pure ALOHA", and the one
implemented in ALOHAnet) was quite simple:

If you have data to send, send the data


If, while you are transmitting data, you receive any data from another station,
there has been a message collision. All transmitting stations will need to try
resending "later".

Note that the first step implies that Pure ALOHA does not check whether the channel is
busy before transmitting. Since collisions can occur and data may have to be sent again,
ALOHA cannot use 100% of the capacity of the communications channel. How long a
station waits until it transmits, and the likelihood a collision occurs are interrelated, and
both affect how efficiently the channel can be used. This means that the concept of
"transmit later" is a critical aspect: the quality of the back off scheme chosen significantly
influences the efficiency of the protocol, the ultimate channel capacity, and the
predictability of its behavior.
To assess Pure ALOHA, there is a need to predict its throughput, the rate of (successful)
transmission of frames. ] First, let's make a few simplifying assumptions:

All frames have the same length.


Stations cannot generate a frame while transmitting or trying to transmit. (That is,
if a station keeps trying to send a frame, it cannot be allowed to generate more
frames to send.)
The population of stations attempts to transmit (both new frames and old frames
that collided) according to a Poisson distribution

2) Slotted Aloha
An improvement to the original ALOHA protocol was "Slotted ALOHA", which
introduced discrete timeslots and increased the maximum throughput.[13] A station can
send only at the beginning of a timeslot, and thus collisions are reduced. In this case,
only transmission-attempts within 1 frame-time and not 2 consecutive frame-times
need to be considered, since collisions can only occur during each timeslot. Thus, the
probability of there being zero transmission-attempts in a single timeslot is:

the probability of k packets is:

The throughput is:

Code
clc
close all
clear all
t=0:0.1:10;
s1=t.*exp(-t);
plot(t,s1,'r+');
text(0.8,0.18,'Pure ALOHA');
hold on;
s2=t.*exp(-2*t);
plot(t,s2,'b*');
text(1.3,0.37,'Slotted ALOHA');
hold on;
title('ALOHA Protocol by Arshdeep Singh Sran');
ylabel('throughput');
xlabel('Load Offered');
Output:

Result:
Efficiency of pure ALOHA and slotted ALOHA is plotted in MATLAB

10

EXPERIMENT No. : 04
Aim: Write a program to generate CRC code for checking error.
Apparatus Used: MATLAB R2010a
Theory:
A cyclic redundancy check (CRC) is an error-detecting code commonly used in
digital networks and storage devices to detect accidental changes to raw data. Blocks of
data entering these systems get a short check value attached, based on the remainder of
a polynomial division of their contents. On retrieval the calculation is repeated, and
corrective action can be taken against presumed data corruption if the check values do not
match.
CRCs are so called because the check (data verification) value is a redundancy (it expands
the message without adding information) and the algorithm is based on cyclic codes. CRCs
are popular because they are simple to implement in binary hardware, easy to analyze
mathematically, and particularly good at detecting common errors caused by noise in
transmission channels. Because the check value has a fixed length, the function that
generates it is occasionally used as a hash function.
The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of
Ethernet and many other standards is the work of several researchers and was published in
1975.
CRCs are based on the theory of cyclic error-correcting codes. The use of systematic cyclic
codes, which encode messages by adding a fixed-length check value, for the purpose of
error detection in communication networks, was first proposed by W. Wesley Peterson in
1961.[1] Cyclic codes are not only simple to implement but have the benefit of being
particularly well suited for the detection of burst, contiguous sequences of erroneous data
symbols in messages. This is important because burst errors are common transmission
errors in many communication channels, including magnetic and optical storage devices.
Typically an n-bit CRC applied to a data block of arbitrary length will detect any single
error burst not longer than n bits and will detect a fraction 1 2n of all longer error bursts.
Specification of a CRC code requires definition of a so-called generator polynomial. This
polynomial becomes the divisor in a polynomial long division, which takes the message as
the dividend and in which the quotient is discarded and the remainder becomes the result.
The important caveat is that the polynomial coefficients are calculated according to the
arithmetic of a finite field, so the addition operation can always be performed bitwiseparallel (there is no carry between digits). The length of the remainder is always less than

11

the length of the generator polynomial, which therefore determines how long the result can
be.
In practice, all commonly used CRCs employ the Galois field of two elements, GF (2). The
two elements are usually called 0 and 1, comfortably matching computer architecture.
A CRC is called an n-bit CRC when its check value is n bits. For a given n, multiple CRCs
are possible, each with a different polynomial. Such a polynomial has highest degree n,
which means it hasn + 1 terms. In other words, the polynomial has a length of n + 1; its
encoding requires n + 1 bits. Note that most polynomial specifications either drop the MSB
or LSB bit, since they are always 1. The CRC and associated polynomial typically have a
name of the form CRC-n-XXX as in the table below.
The simplest error-detection system, the parity bit, is in fact a trivial 1-bit CRC: it uses the
generator polynomial x + 1 (two terms), and has the name CRC-1
Code:
% Transmit two message words of length 6
x = logical([1 0 1 1 0 1 0 1 1 1 0 1]');

% Encode the message words using a CRC generator


hGen = comm.CRCGenerator([1 0 0 1], 'CheckSumsPerFrame',2);
codeword = step(hGen, x);

% Add one bit error to each codeword


errorPattern = randerr(2,9,1).';
codewordWithError = xor(codeword, errorPattern(:));

% Decode messages with and without errors using a CRC decoder


hDetect = comm.CRCDetector([1 0 0 1], 'CheckSumsPerFrame',2);
[tx, err] = step(hDetect, codeword);
[tx1, err1] = step(hDetect, codewordWithError);
disp(err) % err is [0;0], no errors in transmitted message words
disp(err1) % err1 is [1;1], errors in both transmitted message words
Result:
CRC code for error checking has been generated.

12

EXPERIMENT No. : 05
Aim: To study BER performance of BPSK system in AWGN channel
Apparatus Used: MATLAB R2010a
Theory:
The general form for BPSK follows the equation:

This yields two phases, 0 and . In the specific form, binary data is often conveyed with
the following signals:

for binary "0"


for binary "1"
where fc is the frequency of the carrier-wave.
Hence, the signal-space can be represented by the single basis function

where 1 is represented by

and 0 is represented by

. This

assignment is, of course, arbitrary.


This use of this basis function is shown at the end of the next section in a signal timing
diagram. The topmost signal is a BPSK-modulated cosine wave that the BPSK modulator
would produce. The bit-stream that causes this output is shown above the signal (the other
parts of this figure are relevant only to QPSK).
Bit error rate
The bit error rate (BER) of BPSK in AWGN can be calculated as:[7]

or
Since there is only one bit per symbol, this is also the symbol error rate.

13

Code:
% clear
N = 10^6 % number of bits or symbols
rand('state',100); % initializing the rand() function
randn('state',200); % initializing the randn() function
% Transmitter
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 1
n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
Eb_N0_dB = [-3:10]; % multiple Eb/N0 values
for ii = 1:length(Eb_N0_dB)
% Noise addition
y = s + 10^(-Eb_N0_dB(ii)/20)*n; % additive white gaussian noise
% Receiver - hard decision decoding
ipHat = real(y)>0;
% counting the errors
nErr(ii) = size(find([ip- ipHat]),2);
end
simBer = nErr/N; % simulated ber
theoryBer = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber
% plot
close all
figure
semilogy(Eb_N0_dB,theoryBer,'b.-');
hold on
semilogy(Eb_N0_dB,simBer,'mx-');
axis([-3 10 10^-5 0.5])
grid on
legend('theory', 'simulation');
xlabel('Eb/No, dB');
ylabel('Bit Error Rate');
title('Bit error probability curve for BPSK modulation');

14

Output:
Bit error probability curve for BPSK modulation
theory
simulation

-1

10

-2

Bit Error Rate

10

-3

10

-4

10

-5

10

-2

4
Eb/No, dB

Result:
BER performance of BPSK system in AWGN channel has been studied.

15

10

EXPERIMENT No. : 06
Aim: Defining a fading channel object and applying it to a signal.
Apparatus Used: MATLAB R2010a
Theory:
Overview of Fading Channels
Using Communications System Toolbox you can implement fading channels using
objects or blocks. Rayleigh and Rician fading channels are useful models of real-world
phenomena in wireless communications. These phenomena include multipath scattering
effects, time dispersion, and Doppler shifts that arise from relative motion between the
transmitter and receiver. This section gives a brief overview of fading channels and
describes how to implement them using the toolbox.
The figure below depicts direct and major reflected paths between a stationary radio
transmitter and a moving receiver. The shaded shapes represent reflectors such as buildings.

The major paths result in the arrival of delayed versions of the signal at the receiver. In
addition, the radio signal undergoes scattering on a local scale for each major path. Such
local scattering is typically characterized by a large number of reflections by objects near
the mobile. These irresolvable components combine at the receiver and give rise to the
phenomenon known as multipath fading. Due to this phenomenon, each major path behaves
as a discrete fading path. Typically, the fading process is characterized by a Rayleigh
distribution for a nonline-of-sight path and a Rician distribution for a line-of-sight path.
The relative motion between the transmitter and receiver causes Doppler shifts. Local
scattering typically comes from many angles around the mobile. This scenario causes a
range of Doppler shifts, known as the Doppler spectrum. The maximum Doppler shift
corresponds to the local scattering components whose direction exactly opposes the
mobile's trajectory.
Implement Fading Channel Using an Object
A baseband channel model for multipath propagation scenarios that you implement using
objects includes:

N discrete fading paths, each with its own delay and average power gain. A channel for
which N = 1 is called a frequency-flat fading channel. A channel for which N > 1 is
experienced as a frequency-selective fading channel by a signal of sufficiently wide
bandwidth.
A Rayleigh or Rician model for each path.
Default channel path modelling using a Jakes Doppler spectrum, with a maximum Doppler
shift that can be specified. Other types of Doppler spectra allowed (identical or different
16

for all paths) include: flat, restricted Jakes, asymmetrical Jakes, Gaussian, bi-Gaussian, and
rounded.
If the maximum Doppler shift is set to 0 or omitted during the construction of a channel
object, then the object models the channel as static (i.e., fading does not evolve with time),
and the Doppler spectrum specified has no effect on the fading process.
Some additional information about typical values for delays and gains is in Choose
Realistic Channel Property Values
Implement Fading Channel Using a Block
The Channels block library includes Rayleigh and Rician fading blocks that can simulate
real-world phenomena in mobile communications. These phenomena include multipath
scattering effects, as well as Doppler shifts that arise from relative motion between the
transmitter and receiver.
Note To model a channel that involves both fading and additive white Gaussian noise, use
a fading channel block connected in series with the AWGN Channel block, where the
fading channel block comes first.
Code:
% Create Rayleigh fading channel object.
chan = rayleighchan(1/10000,100);
% Generate data and apply fading channel.
M = 2; % DBPSK modulation order
hMod = comm.DBPSKModulator;
% Create a DPSK modulator
hDemod = comm.DBPSKDemodulator; % Create a DPSK demodulator
tx = randi([0 M-1],50000,1);
% Generate a random bit stream
dpskSig = step(hMod, tx);
% DPSK modulate the signal
fadedSig = filter(chan,dpskSig); % Apply the channel effects
% Compute error rate for different values of SNR.
SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR);
% Create an AWGNChannel and ErrorRate calculator System object
hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)');
hErrorCalc = comm.ErrorRate;
for n = 1:numSNR
hChan.SNR = SNR(n);
rxSig = step(hChan,fadedSig); % Add Gaussian noise
rx = step(hDemod, rxSig); % Demodulate
reset(hErrorCalc)
% Compute error rate.
berVec(:,n) = step(hErrorCalc,tx,rx);
end
17

BER = berVec(1,:);
% Compute theoretical performance results, for com comparison.
BERtheory = berfading(SNR,'dpsk',M,1);
% Plot BER results.
semilogy(SNR,BERtheory,'b-',SNR,BER,'r*');

legend('Theoretical BER','Empirical BER');


xlabel('SNR (dB)'); ylabel('BER');
title('Binary DPSK over Rayleigh Fading Channel');
Output:
Binary DPSK over Rayleigh Fading Channel

10

Theoretical BER
Empirical BER

-1

BER

10

-2

10

-3

10

10
12
SNR (dB)

14

Result:
A fading channel has been defined and applied to a signal.

18

16

18

20

EXPERIMENT No. : 07
Aim: To control dc motor by RF Module.
Apparatus Used: MATLAB R2010a
Theory:
Wireless remote controlled toy cars work on the concept explained in this project. Motor
control through RF communication is a very interesting application and is widely used
in robotics, electronics toys, automation systems etc. This topic covers the way DC motors
can be driven by using the controls from a distant place. The controls are transferred from
one end to another by employing an RF module.
The remote control application of RF has been extended to operate a motor driver which in
turn controls the direction of motors.

Result:
DC motor has been controlled by RF module.

19

EXPERIMENT No. : 08

Aim: To transmit and receive data using by interfacing GSM module


Apparatus Used: 1. GSM Antenna and coaxial cable (30 cm)
2. RS-232 Serial cable
3. 42 mm Patch Cords
Procedure:
1.

GSM antenna and coaxial cable (30cm):


Operating Frequency: 900/1800 MHz.

2.

Your modem is actually a low power radio transmitter and receiver. It sends out and
receives radio frequency energy. When you use your modem, the cellular system
handling your calls controls both the radio frequency and the power level of your
cellular modem.
RS-232 Serial cable for interfacing to PC.

3.

Handsfree kit is all the time connected with serial cable.

4.

Adaptor supplied is the only power source for trainer & must be connected
when trainer is in use.

5.

SIM is must for AT commands related to SIM & making calls.

6.

LED continuous on - Modem on but not registered to the network. LED


flashing slowly Idle mode
LED flashing rapidly Tx/Rx mode
LED off Modem off

7.
8.
9.

When command AT is sent to the GSM Trainer ,it every time responses /
acknowledges by ok ,can be use to detect connection.
AT+ Speaker =1, must be the state to use Handsfree kit/ headphones.
Use AT&W, to save the present state/status of any command such as speaker, which
returns to default each time powered on.

Line settings:
How to locate HyperTerminal in windows? In
windows edition, generally it is available in
c:\program files \ accessories \ communication \ Hyper Terminal
A serial link handler is set with the following default values.

20

Speed 9600 (can be varied) 8


bits data,
No parity, 1
stop bit,
None flow control
Command line

Commands always start with AT (which means AT Attention) and finish with a <CR>
character.
Information responses and result codes

If command syntax is incorrect, the ERROR string is returned,


If command syntax is correct but transmitted with wrong parameters, the +CME
ERROR: <Err> or +CMS ERROR: <SmsErr> strings is returned with adequate error
codes if CMEE was previously set to 1. By default,
CMEE is set to 0, and the error message is only ERROR.
If the command line has been executed successfully, an OK string is returned.
In some cases, such as AT+CPIN? or (unsolicited) incoming events, the product
does not return the OK string as a response

Command Level Study


To control the GSM module there is an advanced set of AT commands according to GSM
ETSI (European Telecommunications Standards Institute) 07.07 and 07.05 implemented.
Real Time study of GSM 07.05 & 07 .07 AT Commands:
1.

Command concerning modem & simcard hardware.


21

2.

Network registration commands.

3.

Call control commands

4.

Call setting commands.

5.

Call information commands.

6.

Phone Book commands.

7.

Serial link control commands.

8.

Message setting commands.

9.

Storing / restoring commands.

10. Error message handling & survey & many more.


For user reference, some basic as well as important AT commands response IS given.

Text Response
Sample response on GSM trainer for various standards ETSI AT command as follows:
AT
OK AT+CIMI

404781010000682 /* IDEA SIM IMSI */ OK


AT+CGSN
354056000851034
OK
AT+CMGR=1 /* Checking SMS & received it in text format */ 77
+CMGR: "REC READ","Airtel",06/05/24,10:51: 10+22"
Dear Customer Register, View and Pay your Airtel Bills online at www.airtel.in and you
could be the lucky one to get waiver in your Airtel bill .T&C apply.
OK
AT+CMGR=3
+CMGR: "REC READ","ETISALA",,"06/03/11,20:30:43+16"
Etisalat, UAE national telecom provider welcomes you. Subscribe to AHLAN Visitor
service & make first call home for FREE plus 9 free SMS. For info call 10
OK
AT+CMGS="9893091237" /* Command to send SMS & destination number */
> YES, ITS TEST MSG
>

/* Msg & press enter */


/* CTRL + Z used to end the MSG & start sending the
22

msg */
+CMGS: 26
OK
RING

/* Incoming call */

+CLIP: "+917314032286",145
ATA

/* Incoming call accepted */

+WIND: 9
OK
ATH /* Call disconnected /*
OK
ATDL

/* Command to redial last number */

9893091237;
+WIND: 14 /* SIM Removed & its indication */
AT+CGMI

/* Manufacturer command */

WAVECOM MODEM
OK AT+CGMM

/* Model identification or supported bands */

MULTIBAND 900E 1800


OK
AT+CGMR

/* Software version */

651_09gg.Q2406B 1478872 070705 14:15


OK
AT+CGSN

/* IMEI command */

354056000851034 /* 15 Digit IMEI No.*/


OK
AT+CCID

/* EF (Elementary Files) CCID FILE OF SIM */

+CCID: "8991930202094145991"

/* EF CCID file is of 19 OR 20 digits*/

OK
AT+CPOF

/* IMSI is detached no incoming nor outgoing even other


commands return error ,But still modem remains power ON */
23

OK
+WIND: 8
OK

AT+VTS="1" /* COMMAND to send DTMF tones */ OK


AT+SPEAKER=1 Note: AT+SPEAKER=1 must be the state to use headphones.
OK
AT&W

/* To save the state of speaker */

OK
AT+VGT?

Note: Standard working values of mic. & speaker

+VGT: 2000
OK
AT+VGR?
+VGR: -1000
OK
AT+SIDET=0
NOTE: Must be 0 to reduce noise.
OK
AT+CSQ
/* Command for BER & RSSI Values */
+CSQ: 21,0
OK
AT+COPS=0
/* Registering Automatically */
OK
AT+COPS=? /* Network list */ Note: AIRTEL (Service provider) SIM used.
+COPS:
(2,"AirTel","AirTel","40493"),(3,"","","40467"),(3,"IDEA","IDEA","40478")
,(3,"CellOne","CellOne","40458")
OK
AT Command Set
GSM 07.05 and 07.07 commands:
1.1 Preface:
In the following the <err> parameter is sometimes shown. This parameter and its possible
values are described in chapter Error message handling and survey.
1.2 Commands concerning modem and SIM card hardware:
1. 2.1 Manufacturer identification +CGMI:
Description
This command gives the manufacturer identification.
24

Command syntax: AT+CGMI


Command
AT+CGMI

Possible responses
Wavecom Modem
OK

Note: Get manufacturer identification

Note: Command valid, Wavecom


modem

1.2.2 Request model identification +CGMM:


Description
This command is used to get the supported frequency bands. With multi-band
products the response may be a combination of different bands.
Command syntax: AT+CGMM
Command
AT+CGMM

Possible responses
Multiband 900E 1800

OK
Note: Get hardware version

Note: Multiband: GSM 900 MHz


extended band and DCS 1800

AT+CGMM

900E

Note: Get hardware version


OK

Note: 900 Extended

AT+CGMM

1800

Note: Get hardware version

Ok

Note: DCS
AT+CGMM
Note: Get hardware version
Note: PCS
AT+CGMM
Note: Get hardware version
Note: GSM 850
AT+CGMM
Note: Get hardware version
Note: Multiband: GSM 850 and PCS

1900
Ok
G850
Ok
MULTIBAND G850 1900
OK

25

1.2.3. Request revision identification +CGMR:


Description
This command is used to get the revised software version.
Command syntax: AT+CGMR

Command
AT+CGMR

Possible responses
440_09gm.Q2406A 1266500 020503
17:06
OK

Note: Get software version

Note: Software release 4.40, generated


on the 05t h of February 2003

1.2.4 Product Serial Number +CGSN:


Description
This command allows the user application to get the IMEI (International Mobile
Equipment Identity, 15 digits number) of the product.
Command syntax: AT+CGSN
Command
AT+CGSN

Possible responses
012345678901234
OK
Note: Get the IMEI

Note: IMEI read from EEPROM


AT+CGSN

+CME ERROR: 22

Note: Get the IMEI

Note: IMEI not found in EEPROM

1.2.5. Request IMSI +CIMI:


Description
This command is used to read and identify the IMSI (International Mobile Subscriber
Identity) of the SIM card.
Command syntax: AT+CIMI
Command

Possible responses

AT+CIMI

208200120320598

Note: Read the IMSI

Ok
Note: IMSI value (15 digits),

26

1.2.6 Card Identification +CCID:


Description
This command orders the product to read the EF-CCID file on the SIM card.
Command syntax: AT+CCI

Command

Possible responses

AT+CCID

+CCID:

123456789AB111213141

OK
Note: Get card ID

Note: EF-CCID is present, hexadecimal


format

AT+CCID?

+ CCID:

Note: Get current value

OK

123456789AB111213141

Note: Same result as


+CCID

AT+CCID=?

OK
Note: Get possible value

Note: No parameter but this command is


valid

1.3 Network registration commands:


1.3.1 AT+CPIN:
Command is used to send the PIN to the modem, which is needed to register into the GSM
network. After three unsuccessful attempts to enter the PIN the PUK is required. As second
parameter the user should provide a new PIN. After 10 unsuccessful attempts to enter the
PUK the SIM card is damaged.
Command

Possible responses

+CPIN=<pin>

Ok

+CME ERROR: <err>

+CPIN=<puk>,<new pin>

Ok

+CME ERROR: <err>

+CPIN?

+CPIN: <code>

+CME ERROR: <err>

+CPIN=?

Ok

Defined values:
<pin>, <newpin>: 4 to 8 digits string type value
<puk>: 8 digits string type value
<code>: Ready Modem is not pending for any password
SIM PIN Modem is waiting SIM PIN to be given
SIM PUK Modem is waiting SIM PUK to be given
27

Remarks: +CME ERROR: 16


Shows up if wrong PIN is entered.

+CME ERROR: 12

Shows up if wrong PUK number is entered. +CME ERROR: 13


SIM card is damaged

+CME ERROR: 10

Means that no SIM card is inserted.


Source: GSM 07.07/8.3
Implementation: complete
1.3.2 AT+CREG:
Command is used to show the network registration status and to control the presentation of
an unsolicited result code +CREG: <stat> when there is a change in the network
registration status
Command

Possible responses

+CREG=[<n>]

OK

Unsolicited result codes:


+CREG: <stat>
+CREG: <stat>,<lac>,<ci>

if <n> equals 1
if <n> equals 2

+CREG?

+CREG: <n>,<stat> (n=1)


+CREG:
<n>,<stat>,<lac>,<ci>
(n=2)

+CREG=?

+CREG: (list of supported +CME ERROR: <err>


<n>s)

+CME ERROR: <err>

Defined values:
<n>: 0 disable network registration unsolicited result code 1
enables network registration unsolicited result code
2 enable network registration unsolicited result code with <lac> and <ci><stat>: 0 not
registered, ME is not currently searching a new operator to register to
1 registered, home network
2 not registered, but ME is currently searching a new operator to register to 3
registration denied
4unknown
5 registered, roaming
<lac>: String type; two byte location area code in hexadecimal format (e.g. 00C3
equals 193 in decimal)
<ci>: String type; two byte cell ID in hexadecimal format
Remarks: none
28

Source: GSM 07.07/7.2


Implementation: complete
1.3.3 AT+COPS:
Command is used to show the current and the available PLMNs. It is also used to select a
PLMN manually or automatically.
Command
+COPS=[<mode>
[,<format>[,<oper>]]]

Possible responses
OK
OK +CME ERROR:
.
<err>
.

+COPS?

+COPS:
<mode>[,<format>,<oper>]

+CME ERROR: <err>

+COPS=?

+COPS: list of
supported(<stat>,
<long alphanumeric oper>,
<short alphanumeric oper>,
<numeric oper>,)s

.
+CME ERROR: <err>

Defined values:
<mode>: 0 automatic (<oper> field is ignored) 1
manual (<oper> field shall be present) <format>:
2 numeric <oper>
<oper>: string type; GSM Location Area Identification number which consists of a three
BCD digit country code coded as in ITU-T E.212 annex A [10], plus a two BCD digit
network code, which is administration specific
<stat>: 0 unknown
1 available
2 current
3 forbidden
Remarks: none
Source: GSM 07.07/7.3
Implementation: complete
Result:
Data has been transmitted and received by interfacing GSM module.

29

You might also like