Monday, 1 October 2012


How microcontrollers control the world


Microcontrollers are a modern day miracle of science which has revolutionized the world of robotics, artificial intelligence and embedded systems as a whole. Different types of microcontrollers are available in the market. You must know your requirements before you decide to buy one. Before that, it is important to know about what a microcontroller exactly is and what does it do.

Microcontrollers also known as µC, uC or MCU are basically small computers which are operated on single integrated circuits that also contain memory, a processor and programmable input and output peripherals. In robotics, these MCUs are basically defined as intelligent electronic devices which can be used within robots to control them via programs. They perform various functions which are also quite similar to the ones performed by microprocessors inside computer.

These electronic embedded devices are nowadays extensively used in various automatically controlled machines and products, for example various hi-tech automobile and vehicular engine control systems, different types of hi-tech electronic medical devices that can be implanted within the patients’ bodies, remote controls for television, air-conditioners and other devices, different office machines, home appliances, important power tools used in industries and even attractive mechanical toys. A microcontroller contains processor core, memory, peripherals all on the same chip. As a result, the cost as well as the size is much reduced when compared to a device which contains separately, microprocessors, memory and input and output peripheral devices etc. Microcontrollers have made it extremely economical to control digitally even more complex devices and other complicated and tedious processes where human efficiency may fail to produce the best results. Most common types of microcontrollers are the mixed signal microcontrollers which basically integrate various analog gadgets that are needed to completely and efficiently control various non-digital sophisticated electronic systems.

Various types of microcontrollers are available in the market. They are used for different purposes as well. There are 8051 microcontrollers, PIC microcontrollers etc. These microcontrollers are very much in demand amongst robotics hobbyists. They are utilized by amateur robot enthusiasts as well as in laboratories which conducts various researches in robotics and artificial intelligence as a whole. These robots are utilized to perform various actions such as in medical operations, manning spacecrafts, in military purposes, in researches, space probes, educational purposes etc. So much is the demand for high-performing robots that every a robotics industry manufacturing and selling robots commercially has spawned and is doing brisk business raking in quite a moola. The industry has spawned a number of jobs for engineers, scientists, programmers etc who are also interested in the intricate art of building mechanical or autonomous robots.

Microcontrollers need to be programmed. If you’re a robotics enthusiast, you need to learn embedded c programming to program the device so that it can interact with the environment and other hardware devices. The internet has several microcontroller tutorials which you must study thoroughly to get familiar with these devices. Many institutes nowadays teach programming microcontrollers in c for the benefit of those who’re interested to build their own robots but stumble at the programming part.

Put in some effort to learn embedded c programming and you will see how you get hooked to it


Interfacing Stepper motor with 8051 microcontroller

Interfacing Stepper motor with driver circuit and 8051 microcontroller.
There are 3 buttons for forward, reverse and stop functions.

Circuit Diagram

C Code

Code:
#include <reg51.h>
#include <absacc.h>
sbit p10=P1^0;
sbit p11=P1^1;
sbit p12=P1^2;

#define  UP   20
#define  DOWN  30
#define  STOP  40

void delay()//Delay process
{
 unsigned i,j,k;
 for(i=0;i<0x02;i++)
  for(j=0;j<0x02;j++)
   for(k=0;k<0xff;k++);
}

main()
{
 unsigned char temp;
 while(1)
 {
  if(p10==0)
  {
   temp=UP;//Control is transferred
   P2=0X00;
   delay();
  }
  if(p11==0)
  {
   temp=DOWN;//Inversion of control
   P2=0X00;
   delay();
  }
  if(p12==0)
  {
   temp=STOP;//Control stop
  }
  switch(temp)
  {
  case DOWN : P2=0X01;//Inversion of control //0011
     delay();
     delay();
     P2=0X02;//0110
     delay();
     delay();
     P2=0X04;//1100
     delay();
     delay();
     P2=0X08;//1001
     delay();
     delay();
     break;
  case UP : P2=0X08;//Control is transferred
     delay();
     delay();
     P2=0X04;
     delay();
     delay();
     P2=0X02;
     delay();
     delay();
     P2=0X01;
     delay();
     delay();
     break;
  case  STOP ://Control stop
     P2=0X00;
     delay();
     delay();     
     break;
  }
   }
}
Download proteus file: ex-22.zip