Showing posts with label microcontroller. Show all posts
Showing posts with label microcontroller. Show all posts

Saturday, 22 November 2014

GSM Controlled Robot using Microcontroller

GSM controlled robot or SMS controlled robot is a wireless robot which performs the necessary actions by receiving a set of instructions in the form a Short Message Service (SMS). In this project we can control the robot directions like forward, backward, left and right by sending SMS from the mobile. Earlier, we have already seen the working of a DTMF Controlled Robot without using Microcontroller.
This project mainly consists of 2 sections, one is mobile unit and the other one is robot unit. The GSM modem which is fixed at the robot receives the messages sent by the mobile and gives the instructions to the microcontroller to control the robot directions. In this project, we interface 8051 microcontroller with GSM SIM 300. The protocol used for the communication between controller and GSM modem is UART (Universal Asynchronous Receiver-Transmitter). This system continuously checks for message to take the decision for controlling the robot.

GSM Controlled Robot Circuit Principle:

When we send the message from the mobile to the modem, GSM modem sends the below command serially to indicate that new message is received.

+CMTI: “SM”,3
In the above command number 3 indicates the location of the new message. Now we need to read this unread message to display it on LCD. The command to read the message from GSM modem is

at+cmgr=3
Here the number 3 indicates the location of the message to be read. After sending this command to GSM module, modem sends the below command serially.

+CMGR: “REC UNREAD”,”MD-WAYSMS”,,”13/05/20,15:31:48+34″ forward
In the above command “REC UNREAD” indicates that message is unread message, “MD-WAYSMS” indicates sender mobile number or name, 13/05/20 indicates the date, 15:31 indicates time and forward is the content of the message.
From the above command, we need to extract message (forward) sent by the user. Now compare this message with predefined strings (forward, backward, left, right), based on result control the robot.

GSM Controlled Robot Block Diagram:


 GSM Controlled Robot using 8051 Microcontroller Circuit:




Hardware Requirements:

  • 8051 Microcontroller
  • AT89C51 Programming board
  • Programming cable
  • 16*2 LCD
  • MAX 232 level converter
  • GSM sim 300 module
  • L293D motor driver
  • Robot
  • 9V DC batteries – 2
  • 5V power supply circuit
  • 0.1uF ceramic capacitors – 4
  • 33pF capacitors – 2
  • 10uF electrolytic capacitor
  • 12MHz crystal
  • 10k (1/4 watt) resistor
  •  Single pin connecting wires 



Software Requirements:

  • Kiel U vision
  • Flash magic
  • Proteus    

    SMS Controlled Robot Circuit Design:

    The major components used in the above circuit are microcontroller, motor driver, level converter, GSM module and robot. Here at89c51 microcontroller is used and it requires a power supply of positive 5V DC. In order to provide regulated 5V DC voltage to the controller, use 7805 power supply circuit. Here two 9V batteries are used, one is for giving the supply to the circuit and other is to run the DC motors.
    In the above circuit, 16 x 2 LCD is connected to the PORT1 of the microcontroller in 4 bit mode. LCD data lines D4, D5, D6 and D7 are connected to P1.4, P1.5, P1.6 and P1.7 respectively and control pins are connected to P1.0, P1.1 and P1.2. Here it used to indicate the received message.
     GSM modem Tx and Rx pins are connected to the 13 and 14 pins of max232. Microcontroller TXD and RXD pins are connected to the 11 and 12 pins of level converter. Here max232 is a mediator between controller and GSM module and it is used to convert the voltage levels. To know more details about max232 refer MAX 232 Datasheet.
    GSM module requires 5V power supply. In order to communicate with this GSM we need to send AT commands using serial communication (UART protocol). Use a baud rate of 9600 to communicate with GSM.
    P2.0, P2.1, P2.2 and P2.3 pins of controller are connected to the l293d input pins and these pins are used to control the two DC motors. The operating voltage of this IC is 5V. Using this IC we can operate the 2 DC motors with a voltage ranging from 4.5 to 36V. We need to apply the motors supply at 8th pin of l293d. To know more about motor driver IC refer L293 Datasheet


    GSM Controlled Robot Circuit Working Algorithm:

  • Initialize the LCD and UART protocol
  • Continuously check for the command +CMTI: “SM”,3 (Location number) to know weather new message is received or not
  • If you receive the command then store message location number.
  • Now read that particular message and extract the body of the message
  • Display the extracted content on LCD and compare this content with predefined strings.
  • If matched then perform the necessary action on robot.   
    Use below code to read a new message from the GSM modem.
    while (rx_data() ! = 0x0d);
    while (rx_data() ! = 0x0a);
    if (rx_data() == ‘+’)
    {
    if (rx_data() == ‘C’)
    {
    if (rx_data() == ‘M’)
    {
    if (rx_data() == ‘T’)
    {
    if (rx_data()==’I’)
    {
    while (rx_data() != ‘,’);
    a = rx_data ();
    delay_ms (10);
    tx_string (“at”);
    tx_data (0x0d);
    tx_data (0x0a);
    tx_string (“at + cmgf =1″);
    tx_data (0x0d);
    tx_data (0x0a);
    tx_string (“at + cmgr =”);
    tx_data (a);
    tx_data (0x0d);
    tx_data (0x0a);
    while (rx_data() ! = 0x0a);
    while (rx_data() != 0x0a);
    while (rx_data() ! = 0x0a);
    for (i=0; i<15; i++)
    {
    read [i]= rx_data();
    }
    lcd_stringxy(1,0,read);
    delay_ms (5000);
    }
    }
    }
    }
    }

    How to Operate GSM Mobile Controlled Robot?

  • Write the program to the GSM controlled robot project using keil software
  • Now burn the program to the microcontroller with the help of flash magic.
  • Give the connections as per the circuit diagram.
  • Use power supply circuit to provide 5V DC to the microcontroller
  • Insert the SIM (Subscriber Identity Module) to the GSM module.
  •  Now switch on the supply
  • Send SMS to the GSM module using other mobile
  • Now you can see the same message on LCD.
  •  If the received message match with any predefined string then robot moves accordingly.


GSM Controlled Robot Circuit Applications:


  • This project is used in robotic applications
  • Used in military applications.

Limitations of the Circuit:

  • Robot section must have the network to receive the commands wirelessly.
  • As there is no password any one can operate the robot by sending message.

Thursday, 25 July 2013

Classification of Microcontrollers

A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM.


Types of Microcontroller:

The microcontrollers are characterized regarding bus-width, instruction set, and memory structure. This article is going to describe some of the basic types of the Microcontroller that newer users may not know about. So the microcontroller can be classified according to their charecteristics as shown in graph below:


Bits:

  • The bits in microcontroller are 8-bits, 16-bits and 32-bits microcontroller.In 8-bit microcontroller, the point when the internal bus is 8-bit then the ALU is performs the arithmetic and logic operations. The examples of 8-bit microcontrollers are Intel 8031/8051, PIC1x and Motorola MC68HC11 families.
  • The 16-bit microcontroller performs greater precision and performance as compared to 8-bit. For example 8 bit microcontrollers can only use 8 bits, resulting in a final range of 0×00 – 0xFF (0-255) for every cycle. In contrast, 16 bit microcontrollers with its 16 bit data width has a range of 0×0000 – 0xFFFF (0-65535) for every cycle. A longer timer most extreme worth can likely prove to be useful in certain applications and circuits. It can automatically operate on two 16 bit numbers. Some examples of 16-bit microcontroller are 16-bit MCUs are extended 8051XA, PIC2x, Intel 8096 and Motorola MC68HC12 families.
  • The 32-bit microcontroller uses the 32-bit instructions to perform the arithmetic and logic operations. These are used in automatically controlled devices including implantable medical devices, engine control systems, office machines, appliances and other types of embedded systems. Some examples are Intel/Atmel 251 family, PIC3x.

Memory/Devices:

Embedded microcontroller: When an embedded system has an MCU that has all the hardware and software units in a single unit, the MCU is called embedded microcontroller. Very few or no other external unit or system is present for processing during the control or use of the external devices. For example, a telephone handset circuit uses an embedded microcontroller.

External memory microcontroller: When an embedded system has an MCU that has all the hardware and software units present not as a single unit and has all or part of the memory unit externally interfaced using an interfacing circuit which is called the glue circuit, the MCU is called an external memory microcontroller. For example, 8031 has the program memory which is interfaced externally to it. The 8051 has both internal as well as external program memory.

Family:
The microcontrollers can also be classified according to their family. family is usually a company or a manufacturer in which controller is fabricated. Each family have its own architecture and instruction set. some though 8051 is famous but PIC and ARM are going more popular than 8051.

Instruction Set:

Complicated Instruction Set Computer (CISC) architecture microcontroller: When an MCU has an instruction set that supports many addressing modes for the arithmetic and logical instructions and when there are the memory accesses during the ALU operations and the data transfer instructions, the MCU is said to be possessing CISC-architecture.
CISC provides flexibility in choosing various ways of performing the data transfer, arithmetic and other operations. For example, it is feasible to add contents of two registers or add the register and memory or add the bits at two memory addresses in a CISC. Instructions are of variable number of bytes in the CISC. These can take varying amounts of time interval for execution. An example is Intel 8096.

Reduced Instruction Set Computer (RISC) microcontroller: When an MCU has an instruction set that supports a few addressing modes for the arithmetic and logical instructions and just a few (load, store, push and pop) instructions for the data transfer, the MCU is said to be of RISC architecture. RISC provides no flexibility in choosing the many different ways of performing the arithmetic and logic operations. These operations are performed after the load of operands in the registers, and the results of these operations are placed in registers. The register contents are later on stored in the memory. RISC implements each instruction in a single cycle using a distinct hardwired control. It uses a lesser amount of circuitry. It has less power dissipation. There is reduced instruction set. Instructions are of fixed number of bytes and take a fixed amount of time for execution. It has many registers. Therefore, operations can be performed using them. The need for external fetches from the memories are greatly reduced. (An external fetch is to be done by the CPU for an operand more frequently in the CISC). The RISC provides a higher performance in computing than the CISC. This is because little need of the external fetches, which takes a significant amount of processor time. High performance is also because of hardwired implementation of instructions. An example of RISC architecture is the ARM processor family-based MCU


Memory Architecture:


  • Harvard Memory Architecture Microcontroller: The point when a microcontroller unit has a dissimilar memory address space for the program and data memory, the microcontroller has Harvard memory architecture in the processor.
  • Princeton Memory Architecture Microcontroller: The point when a microcontroller has a common memory address for the program memory and data memory, the microcontroller has Princeton memory architecture in the processor.

This is how the MICs are classified, there may be some other types but most of the types can be seen through this major classification.

Thursday, 18 July 2013

Let commence with 8051.

Hay guys…
  Welcome to the micro world i.e.… 8051 one of the very familiar  stream of our branch . The whole story has its beginnings in the far 80s when Intel launched the first series of micro-controllers called the MCS 051. Even though these micro-controllers had quite modest features in comparison to the new ones, they conquered the world very soon and became a standard for what nowadays is called the micro-controller.
The main reason for their great success and popularity is a skillfully chosen configuration which satisfies different needs of a large number of users allowing at the same time constant expansions.

  • 4 Kb of ROM is not much at all.
  • 128b of RAM (including SFRs) satisfies the user's basic needs.
  • 4 ports having in total of 32 input/output lines are in most cases sufficient to make all necessary connections to peripheral environment.
The whole configuration is obviously thought of as to satisfy the needs of most programmers working on development of automation devices.
Here we are going for many more applications and interfacing of various devices e.g.- ADC , stepper motor etc .  and also share some tricks for configuring the various devices with 8051 .
The various tools available for the assessment of 8051 is keil, SPJ Terminal etc. We will also go for certain practical based implementation as assignment and much more.