Professional Documents
Culture Documents
FMA Lab Manual 2019 Patt Final
FMA Lab Manual 2019 Patt Final
Laboratory Manual
Fundamentals of
Microcontroller
& its Application
Lab Manual
Mr. RAJAN PATEL
Asst. Prof.
Electrical Engg. Dept., GCOERC
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
B-5 Develop a program in C to read and send SMS from the GSM module
Development of mobile app for various applications in electrical
B-6 engineering
CERTIFICATE
This is to certify that Mr. /Miss. / Mrs. _________________________________________________ Examination
Seat Number ____________________ of Second Year Electrical Engineering (Semester- IV) has
satisfactorily completed the Term Work/ Practical/Oral in the subject Fundamental of
Microcontroller & it’s Application (203149) during the academic year 2020-2021.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Institute Vision
An institute striving for excellence in providing Transformative Academic
Education and Stimulating environment for Research to enhance skills for Developing
Intellectuals and to Inculcate quality education with Social and Technical knowledge
which will benefit the Society and Industrial Challenges.
Institute Mission
1) To be a Technical Educational Institute in transforming aspiring engineers
through rigorous course work and technical skills.
2) To benchmark with the best global standards of quality education.
3) To enhance commitment of the faculty, staff and students by inculcating the spirit
of inquiry, team work and professionalism.
4) Establish a Centre of Excellence to enhance academia-industry partnership, work
on collaborative projects, and develop new products, services and patents.
5) To develop globally competent students by enhancing indigenous technologies
and inculcate entrepreneurship in them.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
PROGRAM OUTCOME
PO1 Apply the knowledge of mathematics, science, Electrical Engineering fundamentals to
get the solution for different engineering problems.
PO2 Identify, formulate and analyze different Electrical Engineering problems and reaching
sustained conclusion using the principle of mathematics, natural sciences and
engineering fundamentals.
PO3 Design the solutions for different electrical engineering problems, components or
processes that meet the specified needs with appropriate considerations & social
aspects.
PO4 Use knowledge of Electrical Engineering which includes design of experiments,
analysis and interpretation of data and synthesis of information to provide valid
conclusions.
PO5 Apply appropriate techniques, resources, modern engineering and IT tools including
prediction and modelling to complex engineering activities with understanding of the
limitations.
PO6 Use appropriate knowledge to assess society welfare and consequent responsibility
relevant to professional engineering practices.
PO7 Understand the impact of professional engineering solution in social and
environmental context and demonstrate the knowledge, and need for sustainable
development.
PO8 Apply ethical principles and responsibilities commit to professional engineering
practices for the society
PO9 Function effectively as an individual, a member or leader in diversity and multi-
disciplinary fields.
PO10 Communicate effectively in professional engineering activities with society to
understand and write effective reports, presentations with clear interpretation
Demonstrate and apply knowledge of engineering management skills with
PO11
understanding financial aspects in multi-disciplinary environments.
PO12 Recognize the social needs and prepare it for lifelong learning in the growing
technological change.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Instructions to students
Maintain silence and discipline.
Students keep their bags in the rack.
Students must take care of their valuable things.
Students must bring Observation book, record and manual along with pen, pencil,
and eraser Etc., no borrowing from others.
Students must handle the trainer kit and other components carefully, as they are
expensive.
Before entering to lab, must prepare for Viva for which they are going to conduct
experiment.
Before switch on the trainer kit, must show the connections to one of the faculties
or instructors.
After the completion of the experiment should return the components to the
respective lab instructors.
Before leaving the lab, should check whether they have switch off the power
supplies and keep their chairs properly.
Do’s And Don’ts
Be regular to the Lab Do not come late to the Lab.
Do not throw connecting wires on the Floor.
Wear your College ID card.
Do not operate the IC trainer kits without permission.
Avoid unnecessary talking while doing the experiment.
Avoid loose connection and short circuits.
Take the signature of the lab in charge before taking the components.
Do not interchange the ICs while doing the experiment.
Handle the trainer kit properly.
Do not panic if you do not get the output.
Keep your work area clean after completing the experiment.
After completion of the experiment switch off the power and return the
components.
Arrange your chairs and tables before leaving.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Location Services:
GPS
GLONASS
Galileo
IoT modules and IoT terminals use a variety of wireless technologies to stay
seamlessly and securely connected.
These range from :
5G, 4G, and 3G cellular solutions for high bandwidth applications like connected cars,
to Low-Power, Wide-Area (LPWAN) solutions such as MTC (Machine Type
Communication),
Bluetooth and LoRa are used for intelligent road systems, smart city applications, and
enterprise applications.
Types of Iot Modules:
1. LPWANs
Low Power Wide Area Networks (LPWANs) are the new phenomenon in IoT.
By providing long-range communication on small, inexpensive batteries that last for
years, this family of technologies is purpose-built to support large-scale IoT networks
sprawling over vast industrial and commercial campuses.
LPWANs can literally connect all types of IoT sensors – facilitating numerous
applications from asset tracking, environmental monitoring and facility
management to occupancy detection and consumables monitoring.
2. Cellular (3G/4G/5G)
Well-established in the consumer mobile market, cellular networks offer
reliable broadband communication supporting various voice calls and video
streaming applications. On the downside, they impose very high operational costs
and power requirements.
While cellular networks are not viable for the majority of IoT applications
powered by battery-operated sensor networks, they fit well in specific use cases such
as connected cars or fleet management in transportation and logistics.
3. Zigbee and Other Mesh Protocols
Zigbee is a short-range, low-power, wireless standard (IEEE 802.15.4),
commonly deployed in mesh topology to extend coverage by relaying sensor data
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
over multiple sensor nodes. Compared to LPWAN, Zigbee provides higher data rates ,
but at the same time, much less power-efficiency due to mesh configuration.
Because of their physical short-range (< 100m), Zigbee and similar mesh
protocols (e.g. Z-Wave, Thread etc.) are best-suited for medium-range IoT
applications with an even distribution of nodes in close proximity. Typically, Zigbee
is a perfect complement to Wi-Fi for various home automation.
4. Bluetooth and BLE
Defined in the category of Wireless Personal Area Networks, Bluetooth is a
short-range communication technology well-positioned in the consumer
marketplace. Bluetooth Classic was originally intended for point-to-point or point-
to-multipoint data exchange among consumer devices.
BLE-enabled devices are mostly used in conjunction with electronic devices,
typically smartphones that serve as a hub for transferring data to the cloud.
Nowadays, BLE is widely integrated into fitness and medical wearables (e.g.
smartwatches, glucose meters, pulse oximeters, etc.) as well as Smart Home devices
5. Wi-Fi
There is virtually no need to explain Wi-Fi, given its critical role in providing
high-throughput data transfer for both enterprise and home environments. However,
in the IoT space, its major limitations in coverage, scalability and power consumption
make the technology much less prevalent.
Imposing high energy requirements, Wi-Fi is often not a feasible solution for
large networks of battery-operated IoT sensors, especially in industrial IoT and smart
building scenarios. Instead, it more pertains to connecting devices that can be
conveniently connected to a power outlet like smart home gadgets and appliances,
digital signages or security cameras.
6. RFID
Radio Frequency Identification (RFID) uses radio waves to transmit small
amounts of data from an RFID tag to a reader within a very short distance. Till now,
the technology has facilitated a major revolution in retail and logistics.
Conclusion: - Hence we studied and understand IoT Module.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Aim: Interfacing of GSM with a computer through COM port to Send and Receive SMS.
Objective:
1. To understand serial communication.
Theory
The modem can either be connected directly to the PC serial port or to any microcontroller
through MAX232. It can be used to send and receive SMS or to make/receive voice calls. It
can also be used in GPRS mode to connect to the internet and do many applications for data
logging and control. In GPRS mode you can also connect to any remote FTP server and
upload files for data logging.
Software description
To communicate with the network we use ELEMENTZ GSM Modem Test
Utility software.
It is an executable file which supports serial data transmission and reception similar
to HyperTerminal in Windows XP.
How to connect to computer ?
Firstly insert the SIM card in the sim holder. Make sure to use a normal SIM card
(Micro or nano SIM cards are not supported)
Connect the GSM modem to the usb2serial hardware via DB9 connector. Then using
a USB A to B cable connect to the computer.
Connect a 12V/9V 1A adapter to the power jack provided on the GSM
modem. The LM317 voltage regulator regulates the voltage to 3.6V.
Please note when you connect the power, a RED LED will glow. It shows that the
modem has got the power required for its operation.
When you connect the power , a BLUE LED will glow for approximately 1sec. After
that it will blink with a delay of approximately half sec. That means the SIM card is
searching for network. If the SIM card has connected to a network, then the BLUE
LED will blink with a delay of approximately 4sec. Depending on the network
strength, the time to connect to a network may vary. If there is no SIM card in the
modem, the BLUE LED blinks with a delay approximately half sec.
The steps required for connecting the modem to the PC is shown below:
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Right click My Computer → select the Device manager →Ports(COM & LPT).
Note the COM PORT. Here you can see its COM3.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Click on “Port” dropdown menu. Select COM Port for your device. Here its COM3.
Then click on Open port. The status box will show “Port opened successfully.
Message cleared.”
Connect the 12V/9V 1A adapter to the power jack of the modem. You can see the
following details in the status box.
“+CFUN: 1 ”
“+CPIN: READY”
“CALL READY” This means that the modem is ready for normal functioning.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Please note if SIM is not inserted then it will show “+CPIN: NOT INSERTED”.
Making a CALL
To make a call, enter the phone number and press the Call button.
The status box will show “Data received: ATD9037200424; “. This is the AT
command for making a call.
If a call is coming to the GSM modem, a series of “RING” will appear on ths Status
box.
If you want to connect to the call ,then type “ATA” in the AT command window and
press “Execute“.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Sending message
The first thing you have to do before sending a message is to make the modem to text
mode.
To do that type ” AT+CMGF=1;&W ” in the AT command window and press
execute. DO NOT TYPE THE DOUBLE QUOTES. &W is used to write to the
SIM900a memory permanently.
To send a message, type the phone number in Phone number window and the
message content in the Message window and press the Send button.
You can see that after the message has been sent, the modem gives a response
“+CMGS: 234″.
From this you can confirm that message has been sent successfully.
The number 234 means 234 messages has been sent from the modem.
The AT command for sending message is AT+CMGS=”9036800569″. When you
press enter, “>” prompt will appear.
Type the content of the message and after that press Ctrl+z to send the message.
Conclusion: - Hence we studied and understand interfacing of GSM with computer 7
also serial communication.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Aim: Interfacing GSM with 8051 trainer kit and develop a program to send AT
commands.
Objective:
1. To understand serial communication.
Theory
Mobile 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. This article describes interfacing of a GSM modem to
an AT89C51 microcontroller.
The main principle of this circuit is to interface a GSM modem with the
microcontroller. The microcontroller used is AT89C51 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.
Command – Operation
AT+CSMS – Select message service. AT+CMGF – Message format.
AT+CMGL – List messages. AT+CMGR – Read message.
AT+CMGS – Send message. AT+CMGD – Delete message.
ATA – Answer a call. ATD – Dial a number.
ATDL – Dial the last outgoing number. ATH – Hang up the call.
Instead of sending commands from the HyperTerminal, AT commands are sent to
the GSM/GPRS module by the microcontroller itself. In this case, the receive (Rx) and
transmit (Tx) pin of the GSM module’s RS232 port are connected to the transmit (Tx) and
receive (Rx) pin of AT89C51’s serial port, respectively. This eliminated the role of
computer and just the controller’s circuit provides a complete user interface for the
module.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
The controller is programmed to send a fixed command ‘AT’ to the module. The
command AT is used to check the communication with module. It returns a result code
OK if the module and the controller are connected properly. If either of the module or SIM
are not working, it returns a result code ERROR.
The program complexities for display of information responses and result codes
on LCD mentioned in MC075 remain same here as well.
How to Operate GSM Interfacing with 8051 Microcontroller Circuit?
Initially, connect the circuit as shown in the circuit diagram.
Switch on the power supply.
Now send a message from any other phone to the SIM present in the GSM module.
Whenever a message is received by the GSM, it is displayed on the LCD.
If you want to send a message press the button B1 connected to port B.
This sends a message written in the code.
Project Source Code
#include<reg51.h>
#define port P1
#define dataport P2 // Data port for LCD
sbit rs = port^2;
sbit rw = port^3;
sbit en = port^4;
int count,i;
unsigned char check,str[15];
bit check_space;
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
void transmit_data(unsigned char str) // Function to transmit data through serial port
{
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
void receive_data() interrupt 4 // Function to recieve data serialy from RS232 into
microcontroller
{
RI=0;
str[++count]=SBUF; //Read SBUF
unsigned char byte_check() // Function to check carraige return and new line
character
{
switch(str[0])
{
case 0x0a:
{ // Return 0x00 for new line
return 0x00;
break ;
}
case 0x0d:
{ // Return 0x01 for carriage return
return 0x01;
break ;
}
default :return 0x02 ; // Return 0x02 for characters except new line and
carriage return
}
}
void main()
{
lcd(); // Initialize LCD
init_serial(); // Initialize serial port
count=(-1);
delay(500);
lcd_data_string("Ready");
delay(10);
lcd_cmd(0x01);
IE=0x94;
transmit_data('A'); // Transmit 'A' to serial port
delay(1);
transmit_data('T'); // Transmit 'T' to serial port
delay(1);
transmit_data(0x0d); // Transmit carriage return to serial port
delay(50);
while(1)
{
if(count>=0)
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
{
check=byte_check(); // Check the character
if(check!=0x00)
{
if(check==0x01)
{
if(check_space==1) // Check previous character
{
lcd_data(0x20);
check_space=0;
}
}
else
{
lcd_data(str[0]);
check_space=1;
}
}
count--;
for(i=0;i<count;i++) // Shift the whole array to one left
{
str[i]=str[i+1];
}
}
}
}
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Aim: Develop a program in C to read and send SMS from the GSM module.
Objective:
1. To understand C language.
Theory
Program to Send SMS:
#include <reg51.h>
#define NUMBER 0123456789 //Here insert your number where you want
to send message
void ser_init();
void tx(unsigned char send);
void tx_str(unsigned char *s);
unsigned char rx();
void sms(unsigned char *num1,unsigned char *msg);
void gsm_delay();
unsigned int dell;
int main()
{
ser_init();
sms(NUMBER, "Welcome to the Embetronicx");
while(1);
}
void ser_init()
{
SCON=0x50;
TMOD=0x21;
TH1=0xFD;
TL1=0xFD;
TR1=1;
}
void tx(unsigned char send)
{
SBUF=send;
while(TI==0);
TI=0;
}
void tx_str(unsigned char *s)
{
while(*s)
tx(*s++);
}
unsigned char rx()
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
{
while(RI==0);
RI=0;
return SBUF;
}
void gsm_delay()
{
unsigned int gsm_del;
for(gsm_del=0;gsm_del<=50000;gsm_del++);
}
void sms(unsigned char *num1,unsigned char *msg)
{
tx_str("AT");
tx(0x0d);
gsm_delay();
tx_str("AT+CMGF=1");
tx(0x0d);
gsm_delay();
tx_str("AT+CMGS=");
tx('"');
while(*num1)
tx(*num1++);
tx('"');
tx(0x0d);
gsm_delay();
while(*msg)
tx(*msg++);
tx(0x1a);
gsm_delay();
}
Conclusion; Hence we understand C language for sending SMS using GSM
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
1. At the top of the project's file system tree, right click on "app."
2. Navigate through to New > Activity > Blank Activity.
3. Change the name of this activity to "SecondActivity".
4. Click "Finish."
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
1. Select the MainActivity.java tab along the top of the work environment.
2. Add the following lines of code at the end of the onCreate method:
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.onClickListener() {
@Override
public void onClick(View v) {
goToSecondActivity();
}
});
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
1. Click the green play symbol from the toolbar at the top of the Android Studio window.
2. When the "Choose Device" dialog apperas (this may take a few moments), select the
"Lauch emulator" option.
3. Click OK.
4. When the emulator opens (this too could take awhile), the app will automatically
launch the app upon the virtual phone being unlocked.
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
5. Make sure that all of your text displays correctly and that the button takes you to the
next page.
Step 8: Up, Up, and Away!
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”
Guru Gobind Singh Foundation’s
Guru Gobind Singh College of Engineering & Research Centre
(Approved by AICTE Gov. of Maharashtra & DTE Mumbai. Affiliated to Savitribai Pune University)
NAAC Accreditation First Cycle “B+” with CGPA 2.72 in April 2019, DNY- GL – Certified for ISO 9001 2015 Standards
Khalsa Education Complex, Guru Gobind Singh Marg Wadala, Parthidi Road, Indira Nagar, Nashik-9
Ph: 0253 2372766, 2372666 Email- gcoerc.nashik@ggsf.edu.in, Website – www.ggsf.edu.in
Program:
class ComputeElectricityBill
{
public static void main(String args[])
{
int units=280;
double billpay=0;
if(units<100)
{
billpay=units*1.20;
}
else if(units<300)
{
billpay=100*1.20+(units-100)*2;
}
else if(units>300)
{
billpay=100*1.20+200*2+(units-300)*3;
}
System.out.println("Bill to pay : " + billpay);
}
}
We Transform Youngsters …..By Creating “Intellectuals innovative Learners with social Commitment”