PC Matlab Robo

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

Introduction: As our final year project we are going to present an innovative project having lots of feature.

Our project is MATLAB based RF controlled robot, controlled by remote unit connected to PC. Program of the project whose program is written In Matlab language for controlling robot motor from the PCs parallel port termed as printer port (LPT). The Program accepts the input in decimal numbers and outputs at the data output pins of the PCs parallel port for controlling 4 movement of robot. Our project controls left, right, Forward and backward moment of robot wirelessly within 500m range using 433 MHz RF frequency. The special feature of our project is Matlab, which we have selected to learn a lot. So for controlling any moment of robot we have to just press button on computer GUI. Windows. At the receiver side of robot 8051 microcontroller is also used. The microcontroller takes command wirelessly transmitted by PC. The role of microcontroller is to drive 7 segments, drive DC motor.

Transmitter section:

Optocoupler 1

Optocoupler 2 HT 12E Encoder Optocoupler 3 433MHz RF Transmitter

Parallel Port Connector

Optocoupler 4

Receiver Section:

433MHz RF Receiver

RF Decoder

8051 Microcontroller

7 Segments Decoder

Left H Bridge

Right H Bridge

7 segments Display

Left Motor

Right Motor

Transmitter

circuit:

Receiver circuit:

Working:
The parallel port is made up of three ports, namely, data port, status port and control port. It is found on the back of the PC as a D-type, 25-pin female connector. Here, we are concerned only with data lines Do through D7 terminated at pins 2 through 9. The data port is a writ-only port, which means it can be used only to output data. Pins 18 through 25 of the connector are grounded. Control port is read/write capable, which means it can be used both for outputting and inputting some data to/from the external hardware. Status port is a read only port, which means it can be used only to read data from the external hardware.

Table above shows pin details of the standard parallel port (SPP) and their traditional usage. The base address of the first parallel port (LPT1) is 378 (hex) or 888 (decimal). The data port of the parallel port can be accessed at its base address. The status port can be accessed at base address+ 1, i.e., 0379 hex (or 889 decimal). The control port can be accessed at base address+ 2, i.e., 037A hex (or 890 decimal). In case you are using LPT2 port, then substitute the base address of LPT2 as 0278 (hex) in place of 0378 (hex).

The circuit for interfacing the PCs parallel port to the devices to be controlled. The parallel port outputs the control signals generated by the software. The control signals are not continuous but a single clock pulse. For every on or off control, only a single clock pulse is sent from the parallel port to the circuit. The pins D0 through D7 of the parallel port are connected to pin 1 of Optocoupler IC5 through IC12 via resistors R1 through R8, respectively. Optocoupler ensure complete isolation of the parallel ports data pins from the relay driver circuit. Receiver section: Each Optocoupler consists of an infrared light-emitting diode (LED) and an npn phototransistor. When a high going pulse is available on the data pin, the internal LED drives the phototransistor of Optocoupler MCT2E and it provides an enable pulse to HT12E encoder. All address pins of HT12E is grounded. Thus the data encoded by HT12E will be 0111. This encoded data is available at pin 17 of HT12E. The RF transmitter frequency modulate data signal and transmits using antenna. For RF transmission purposed it is needed to encode the signal generated at computer parallel port with the help visual basic code. For signal encoding purpose we have used HT 12E encoder. HT^12 E is 2^12 encoders are a series of CMOS LSIs for remote control system applications. They are capable of encoding information which consists of N address bits and 12_N data bits. Each address/ data input can be set to one of the two logic states. The programmed addresses/data are transmitted together with the header bits via an RF transmission medium upon receipt of a trigger signal. The capability to select a TE trigger on the HT12E enhances the application Flexibility of the 2^12 series of encoders.

Feature: Operating voltage 2.4V~12V for the HT12E Low power and high noise immunity CMOS technology Low standby current: 0.1_A (typ.) at VDD=5V HT12A with a 38kHz carrier for infrared transmission medium Built-in oscillator needs only 5% resistor Data code has positive polarity Minimal external components

Receiver Part: HT 12D Receive and decode 12 bit encoded data transmitted by HT12E, for further processing. The HT12D is 12 bit decoders are a series of CMOS LSIs for remote control system applications. They are paired with Holtek_s 2^12 series of encoders. For proper operation, a pair of encoder/decoder with the same number of addresses and data format should be chosen. The decoders receive serial addresses and data from a programmed 2^12 series of encoders that are transmitted by a carrier using an RF transmission medium. They compare the serial input data three times continuously with their local addresses. If no error or unmatched codes are found, the input data codes are decoded and then transferred to the output pins. The VT pin also goes high to indicate a valid transmission. The 2^12 series of decoders are capable of decoding informations that consist of N bits of address and 12_N bits of data. Of this series, the HT12D is arranged to provide 8 address bits and 4 data bits.

Features Operating voltage: 2.4V~12V Low power and high noise immunity CMOS technology Low standby current Capable of decoding 12 bits of information Binary address setting Received codes are checked 3 times Address/Data number combination HT12D: 8 address bits and 4 data bits Built-in oscillator needs only 5% resistor Valid transmission indicator Easy interface with an RF or an infrared transmission medium Minimal external components

Light sensor: The LDR light sensor is used to sense intensity of light. In the light sensor we use IC 555 as a main component. Pin no 4 and pin no 8 is connected to the positive supply. Pin no 1 is connected to the negative voltage. One capacitor is grounded from the pin no 5 for noise cancellation. Output is available on the pin no 3. Sensor is connected to the pin no 2. In the case of infra red sensor Pin no 2 is negative bias through the 33k ohm resistor and pin no is positively biased through the LDR. In normal day condition when light is focusing on the LDR then pin no 2 is positively biased photodiode. If pin no 2 is positive then negative output is available on the pin no 3. Now in night there is no light on the photodiode and pin no 2 is now gets its voltage from only 33 k ohm resistor. If pin no 2 is become negative then output is shifted to the pin no 3. When positive output is available on the pin no 3 and with the help of this voltage NPN transistor is on and npn transistor provide a negative voltage as a pulse to the microcontroller.

Fire sensor: A temperature sensor (LM35DZ) can measure from 0C to 100C. However, the output is 0V at 2C. Therefore, the voltage of minus is required in order to measure 0C. Since the minus power supply is not used with this equipment, the measurable temperature is above 2C. The output of a sensor goes up by 10mV for every 0C. The output voltage in 32C is300mV. The output voltage of a sensor is amplified by an operational amplifier, and is inputted into the base of transistor .The temperature sensitivity adjusting the gain of an operational amplifier by VR. So in the normal mode when temperature is below 60C the output or LM358 is not sufficient to drive transistor BC 548. When temperature raises above 60C the output of LM358 is about 3V which is sufficient to drive transistor thus microcontroller get positive voltage at Pin No 6. 7 segment display: The DM74LS47 accepts four lines of BCD (8421) input data, generates their complements internally and decodes the data with seven AND/OR gates having open-collector outputs to drive indicator segments directly. Each segment output is guaranteed to sink 24mA in the ON (LOW) state and withstand 15V in the OFF (HIGH) state with a maximum leakage current of 250 mA. Auxiliary inputs provided blanking, lamp test and cascadable zero-suppression functions. DC motor driver: The H-Bridge is used for motor driver. The H-Bridge is widely used in Robotics for driving DC motor in both clockwise and anticlockwise. As shown in the circuit diagram in H Bridge two NPN and two PNP transistors is used. Let us consider microcontroller provide high at pin No 13 and low at Pin No 14 thus right side NPN transistor conducts and left side PNP transistor conducts.this means M12 is 12v and M11 is grounded thus motor rotate clockwise Again let us consider microcontroller provide low at pin No 13 and high at Pin No 14 thus right side PNP transistor conducts and left side NPN transistor conducts. this means M12 is grounded and M11 is 12v thus motor rotate anticlockwise..

Microcontroller Logic: The function of microcontroller is to control input output based on the programmed embedded hex logic. The microcontroller continuously scans input logic. The input logic is 4BCD data from HT12D one from fire sensor and one from light sensor. If any one of them changes their logic level microcontroller goes to particular subroutine and perform particular task. Let us consider a case at the transmitter PC I have pressed number 2 (vice command), thus at receiver side HT12D generate corresponding BCD logic 0010. The microcontroller receive 0010 at pin no 1,2,3,4. The microcontroller is programmed if input is 0010, move to robot left. The robot will moves left if left DC motor rotate slow and right DC motor rotate fast. This slow and fast moment is dine by microcontroller using pulse width modulation. Thus when we press 2 key microcontroller provide different pulse to left right motor. The right motor gets pulse having mote on time then left. In the same way all microcontroller subroutine gets executed and perform corresponding task. If microcontroller sense 0001 input then it goes to right subroutine and moves robot right. If microcontroller sense 0010 inputs then it goes to left subroutine and moves robot left. If microcontroller sense 0011 input then it goes to stop subroutine and goes to standby mode. If microcontroller sense 0100 input then it goes to forward subroutine and moves robot forward. If microcontroller sense 0101 input then it goes to backward subroutine and moves robot backward. If microcontroller sense low input at pin No 5 then it goes to day night subroutine and supply high pulse to on light. If microcontroller sense low input at pin No 6 then it goes to fire subroutine and supply high pulse to on water pump for controlling fire.

You might also like