Experience in implementing a remote-controlled smart car based on 51 single-chip microcomputer

Publisher:SparkCrafterLatest update time:2015-05-11 Source: 51hei Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

     Two years ago, when I was learning about 51 MCU, I bought a 51hei MCU development board. Now I am learning FAT32, UGUI and UCOSII operating systems based on STM32 embedded system. I rarely look at 51 MCU development boards. One day, my baby suddenly asked me to buy her a remote control car, saying that others have one. I checked the Internet and found that the price of a car with better performance is quite high. I suddenly remembered that I still have an idle 51hei MCU development board. Why not make a smart car for my baby? Stop talking and take action.

     After nearly a week of work, the car was finally completed. Although it looks a little ugly, its performance is not bad. Main functions: 1. Infrared remote control, the car can move forward and backward synchronously, turn left, turn right, reverse left, and reverse right; 2. Automatic barrier during driving. In fact, you can add any function as long as you are willing to spend money.

     The program is modified based on the source code of the infrared experiment of the 51hei single-chip microcomputer development board. The program is very simple and uses the interrupt working mode. The power supply was bought from someone who collects old mobile phones. Although it is old, it still performs well after my charging experiment; the frame, motor and infrared probe were bought online. The motor drive circuit was designed by myself. It can be said that it is tailor-made for the peripheral circuit of the 51hei single-chip microcomputer development board. For this motor drive circuit, I really spent a lot of thought and money---I used 4 DC solid-state relays (of course, it is free, and I got them from the unit). The most time-consuming and thoughtful part of making this car is program debugging and motor drive circuit design. Anyway, the car is "obedient" and runs. Single-
  
    chip microcomputer is a very practical science. If you simply learn theoretical knowledge without practice, it is difficult to fully grasp the single-chip microcomputer. Although the single-chip microcomputer is an intelligent integrated chip, it is essentially an electronic component. Since it is an electronic component, it must be operated in a certain circuit to realize its function. This is just like a resistor. If a resistor is placed independently, it is meaningless. Only when the resistor is connected to the circuit can its function be realized. Whether it is voltage division, current division or current limiting depends on the detailed circuit.

    By debugging the program by myself and modifying the code repeatedly, I also experienced many unexpected things. For example, to which IO port the signal line of the infrared probe is connected, we should try to consider the interference of the infrared signal on the peripheral system of the microcontroller, how the main loop and the interrupt cooperate, etc. By dealing with these unexpected things, I deeply realized a truth: practice makes perfect! Of course, theory is the basis of practice. By making a car by myself, it can be said that it is also a kind of review of the knowledge of 51 single-chip microcomputer: I have a deeper understanding of the minimum system, working principle, and MCU resources of the single-chip microcomputer!

      In fact, the smart car can also be regarded as a simple robot. The more complete the robot's functions and the higher the degree of intelligence, the higher the requirements for the MCU. Simple robots can only complete the intelligent control of the robot by working in the main program in the main loop or interrupt mode; if it is a very complex motion intelligent robot (using a large number of sensors), it must be equipped with an operating system. This shows how important the operating system is! And the affordable operating system that is easy to transplant in the industrial field is naturally the free and open source UCOSSII operating system!

    Knowledge is integrated. When I was learning C language by myself, I felt it was boring; but when I combined C language with embedded systems and learned it by using it, I felt different. I lamented that time and energy are limited, and there are too many things to learn! No matter what, I must seize the time to learn the powerful STM32 thoroughly; remember this year's task: I must master the "three major things" of FAT32, UGUI and UCOSII operating system.

Reference address:Experience in implementing a remote-controlled smart car based on 51 single-chip microcomputer

Previous article:51 single chip microcomputer drives stepper motor (assembly language)
Next article:51 single chip microcomputer to simulate playing table tennis

Latest Microcontroller Articles
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号