Simple intelligent robot designed based on AT89C51 microcontroller

Publisher:老实巴交的大叔Latest update time:2006-11-22 Source: 电子工程师Keywords:PWM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

With the continuous development of microelectronics technology, microprocessor chips are becoming more and more integrated. Microcontrollers can integrate CPU, memory, timers/counters, parallel and serial interfaces, watchdogs, and pre-processors on one chip. A variety of circuits such as amplifiers, A/D converters, D/A converters, etc. make it easy to combine computer technology with measurement control technology to form an intelligent measurement control system. This technology has led to rapid development of robot technology. At present, people can design and manufacture simple intelligent robots with certain special functions.

1 Design ideas and overall plan

1.1 Design ideas of simple intelligent robot

This robot can walk along the guide line in any area, automatically avoid obstacles, and can walk along the light source when guided by the light source. At the same time, it can detect metal pieces buried underground, send out audible and visual indication information, and can store and display the number of detected breakpoints and the distance between each breakpoint and the starting line in real time. Finally, it can stop at a designated location and display the entire run. process time.

1.2 Overall design plan and block diagram

This design uses AT89C5l microcontroller as the detection and control core. An infrared photoelectric sensor is used to detect black lines and obstacles on the road, a metal sensor is used to detect metal iron pieces under the road, a photoelectric encoder is used to measure distance, a photoresistor is used to detect and determine the location of the garage, and PWM (Pulse Width Modulation) technology is used to dynamically control the motor. Direction of rotation and speed. Through software programming, precise control of robot travel, obstacle avoidance, and stopping, as well as storage and display of detection data are achieved. Through the optimized combination of circuits, all resources of the 51 microcontroller can be utilized to the maximum extent.

Port P0 is used for digital tube display, port P1 is used for PWM drive control of the motor, and ports P2 and P3 are used for data collection and interrupt control of the sensor. The advantage of this is that it fully utilizes the internal resources of the microcontroller and reduces the overall design cost. The overall scheme of the program is shown in Figure 1.

2 System hardware composition and design principle

The hardware part of this system consists of a single-chip microcomputer unit, a sensor unit, a power supply unit, an audible and visual alarm unit, a keyboard input unit, a motor control unit and a display unit, as shown in Figure 2.

2.1 Microcontroller unit

This system uses AT89C51 microcontroller as the central processor. Its main task is to scan the signal input from the keyboard to start the robot, and continuously read the data collected by the sensor while the robot is walking. After processing the obtained data, it generates PWM pulses with different duty cycles according to different situations to control the motor. At the same time, the relevant data is sent to the display unit for dynamic display, and an audible and visual alarm signal is generated. Among them, P0 is used for dynamic display of the digital tube, P1.0 to P1.5 control 2 motors, P1.6 and P1.7 are independent keyboard interfaces, P2 is connected to the sensor, and P3.2 is connected to the photoelectric code plate for mileage measurement. P3.7 is connected to the sound and light alarm unit, and P3.4, P3.5, and P3.6 are connected to the light-emitting diodes used to display the number of breakpoints.

2.2 Motor control unit

This robot uses a dual-motor, two-wheel-driven car as its base. The two motors independently control the wheels on the left and right sides. The turning function is realized by the difference in the speed of the motors on both sides. It can also turn in place 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 inconvenient to use.

The motor control circuit adopts an H-type drive circuit composed of high-power pairs of tubes BDl39 and BDl40. The microcontroller generates PWM pulses with different duty cycles to accurately adjust the motor speed. Since this circuit works in the saturated or cut-off state of the transistor, it avoids the tube consumption of the transistor when working in the linear amplification area and can maximize efficiency; the H-type circuit ensures that the motor speed and direction can be simply controlled; electronic switch The speed and stability can fully meet the needs. The entire drive circuit is a widely used motor drive technology. See Figure 3 for the circuit.

2.3 Sensor unit

The entire robot uses a total of 9 sensors, which are distributed in different parts of the entire robot and play different roles in cooperation with each other, as shown in Figure 4.

The description of each sensor in Figure 4 is as follows:

Sensor 1 is a metal detection sensor placed directly in front of the robot and facing downward, for detecting metal.

Sensor 2 is a forward-facing ultrasonic sensor placed directly in front of the robot for detecting obstacles. The ultrasonic wave comes from the 40 kHz square wave signal generated by the 555, which is sent out through the ultrasonic transmitter. The transmitting head continuously sends out signals. When encountering an obstacle, the signal will be reflected back, so that the receiving head will receive the signal and send the signal to the microcontroller for corresponding judgment and processing.

Sensor 3 is an infrared photoelectric sensor placed directly in front of the robot and facing downward to detect the stop line. The infrared transmitting tube emits a signal, which is reflected by different reflective media, and a corresponding judgment is made based on whether the infrared receiving tube receives the signal.

Sensors 4 and 5 are infrared photoelectric sensors placed under the robot base and are used to detect guide lines on the ground. The principle is the same as sensor 3.

Sensors 6 and 7 are placed directly 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 photoresistor will change. The changes of the two sensors will be compared and processed and sent to the microcontroller. The microcontroller will generate a corresponding adjustment signal to make the robot walk in the direction of the light intensity.

Sensor 8 is an ultrasonic sensor placed on both sides of the rear of the robot facing outward. It is used for turning when the robot encounters an obstacle and determines whether the robot has completely bypassed the obstacle. The principle is the same as sensor 2.

The sensor 9 is placed on the photoelectric code disk directly behind the robot for mileage calculation. With the help of the mouse principle, a plastic wheel with a diameter of 2.6 cm is used to make a homemade photoelectric code disk. After polishing, the circumference is 8 cm, and then Punch 8 holes at equal distances on the small wheel, as shown in Figure 5. The minimum distance measurement accuracy can reach 1 cm, which is enough to meet the requirements. Photoelectric sensors are installed on both sides and installed at the rear of the car to synchronize them with the driving of the car. According to the actual situation, the distance between the self-made holes cannot be exactly equal, but after specific measurement of the photoelectric code disk, it can ensure that 50 pulses are generated when traveling 50 cm, so it is used as the reference unit for calculating distance. In the straight area, the distance between the center line of the iron piece and the starting line can be calculated from the number of pulses generated by the circuit.

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

2.4 Keyboard input unit

The keyboard input unit adopts an independent keyboard and consists of 2 keys, one of which is the start key and the other is the display switching key. When the robot completes its walking process, press this key to display the entire walking process. time.

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 uses microcontroller software decoding, dynamic display, and real-time display of the distance from each breakpoint to the starting point and the entire running process. time.

2.6 The sound and light alarm unit

uses 555 as the oscillation source, and uses the microcontroller to trigger the oscillation source to drive the electromagnetic sounder as the sound indicator and a light-emitting diode as the light indicating device to form the sound and light alarm unit.

2.7 Power supply unit

This system uses 2 sets of power supplies to supply power to the motor and control circuit separately. The system control circuit uses the output power supply (5V) stabilized by 7805, and the motor uses 4 AA batteries to power the system.

3 System software design

The supporting software program of this system adopts a module structure and is written in C language. It mainly consists of initialization program, deviation adjustment program, deviation light source adjustment program, sound and light indication subroutine, reading sensor status, display program, timer 0 interrupt service program, timer 1 interrupt service program, external interrupt 0 service program , parking processing and other modules. The main flow of the system is shown in Figure 6.

4 Conclusion

The robot has gone through many experiments on the runway that was set and achieved the expected results, but its level of intelligence is far from enough. With the continuous research and deepening of artificial intelligence and neural network technology, the development prospects of intelligent robots will become increasingly broad.

Keywords:PWM Reference address:Simple intelligent robot designed based on AT89C51 microcontroller

Previous article:EM78P447S microcontroller and its application in DC motor infrared remote control system
Next article:Application of C8051F microcontroller in remote measurement and control devices

Recommended ReadingLatest update time:2024-11-16 16:36

STM32 PWM fast switching port level problem
introduction Usually the switches used for buttons are mechanical elastic switches. When the mechanical contacts are opened and closed, due to the elastic effect of the mechanical contacts, a button switch will not be stably connected immediately when closed, nor will it be completely disconnected at once when opene
[Microcontroller]
STM32 PWM fast switching port level problem
STM32F103 outputs multiple dead zone complementary PWM waves
Read count: 39 TIM1 and TIM8 can generate dead zone complementary PWM waves. After learning, I found that the timer function of stm32 is really powerful. A small summary is convenient for reference in the future. Stm32 timers are divided into three types: tim1 and tim8 are advanced timers, 6 and 7 are basic timers,
[Microcontroller]
What Is a Portable Hard Drive?
A portable hard drive is a type of digital storage device. It is generally convenient to transport and has a large storage capacity. Such a device is compatible with most computers and will generally operate with Windows® and Mac®. Portable hard drives are used for digital storage. They can be used for prim
[Analog Electronics]
When STM32 outputs PWM, the difference between PWM1 and PWM2
First of all, although I am a beginner in STM32, I strongly oppose a misleading view: "For MCUs of the level of STM32, there is no need to look at how registers are operated if there are library functions!" Okay, let's get back to the topic. Recently, I have seen many friends have a lot of doubts about the PWM experi
[Microcontroller]
TuSimple releases domain controller based on NVIDIA DRIVE Orin SoC chip for L2+ to L4 level autonomous driving computing
TuSimple Domain Controller, an autonomous driving technology company, announced today that it has launched a domain controller product (TDC - TuSimple Domain Controller) designed and developed based on NVIDIA's DRIVE Orin SoC chip. It is expected to begin mass production and delivery by the end of 2023. According to
[Automotive Electronics]
TuSimple releases domain controller based on NVIDIA DRIVE Orin SoC chip for L2+ to L4 level autonomous driving computing
Discussion on EMI Mechanism and Suppression Optimization Design Method of PWM Controlled IGBT
1. Analysis of dv/dt characteristics during operation (1) Waveform edge superposition characteristics Driver IGBT control methods, especially inverter type, include V/f control without PG, V/f control with PG, vector control without PG, vector control with PG, etc. There are three different control methods
[Embedded]
Discussion on EMI Mechanism and Suppression Optimization Design Method of PWM Controlled IGBT
Principle Analysis of PWM Inverter AC Voltage Stabilized Power Supply
1 Introduction There are two types of contactless compensation AC voltage stabilizers replacing three-phase column AC power stabilizers. One is a transformer compensation voltage stabilizer, the principle of which is to use a combination of multiple compensation transformers, through a "multi-full-bridge" c
[Power Management]
Design of high power solar LED street light system
In recent years, with the development of solar photovoltaic power generation technology and LED lighting technology, solar LED street lights have entered the field of urban lighting. Compared with traditional lighting sources, LED as a lighting source has the advantages of DC low v
[Power Management]
Design of high power solar LED street light system
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号