Simple Intelligent Robot Based on AT89C51 Single-Chip Microcomputer

Source: Internet
Author: User
Simple Intelligent Robot Based on AT89C51 Single-Chip Microcomputer
Author: Zhang Hong, Wang dehe time: Source: Electronic EngineerBrowse comments

Introduction

With the continuous development of microelectronics technology, the integration of microprocessor chips is getting higher and higher, the single-chip microcomputer can integrate multiple circuits, including CPU, memory, Timer/counter, parallel and serial interfaces, watchdog, front amplifier, A/D converter, and D/A converter, on one chip at the same time, this makes it easy to combine computer technology with measurement control technology to form an intelligent measurement control system. This technology has led to the rapid development of robotics. At present, people can completely design and manufacture simple intelligent robots with some special functions.

1. design philosophy and overall plan

1.1 design philosophy of simple intelligent robots

The robot can walk along the guide line in any area, automatically bypass the fault, and walk along the light source under the conditions of light source guidance. At the same time, it can detect metal sheets buried in the ground, send sound and light instructions, store and display the number of detected breakpoints in real time, and the distance between each breakpoint and the starting line, and finally stop at a specified location, shows the time of the entire running process.

1.2 Overall design scheme and diagram

In this design, the single-chip microcomputer is used as the core of detection and control. Infrared Photoelectric Sensors are used to detect black lines and obstacles on the road surface. Metal sensors are used to detect metal fragments on the road surface. photoelectric code disk ranging is used to detect and determine the location of the garage with photosensitive resistance. PWM (Pulse Width Modulation) is used) technology dynamically controls the rotation direction and speed of the motor. Through software programming, the robot can travel, bypass, and stop accurately control and detect the storage and display of data. By optimizing the combination of circuits, you can use all the resources of 51 Single-Chip Microcomputer to the maximum extent.

P0 port is used for digital display, P1 port is used for PWM drive control of motor, P2 and P3 port is used for data acquisition and interrupt control of sensor. The advantage of this solution is that it makes full use of the internal resources of the single chip microcomputer and reduces the overall design cost. The overall solution is shown in Figure 1.

2 system hardware composition and design principles

The hardware part of the system is composed of single-chip microcomputer unit, sensor unit, power unit, sound and light alarm unit, keyboard input unit, motor control unit and display unit, as shown in figure 2.

2.1 single-chip microcomputer Unit

The system uses AT89C51 single-chip microcomputer as the central processor. The main task is to scan the keyboard input signal to start the robot. When the robot is walking, it constantly reads the data collected by the sensor and processes the obtained data, according to different situations, different duty cycles are generated to control the motor, and relevant data is sent to the display unit for dynamic display to generate audible and visual alarm signals. P0 is used for the dynamic display of digital tubes. p1.0-p1.5 controls two motors. p1.6 and p1.7 are independent keyboard interfaces, P2 is connected to sensors, and p3.2 is connected to the optical code disk with mileage, the p3.7 is connected to the sound and light alarm units, and the p3.4, p3.5, and p3.6 are connected to the LEDs used to display the number of broken points.

2.2 Motor Control Unit

The robot uses a dual-motor dual-wheel drive car as its base. The two motors independently control the wheels on both sides of the motor. The rotation speed of the two motors is different to realize the turning function. They can also turn in situ for easy control. The traditional car is driven by a power motor and a steering motor, and the turning angle is difficult to control and is not easy to use.

The motor control circuit uses a high-power H-drive circuit consisting of bdl39 and bdl40. The MCU generates PWM pulse with different duty cycles to precisely adjust the motor speed. Because the circuit works in the saturated or cut-off state of the transistor, it avoids the transistor pipe consumption during linear amplification and can maximize the efficiency; the H-type circuit ensures that the speed and direction of the motor can be controlled simply. The speed and stability of the electronic switch can fully meet the needs, the complete driving circuit is a widely used motor driving technology. The circuit is shown in figure 3.

2.3 sensor unit

The entire robot uses a total of nine sensors distributed across different parts of the robot. The interaction plays a different role, as shown in figure 4.

The sensors in Figure 4 are described as follows:

Sensor 1 is a metal detection sensor placed directly in front of the robot for detecting metals.

Sensor 2 is an ultrasonic sensor placed in front of the robot to detect obstacles. The ultrasonic wave is derived from 555 to generate a 40 kHz square wave signal, which is sent by the ultrasonic emission header. The transmitting head continuously sends signals. When an obstacle occurs, the signal is reflected back, so that the receiving head receives the signal and sends the signal to the microcontroller for corresponding judgment and processing.

Sensor 3 is an infrared photoelectric sensor placed directly in front of the robot for detecting the stop line. The infrared transmitting tube sends signals, which are reflected by different reflection media. It determines whether the infrared receiving tube receives the signals.

The sensor 4 and 5 are placed at the bottom of the Robot Base. They are used to detect the guide line on the ground. The principle is the same as that of the sensor 3.

Sensor 6 and 7 are located in front of the robot and are used to find the light source. When there is a light source in front of the robot, the size of the photosensitive resistance will change. After comparing the changes of the two sensors and then sending them to the single chip microcomputer, the single chip microcomputer will generate corresponding adjustment signals, allows the robot to walk in the light direction.

The sensor 8 is an ultrasonic sensor placed on both sides of the rear of the robot. It is used for turning when the robot encounters an obstacle and determining whether the robot completely bypasses the obstacle. The principle is the same as that of the sensor 2.

Sensor 9 is placed at the front of the robot photoelectric code disk, used to calculate the mileage, with the help of the mouse principle, choose a 2.6 diameter plastic small wheel self-made photoelectric code disk, after polishing the circumference of 8 cm, then, place eight equal-distance holes on the wheel, as shown in Figure 5. The minimum ranging accuracy can reach 1 cm, which is sufficient to meet the requirements. The Photoelectric Sensors are mounted on both sides and mounted at the rear of the vehicle to synchronize with the driving speed of the vehicle. According to the actual situation, the distance between the self-made holes cannot be exactly the same. However, after the specific measurement of the photoelectric code disk, it can ensure that 50 pulses are generated when traveling 50 cm, therefore, it is used as the reference unit for distance calculation. The number of pulses generated by the circuit in the direct track area, and the distance between the center line of the railway plate and the starting line is calculated.

In addition, in order to clearly and intuitively observe the working status of each sensor, the circuit also specifically designed a working indicator for each sensor to display the working status of each sensor in real time.

2.4 keyboard input unit

The keyboard input unit consists of two buttons, one of which is the boot key and the other is the display switch key. After the robot completes the whole process, press this key, the time of the entire walking process is displayed.

2.5 Display Unit

The display unit consists of two 7-segment digital tubes. In order to reduce the power consumption of the entire system, it adopts the software decoding and dynamic display by the single chip microcomputer, real-time display of the distance from each breakpoint to the starting point and the time of the entire running process.

2.6 sound and light alarm Unit

555 is used as the oscillating source, and single-chip microcomputer is used to trigger the oscillating source to drive the electromagnetic sound recorder as the sound indicator and one light emitting diode as the light indicator device, thus forming an audible and visual alarm unit.

2.7 power supply unit

The system uses two sets of power supply to separately power the motor and the control circuit. The system control circuit uses the output power supply (5 V) after the voltage regulation of 7805, and the motor uses 4 AA batteries for power supply.

3 System Software Design

The supporting software program of the system adopts the module structure and is written in C language. It mainly consists of the initialization program, the deviation Adjustment Program, the deviation light source Adjustment Program, the sound and light indication subroutine, the reading sensor status, the display program, the interrupt service program of the timer 0, the interrupt service program of the timer 1, A service program with zero external interruptions, parking processing, and other modules. The main process of the system is shown in Step 6.

4 Conclusion

The robot thought that the Set runway had been tested many times to achieve the expected results, but its intelligence was far from enough. With the continuous research and development of artificial intelligence and neural network technology, the development prospects of intelligent robots will become wider and wider.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.