Showing posts with label Microcontroller project. Show all posts
Showing posts with label Microcontroller project. Show all posts

8051 programmer kit



All the student's may not properly works on microcontroller because  shortage of programmer kit(burner kit) whatever the  problem they have ,so now you can make your own programmer kit for 8051 microcontroller and can make more practical application and learn more efficiently in this field.For making the programmer kit we make the circuit step by step.
FOR P89V51RD2 microcontroller






Power Supply


  • Power supply 

  • DB9 connector

  • Line driver circuit

  • 8051 

  • final circuit of Programmer kit


1.  POWER SUPPLY: Before making any circuit we need to design its power supply it consist of many part like step down, ac-dc conversion, voltage stabilizing etc but we will giving the power to our board from an 12-volt adapter so our power supply consist of a voltage regulator,capacitor,diode, led and connector. 










    7805 voltage regulator





    • 7805:-It is the voltage regulator ic as pin diagram is shown.

    • diode IN4007 and the silver line part is its negative.

    • resistor R1=330ohm or we can also use 470ohm because it is use with the led.

    • A 2 pin male connector is required for giving the power to the circuit the +ve will connect with 1 pin of 7805.

    • A 1000uf capacitor is also use with power supply to reducing the ripple or maintaining the continuity.

    • Led:-the cutted portion of the led is negative.


2.  DB9 CONNECTOR: DB9 connector is use to connect the computer with your  programmer board it uses the RS232 cable to connect the DB9 port has 9 pins each pin has its own function but we will use only pin no 2 , 3 and  5.







  • pin no 2 is known as recieved data bit when controller transmit the data bit then computer recive from this pin. This is connected to the 14th pin of max232.

  • pin no 3 is named as transmit data the data will transmit form the computer with the help of this pin and this is connected 13th pin of max232.

  • pin no 5 we make this pin normally ground.


3.  LINE DRIVER CIRCUIT: The MAX232 is an Integrated Circuit that convert signal from an RS232 serial port to signal suitable for use in ttl compaitable digital logic circuits.The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.For more details of MAX232 you can download the datasheet of it form here. download  






  • here the values of all the capacitors are 0.1 uf.

  • 16 pin is vcc should be maintained at 5volt dc.

  • the 15th pin becomes ground.

  • T1out-pin is use to send the data serially to the computer.

  • R1in-pin is use to recieve the data from the computer serially.

  • T1in-pin is use to tramsmitt the data from microcontroller to MAX232 which is actually going to computer.

  • R1out-pin is use for send the incoming data from MAX232 to microcontroller which is actually come from computer.

  • Download the MAX232 datasheet here.download 

4.  8051: The basic 8051 circuit consist of reset circuitry and oscillator circuit but before this we will look the pin diagram of the 8051 that how or what pin's we are using to make our circuit.




8051 microcontroller



As we can see in the fig next that the 8051 microcontroller has 40 pin it has 32 pin I/O lines or we can 32 input and output lines .It consist of four 8bit port's thats why we call it 8bit microcontroller. For our circuit we only need 8 pins these are as follow.



  • We need a 40 pin IC base

  • RST this is the pin  no 9 called as reset pin this pin reset the program counter 0f 8051 microcontroller and it is active high.

  • XTAL1 and XTAL2 are for providing the oscillations to the controller.

  • 10 and 11th pin are use for serial communication.

  • 40th and 31st is to provide vcc basically set at 5volt.

  • 20th pin is become ground.

*The two basic circuit for 8051 microcontroller are listed below.




reset circuit




XTAL connection to8051

4.  FINAL PROGRAMMER CIRCUIT: When we connect the all small circuit with each other than the programmer circuit is in front of you and it is like below.






ball follower robot( IR Sensor)






A Ball follower robot is a very good application of embedded system and robotic. A new  embedded student can make this intelligent robot. Starters was not trying to make the ball follower robot because they think that they need to use a camera for following the ball.this robot use some IR pair to sense the ball instead of camera so you do not need to learn digital image processing.


Now break the task in three different module as per the definition of an embedded system.




ball following concept





  1. Sensor module:       IR sensor, lm324 etc

  2. Decision module:    p89v51rd2(8051 mc)

  3. Actuator module:    L293d(motor driver) , motors etc   




IR sensor principle


SENSOR: Well I chose three IR sensor for sensing a ball and bases on that i can make the decision where to move or in oter words we can follow a ball. IR sensor works on the reflection concept when an Infra-red beam is transmit towards an object it should get reflected by that object and that's how we can recognize the ball. 




IR circuit




IR Sensor


Now the circuit  as we can see in the IR circuit that this circuit gives the high voltage output when the less Infra-red rays get reflected back and a low voltage when high reflection of rays occur. For transmitting we have an IR led which work in forward bias condition and at the reception point we use an IR receiver to accept the IR rays and changes the analog voltages according to that.




comparator


From the IR sensor we get the analog data so we have to change that in the digital format like when an object seen than it should return 0v or 4v or in other word's we can say that in high or low voltages because we kno that in digital high voltage = 1 and low voltage= 0. 




comparator data


For the purpose to change the analog voltage into digital we use comparator which compare the analog  voltage to a reference voltage and give a high or low voltage a desired for controller. 




lm324 comparator ic





 The figure shown here is a comparator IC the pin 1,7,8 and 14 are use to give out put to the micro controller. we should connect a reference voltage to the -ve terminal of this IC lm324 and the out put of the IR sensor to its +ve terminal's.


The circuit show below is for your sensor module this is nothing just the summer of what we discuss in sensor subtopic.




IR sensor with comparator circuit


 PROCESSING: The processing is the most important part of the robot. Till now we get the data from the sensor now based on that data we have to make some decision so here the role of micro controller is come up. we use an 8051  micro controller for our circuit to give them a decision capability. Our micro controller is made by nxp the product name is P89V51RD2. The basic circuit to initialize the micro controller is shown below. we just need an reset circuit and oscillator and bias the controller.




8051 micro controller circuit


 we use the port 1 as an input port and port 2 as an output port.


so the sensor will connect with pin 1,2,3 and motor should be connect with pin 21,22,23,24. 


Now let check how actually we making our decision or our robot how to sense where is the ball and where we have to move.




decision making


 we can see in above figure that sensor 1,sensor2, sensor 3 are three sensor's which gives us a digital data(001,110,010 etc). On the basis of this data we make our decision let us look an example of first figure the robot have to move towards right direction because ball is in right direction. We sense it by our sensor as sensor 1 and sensor 2 will not get reflection of ray so they probably gives 0 to micro controller.





ACTUATOR'S: The Actuator's are those devices which actually gives the movement or to do a task like motor's but their are various types of motor's in the market which works on different voltages. So we need motor driver for running them through the controller. To get interface between motor and micro controller. We use the l293d motor driver IC in our circuit.




motor driver circuit



As in above circuit a 2 pin male connector in connected to the pin 8 this will provide the operating voltage for the motor like if we want to run our voltage on 12volt. so we just have to connect a 12volt power source to this 2 pin male connector.





COMPLETE CIRCUIT OF THE BALL FOLLOWER ROBOT: When we connect all of our module in a sequential way then we can get our complete circuit of the ball follower robot first sensor module and then decision module and in last motor driver.




complete circuit of ball follower robot using IR sensor





 VIDEO OF THE BALL FOLLOWER ROBOT USING IR SENSOR: After making this robot i make a video to give the evidence of the robot.





IMAGES OF THE ROBOT:

















 


 ***************************than you ********************************

GESTURE CONTROLLED ROBOT(Accelerometer based)




A Gesture Controlled robot is a kind of robot which can be controlled by  your hand gestures not by old buttons.You just need to wear a small transmitting device in your hand which included an acceleration meter.This will transmit an appropriate command to the robot so that it can do whatever we want. The transmitting device included a comparator IC for analog to digital conversion and an encoder IC(HT12E) which is use to encode the four bit data and then it will transmit by an RF Transmitter module.






At the receiving end an RF Receiver module receive's the encoded data and decode it by an decoder IC(HT12D). This data is then  processed by a microcontroller (P89V51RD2) and finally our motor driver to control the motor's. 







Robot 




Gesture device

As we can see in the images one is robot and the another is to trnsmit the gesture data to robot.




Now its time to break the task in different module's to make the task easy and simple any project become easy  or error free if it is done in different modules. As our project is already devided into two different part transmitter and receiver. We will discuss both of them one by one. Apart from Power Supply as it was discussed in last blog you can see that by just click here









1> Transmitter device or Gesture device: This part contain four module in it--




                                                                                           1- Accelerometer


                                                                                           2- Comparator                                                                                 




                                                                                           3- Encoder(HT12E)




                                                                                           4- RF Transmitter 





      Accelerometer:-  An Accelerometer is a kind of sensor which gives an analog data while moving in X,Y,Z direction or may be X,Y direction only depend's on the type of the sensor.Here is a small image of an Accelerometer shown. We can see in the image that their are some arrow showing if we tilt these sensor's in that direction then the data at that corresponding pin will change in the analog form.



The Accelerometer having 6 pin-




1- VDD- We will give the +5volt to this pin











2- GND- We simply connect this pin to the ground for biasing.





3- X- On this pin we will receive the analog data for x direction movement.




4- Y- On this pin we will receive the analog data for y direction movement.




5- Z-  On this pin we will receive the analog data for z direction movement.




6- ST- this pin is use to set the sensitivity of the accelerometer 1.5g/2g/3g/4g.



     


      Comparator:- For the purpose to change the analog voltage into digital we use comparator which compare that analog voltage to a reference voltage and give a particular high or low voltage.




LM324 IC


The figure shown here is comparator IC. The pin 1,7,8 and 14 are use to give out put to the microcontroller.We should connect a reference voltage to the -ve terminal for high output when input is high(+ve terminal for high output when input is low) from the LM324 IC.

In this circuit we compare the data from x with two terminal one for positive x direction and negative x direction and same for y direction.






HT12E encoder

Encoder(HT12E IC):- The HT12E is an 4bit encoder which encode the input data applied on it .The pin description of the HT12E is shown in the figure .



  • pin (1 to 8) A0-A7 known as address bits so we do not need to consider them.

  • pin no (9 and 18) are use to bias the IC  as pin-18 as VCC and pin-9 as GND.

  • pin - 17 is connected to the rf transmitter module Din.

  • pin-16 and pin-15 are connected by an Osc resistor known as Roscc(1.1 Mohm)

  • pin-14 is connected to ground to enable the transmitt.

  • pin-13 to pin-10 are known as AD0 to AD3 those having the 4bit data which is required to transmit.



      RF Transmitter Module(TX):- The transmitter module is working  on the frequency of 433MHz and is easily available in the market at the cost of 250rs .



  • The vcc pin is connected to the +terminal in the circuit.

  • The data pin is connected to the HT12E(pin no-17) that is transmitted or we can say that encoded data.

  • The next pin is shown in figure is GND that is connected to the ground terminal.

  • Now the last pin ANT this is connected to a small wire as an antenna.







  • CIRCUIT OF GESTURE DEVICE (TRANSMITTING MODULE)






1> Receiver or Robot:  This part contain four module--         




  1. Receiver

  2. Decoder(HT12D)

  3. Process(microcontroller 8051)

  4. Actuator (Motor driver L293D)


  RF Receiver Module(RX):- The RF receiver module will receive the data which is transfered by the gesture device. It is also working as similar to the transmitter module-





  • Connect the +vcc pin to the 5volt terminal

  • Connect the ground pin to the ground terminal 

  • The data pin is then connected to the HT12D (pin-14)

  • So that we can get the decoded 4 bit data



    Decoder (HT12D):- In a very simple way we can say that an HT12D converts that serial data into parallel which is received by the rf receiver module.The input data is decoded when no error or unmatched codes are found. A valid  transmission in indicated by a high signal at VT pin that is pin no 17.





HT12D


  • pin 18     : It is use to give the +vcc or biasing to the  IC HT12D this pin is connected with the +5 volt

  • Pin 17     : It is the valid transmission pin it will high when the transmission is ok so that we connected this pin to an led for indication.

  • Pin 16-15: we connect these two pin directly by a 51k resistor

  • Pin 14     : This pin is connected with the rf receiver module data pin to receiving the serial data.

  • Pin 10-13: These pins are data pin which is transferred by the gesture module

Process (Microcontroller P89V51RD2): The processing is the most important part of the robot. Till now we get the data from the decoder now based on that data we have to make some decision so here the role of microcontroller is coming up. We use an 8051 microcontroller for our circuit to give them a decision capability. Our microcontroller is made up by nxp the product name is P89V51RD2
The basic circuit to initialize the microcontroller is shown below. We just need an reset circuit and oscillator to run the program.






8051 micro controller circuit


 we use the port 1 as an input port and port 2 as an output port.


so the Data from the decoder  will connect with pin 1,2,3,4 and motor should be connect with pin 21,22,23,24. 






For forward the data to the Port2 is 0a or for backward it is 05 then for lest its 02 and for right it is 08.

ACTUATOR'S(L293D): The Actuator's are those devices which actually gives the movement or to do a task like motor's. In the real world their are various types of motor's available which works on different voltages. So we need motor driver for running them through the controller. To get interface between motor and microcontroller . We use L293D motor driver IC in our circuit.




motor driver circuit


As in above circuit 2 pin male 
As in above circuit a 2 pin male connector in connected to the pin 8 this will provide the operating voltage for the motor like if we want to run our voltage on 12volt. so we just have to connect a 12volt power source 


Now here is the full circuit diagram of the robot (receiver module)







RECEIVER MODULE








ACTUAL CIRCUIT OF RECEIVING  MODULE

PROGRAM: Now here is the program of the Gesture Controlled robot. The program is in Embedded-C. The microcontroller we used is 8051.

/**********************************************************************************
    Gesture Controlled robot C program using 8051 microcontroller

***********************************************************************************
INPUT DATA to PORT 1 LM324     OUTPUT DATA to PORT 2 for L293D

MSB  LSB              MSB    LSB
1111  0001(0xf1)          0000   1010(0x0a)    forward
1111  0010(0xf2)          0000    0010(0x02)    right
1111  0100(0xf4)          0000    1000(0x08)    left
1111  1000(0xf8)          0000   0101(0x05)    backward

**********************************************************************************/
#include<reg51.h>        //INCLUDE reg51.h for 8951   

void main()
{
    P1=0xff;    // set port as input port
    P2=0x00;    // set port as output port
  
    while(1)    // infinite loop
    {
    if(P1==0xf1)
    {
        P2=0x0a;
    }
    else if(P1==0xf2)
    {
        P2=0x02;
    }   
    else if(P1==0xf4)
    {
        P2=0x08;
    }   
    else if(P1==0xf8)
    {
        P2=0x05;
    }
    else
    {
        P2=0x00;
    }
   }


Here is the video presentation of the gesture robot....




Here are some more pics of the robot . Leta take a look.



































***************************** thanx and best of luck*****************************



 
Copyright Electronics Projects And Details All Rights Reserved
ProSense theme created by Dosh Dosh and The Wrong Advices.
Blogerized by Alat Recording Studio Rekaman.