24
Computer Controlled Robot Project Goals Our goal for the senior design project was originally developed from the thought of creating a micro-robot, a robot that finds its way in a maze. However, since this project was Accomplished by so many students, we set out to do something more with the robot by using computer. This Robot is going to be controlled from a computer with a wide range of functions that we are going to be discussed below. The robot will be controlled from a computer terminal. The user can use the computer to control as many as six functions by using different buttons on the desktop application. The buttons on the computer tell the robot to move forward or reverse, turn right or left, or stop. One temperature sensor enables the robot to produce sound effects thorough a built-in piezoelectric speaker mounted on the robot whenever the temperature crosses the threshold level. In addition, other keys flash the robot’s LED headlights. We are also planning to put a video camera on the robot and sending the video signal on the robot to computer so that the user knows what exactly the Robot is heading. However, this part is only implemented if time permits. We must fully document our progress to assure that we have learned the proper procedures for the original design of the Robot and 1

Computer Operated Robot

Embed Size (px)

DESCRIPTION

Computer Operated Robot

Citation preview

Page 1: Computer Operated Robot

Computer Controlled Robot

Project Goals

Our goal for the senior design project was originally developed from the thought of creating a micro-robot, a robot that finds its way in a maze. However, since this project was Accomplished by so many students, we set out to do something more with the robot by using computer. This Robot is going to be controlled from a computer with a wide range of functions that we are going to be discussed below.

The robot will be controlled from a computer terminal. The user can use the computer to control as many as six functions by using different buttons on the desktop application. The buttons on the computer tell the robot to move forward or reverse, turn right or left, or stop. One temperature sensor enables the robot to produce sound effects thorough a built-in piezoelectric speaker mounted on the robot whenever the temperature crosses the threshold level. In addition, other keys flash the robot’s LED headlights.

We are also planning to put a video camera on the robot and sending the video signal on the robot to computer so that the user knows what exactly the Robot is heading.

However, this part is only implemented if time permits. We must fully document our progress to assure that we have learned the proper procedures for the original design of the Robot and successfully performed them. Lastly, we have our self-assigned requirements. The three of us want to make certain that our project is a sufficient challenge and that the final product will be something in which we can be proud of. This decision, which we recently came to, has changed the scope of our project to the construction of our own transmitter-receiver, and the Robot, as opposed to purchasing a pre packaged transmitter-receiver and interface it with a computer.

Uses In these days people do not have enough time to do the house-works such as mowing the lawn because of having busy working schedule. In such a case, a smart robot becomes very handy. Therefore, we developed an idea to build a robot that does more than just move in a maze. With up to six sequences, this designed robot can be used in a wide range of areas with different helpful purposes. For example, the robot can be programmed to

1

Page 2: Computer Operated Robot

help elderly person or patient such as being a reminder or medicine giver. Having a video signal makes this Robot very useful as a vehicle used for searching and exploring places, that human being is limited to such as detecting mines and exploring the unsafe environment. Controlling the robot from different computer terminals through the internet gives the user flexibility to access it from any computer terminal at any place.

Possible Approaches

In order to design the Computer-Controlled-Robot, we have considered some possibilities in designing approaches. There are three major parts:

1. The micro-controller (for robot)2. The wireless transmitter-receiver (between robot and computer terminal)3. The video signal if time permits (between two computer terminals)

Each major part is guided by two approaches: a first choice and backup plan. In part 1, we can use either the micro-controller AT89S52 or AVR Atmega. We choose to use the At89S52 because this chip satisfies our need and is easy to find on the market. In part 2, we will build the wireless transmitter and receiver. This approach is selected because we want to build devices that meet our specifications and to make interfacing with other devices (micro-controller and computer terminal) easier. The second approach is to purchase the set (transmitter and receiver) in case of facing difficulty. The video signal in the last major part is considered optional. If time permits, we will try to transmit the video signal from the robot indirectly to the third computer terminal. This task can be accomplished by software, using either the PC-Anywhere. We are going to develop a desktop application in VB because it is very useful for embedded system and easy to do programming.

2

Page 3: Computer Operated Robot

Circuit Operation Receiver:

RF2.4Ghz-RX is 2.4 GHz radio receiver, which receives the transmitted codes from the remote place, transmitted by the transmitter these codes are converted to digital format and output is available to serial port of micro-controller, this is the RX pin of inbuilt UART of the micro-controller. We are using UART to receive our codes at 9600-baud rate. Based on the input codes, wireless module will give command to Microcontroller and robot will behave as follows.

a) moves in forward directionb) moves in reverse direction,c) speed controls in both the directiond) It can even turn left or right while moving forward or in reverse

direction.e) Instant reverse or forward running without stoppingf) In case of bump, moves reverse turn left or right and wail for the next

instruction.g) On the spot left or right turn to pass through the narrow spaceh) We have also added head light, back light and Turing lights to left a

right. These lights automatically come on while robot is in Movement.

1) Start/stop2) Increase speed3) Increase speed4) Direction change5) Turn left6) Turn right

Microcontroller Port 3 is connected to motor driver IC, Port 3 of microcontroller gives the pulse width modulation, which is connected to motor m1 and m2 motor. One of microcontroller port is connected to LASER which target the enemy.

3

Page 4: Computer Operated Robot

BLOCK DIAGRAM OF COMROBO

LASER

FOCUS LIGHT

Temp Sensor

4

RF

MODEM

MICROCONTROLLER

MOTOR

DRIVER

M1

M2

DRIVER

COMPUTER

RF MODEM

LASER

LCD

Page 5: Computer Operated Robot

Block Diagram Description:

Micro-controller board: It is a low power, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash Programmable and Erasable Read Only Memory ROM). The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the MCS-51. Instruction set and pin out. The on chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, it provides a highly flexible and cost effective solution so many embedded control applications.

Display Block: In this project, we are using 16x2 lcd displays, for displaying robot status.

MAX Block: Max used for serial communication. Max connected with PC.

Motor Driver IC: The Device is a high voltage, high current four channel driver designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays solenoids, DC and stepping motors) and switching power transistors.

Power Block: For our project we require + 5 Volt, and +12 Volts supply. +5 Volts and. 5Volts is given to Micro-controller board, RF modem, memory, real time clock etc. +12 Volts are used to drive the relay.

5

Page 6: Computer Operated Robot

Component Description

MICROCONTROLLER

Features

• Compatible with MCS-51® Products• 8K Bytes of In-System Programmable (ISP) Flash Memory– Endurance: 1000Write/Erase Cycles• 4.0V to 5.5V Operating Range• Fully Static Operation: 0 Hz to 33 MHz• Three-level Program Memory Lock• 256 x 8-bit Internal RAM• 32 Programmable I/O Lines• Three 16-bit Timer/Counters• Eight Interrupt Sources• Full Duplex UART Serial Channel• Low-power Idle and Power-down Modes• Interrupt Recovery from Power-down Mode• Watchdog Timer• Dual Data Pointer• Power-off Flag

Description

The AT89S52 is a low power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.

By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly - flexible and cost-effective solution to many embedded control applications.

6

Page 7: Computer Operated Robot

The AT89S52 provides the following standard features: 8K bytes of Flash , 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six - vector two -level interrupt architecture, a full duplex serial port, on-chip oscillator ,and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.

The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupter hardware reset.

TEMPERATURE SENSOR

Features

Calibrated directly in ° Celsius (Centigrade) Linear + 10.0 mV/°C scale factor 0.5°C accuracy guarantee able (at +25°C) Rated for full −55° to +150°C range Suitable for remote applications Low cost due to wafer-level trimming Operates from 4 to 30 volts Less than 60 μA current drain Low self-heating, 0.08°C in still air Nonlinearity only ±1⁄4°C typical Low impedance output, 0.1 W for 1 mA load

Description

The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration make

7

Page 8: Computer Operated Robot

interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 μA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a −55° to +150°C temperature range, while the LM35C is rated for a −40° to +110°C range (−10° with improved accuracy). The LM35 series is available packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220 package.

Laser:

A laser diode is an electrically pumped semiconductor laser in which the active medium is formed by a p-n junction of a semiconductor diode similar to that found in a light-emitting diode. The laser diode is distinct from the optically pumped semiconductor laser, in which, while also semiconductor based, the medium is pumped by a light beam rather than electric current.

DRIVER

Features

Seven Darlington per package output current 500ma per driver (600ma peak)

Output Voltage 50v Integrated suppression diodes for inductive loads outputs can be

paralleled for higher current TTL/CMOS/PMOS/DTL compatible inputs Inputs pinned opposite outputs to simplify layout

Description

The ULN2001A, ULN2002A, ULN2003 and ULN2004Aare high voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mAand can withstand peak currents of 600mA.Suppressiondiodesare included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout.

8

Page 9: Computer Operated Robot

L293D MOTOR DRIVER

Description

Using the L293D motor driver, makes controlling a motor as simple as operating a buffer gate IC. It totally isolates the TTL logic inputs from the high current outputs.

Putting logic 1 on the pin In1 will make Out1 pin goes to Vpower (36 Volts MAX.), while a logic 0 will make it go to 0V.

Each couple of channels can be enabled and disabled using E1 and E2 pins. When disabled a channel provide very high impedance (resistance) to the motor, exactly as if the motor was not connected to the driver IC at all, this makes this feature very useful for PWM speed control.

Figure shows different ways to connect a motor to the IC. One way is to use 2 channels to build a bi-directional motor driver, another way is to use 1 channel per motor, building a unidirectional driver. In this project, we will be using the four channels to drive the 2 motors in both directions.

9

Page 10: Computer Operated Robot

MAX 232

Features:

Operates From a Single 5-V Power Supply With 1.0-_F Charge-Pump Capacitors

Operates Up To 120 Kbit/s Two Drivers and Two Receivers ±30-V Input Levels Low Supply Current . . . 8 mA Typical ESD Protection Exceeds JESD 22 2000-V Human-Body Model (A114-A)

Applications:

10

Page 11: Computer Operated Robot

TIA/EIA-232-F, Battery-Powered Systems, Terminals, Modems, and Computers

Description

The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a single 5-V supply. Each receiver converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept ±30-V inputs. Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and voltage-generator functions are available as cells.

The Serial Port

In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time (contrast parallel port). Throughout most of the history of personal computers, data transfer through serial ports connected the computer to devices such as terminals and various peripherals.

While such interfaces as Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232standard, intended to interface with a modem or with a similar communication device.

11

Page 12: Computer Operated Robot

Modern computers without serial ports may require serial-to-USB converters to allow compatibility with RS 232 serial devices. Serial ports are still used in applications such as industrial automation systems, scientific instruments, shop till systems and some industrial and consumer products. Server computers may use a serial port as a control console for diagnostics. Network equipment (such as routers and switches) often use serial console for configuration. Serial ports are still used in these areas as they are simple, cheap and their console functions are highly standardized and widespread. A serial port requires very little supporting software from the host system.

RF MODEM:RF Transreceiver 2.4 GHz:

This is an FSK Transceiver module, which is designed using the Chipcon IC (CC2500). It is a true single-chip transceiver; it is based on 3 wire digital serial

12

Page 13: Computer Operated Robot

interface and an entire Phase-Locked Loop (PLL) for precise local oscillator generation .so the frequency could be setting. It can use in UART / NRZ / Manchester encoding / decoding. It is a high performance and low cost module. It gives 30 meters range with onboard antenna. In a typical system, this trans-receiver will be used together with a microcontroller. It provides extensive hardware support for packet handling, data buffering, burst transmissions, clear channel assessment, link quality indication and wake on radio. It can be used in 2400-2483.5 MHz ISM/SRD band systems. (eg. RKE-two way Remote Keyless Entry, wireless alarm and security systems, AMR-automatic Meter Reading, Consumer Electronics, Industrial monitoring and control, Wireless Game Controllers, Wireless Audio/Keyboard/Mouse). It could easily to design product requiring wireless connectivity.

It can be used on wireless security system or specific remote-control function and others wireless system. Operating Range is 30 meters without requiring any external antenna.

Features

Low power consumption Integrated bit synchronizer integrated IF and data filters High sensitivity (type -104dBm) Programmable output power -20dBm~1dBm Operation temperature range : -40~+85 deg C Operation voltage: 1.8~3.6 Volts Available frequency at : 2.4~2.483 GHz Digital RSSI

Applications

Car & Home security system Remote keyless entry / Garage door controller Wireless game controllers/mouse/keyboard/audio Automation system

ST3654 – Serial Interface IC for RF Transreceiver based on CC1100/CC2500

ST3654 Serial Interface IC supports any RF based modules/transreceiver which is based on Texas Instrument’s Chipcon ICs like CC1100/CC1101(433 MHz) and

13

Page 14: Computer Operated Robot

CC2500(2.4 GHz). It provides a simple UART interface for transmission and reception of serial data at various baud rates. It can be used for applications that need two-way wireless data transmission. The communication protocol is self controlled and completely transparent to user interface. The IC can beEmbedded to your current design so that wireless communication can be setUp easily.

Features

Automatic switching between TX and RX mode with LED indication Adjustable baud rate setting of 9600, 4800, 38400 and 19200 Frequency Channel can be set to operating multiple pairs in same area FSK technology, half-duplex mode, robust interference Protocol translation is self-controlled, easy to use High sensitivity, optimized transmission range Standard UART interface, TTL (3-5V) logic level with any microcontroller Very reliable, small size, easier mounting No tuning required, PLL based self-tuned Error checking (CRC) to prevent corrupted data output at receiver

Application

Robotics, Sensor Networks, Wireless metering & Weather stations Remote control/measurement system, Access control & Identity

discrimination Data collection, IT home appliance, Smart house products, Security

Systems

RF Module and ST3654 are working at 3V level so a 3V regulator is required as shown. Operating RF module at 5V will permanently damage it. The UART interface can be interfaced with either 3V or 5V logic level circuits since it has a 1K resistor (R8) in series to RXD, which will drop down the 5V level of serial data.

14

Page 15: Computer Operated Robot

Baud Rate Setting

BAUD1 and BAUD2 pins will be default HIGH if left unconnected. The pin status is read only during power up. Any changes to these pin during operation will have no effect. If you need default baud rate of 9600 bps then you can leave

15

Page 16: Computer Operated Robot

pins unconnected. The pin status is read only during power up. Any changes to these pin during operating will have no effect.

BAUD1 BAUD2 ModeHIGH HIGH 9600 bpsLOW HIGH 4800 bpsHIGH LOW 38400 bpsLOW LOW 19200 bps

Frequency Channel Setting

FREQ1 and FREQ2 pins will be default HIGH if left unconnected. The pin status is read only during power up. Any changes to these pin during operating will have no effect.

Setting Frequency Channel can be used to have multiple sets operating at same time but without interfering each other. The pair having same Channel setting will be able to communicate with each other. Frequency channel has to be set when unit is OFF, as the switches are read only during power up. Modifying during power up will have no effect on operation of module. If you need default channel#1 then you can leave the pins unconnected.

FREQ1 FREQ2 ModeHIGH HIGH Channel #1LOW HIGH Channel #2HIGH LOW Channel #3LOW LOW Channel #4

16

Page 17: Computer Operated Robot

WORKING OF MODEM

This IC works in half-duplex mode. Means it can either transmit or receive but not both at same time. After each transmission, IC will be switched to receiver mode automatically. The LED for TX and RX indicates whether IC is currently receiving or transmitting data. The data sent is checked for CRC error if any. If chip is transmitting and any data is input to transmit, it will be kept in buffer for next transmission cycle. It has internal 64 bytes of buffer for incoming data. When you power on the unit, the TX LED will briefly blink indicating that initialization is complete and it has detected Chipcon based tranreceiver RF module. If LED remains continuous on then the problem could be related to connection between IC and RF Module or RF module is faulty. The problem can also be a faulty crystal of the ST3654 the RX LED is put directly on TX OUT pin to indicate that data is received and being output. All chipcon ICs, CC1100/CC1101 and CC2500 operating on 3V so the ST3654 also has to be operating on 3V due to communication required at this level.

CIRCUIT DESCRIPTION:

Circuit diagram of Computer operated robot is given in Figure. As shown in the circuit diagram AT 89s52 microcontroller is used to control all the process evolved in the project like receiving the control codes via a serial port and sending command to motor driver etc. Output of RF Data Modem is connected to the PORT 3_0 Pin of microcontroller this is the RXD pin of it. In all the ports of microcontroller Pull-up resistor of 10 k is used. Main reason behind this is to protect the port line from an accidental excess current flow. FWR, REV.LEFT, RIGHT control signal of motor driver are connected with P2_0, P2_1, P2_2 and P2_3 respectively.

At Computer end, RF output pin is directly connected to the RXD pin of Data modem similarly the tout of max 232 is connected to the same pin but there is one toggle switch provided to shift the operation.

17

Page 18: Computer Operated Robot

Temperature sensor LM35 is connected to the non-inverting pin of OP-amp. At Inverting, terminal one pot is provided to set the threshold value of temperature. If the temperature exceeds the threshold value then output of OP-Amp gives high output. At the output of OP-amp, we have connected one LED for its indication.

Power supply is made up of simple Diode 4007, which is used as a rectifier. To filter out the ac components 470 uf Capacitor is used. As we know that all the digital IC works on 5-volt dc supply so, we have used LM 7805 regulator IC to get regulated DC output.

Component List:1) RF Data Modem------------------Rs 5000/-2) Microcontroller At 89S52------Rs 70/-3) ULN 2803----------------------------Rs 50/-4) Stepper Motor----------------------Rs 350/-5) Serial Cable----------------------------Rs 95/-6) Toy Car-----------------------------------Rs 750/-7) Battery------------------------------------Rs 180/-8) LM 35---------------------------------------Rs 70/-9) LM358--------------------------------------Rs 25/-10) SIP 10 K---------------------------------5/-11) Capacitor-------------------------------7/-12) 7805--------------------------------------8/-13) 11.0592 Mhz Crystal------------------10/-14) Diodes--------------------------------------1/-

18