Design of single chip intelligent car

Publisher:LovingLife2023Latest update time:2015-06-15 Source: 51heiKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The car has been upgraded to wireless remote control! The remote control helicopter I bought last year broke after a few times of playing. Later, I bought a spare part and broke it again after playing twice. I really don't want to repair it. After making the car some time ago, I always wanted to use wireless remote control. I thought about it for a long time, but I couldn't think of any good way to make a beautiful remote control. Later, I paid attention to the remote control of the remote control helicopter. I thought that if it could be changed into a small remote control, the operation would be great. At first, I was going to use an oscilloscope to crack the signal transmitted between the helicopter remote control and the helicopter. After studying for a while, I found that I was very naive, because there was no schematic diagram or any information. I only knew that the wireless frequency of the remote control was 2.4GH. It would be harder than climbing to the sky to crack it. Later, I thought that it would not be difficult to make one with an STC microcontroller. So, I took apart the remote control of the aircraft. I first removed the control circuit board inside. Then I used diagonal pliers to cut off the circuit board of the button and power switch and put it back. Of course, the two joysticks must be retained, which are actually 4 potentiometers. Then I soldered a single-chip minimum system, connected the buttons and potentiometers, and the hardware was done. Then I modified the ADC routine of the STC single-chip, and then modified the USART routine and added it. The software was also done. My custom protocol is: send 21 bytes of data through the serial port at a time, the resolution of the ADC is 256 levels, and each potentiometer is represented by 3 bytes of ACSII code, so the first 12 bytes are 4 potentiometer data, and the last 8 bytes are used to represent 8 buttons. Press and send ACSII code '6', otherwise send '0'. The last one is fixed to 0xaa, which is used to check whether the communication is wrong. Okay, I'll write it here, and I'll continue writing when I have time.

I bought a STM32 minimum system board some time ago and replaced my Shenzhou IV board.



That small board is a wireless module. It cost me a lot of money.














This one is modified from a helicopter remote control. There is also a wireless module inside, and the wireless module is a serial port transparent type. Because I am not very familiar with the SPI interface and SI4432. I am ashamed! [page]

The effect after this upgrade is very good. The car is very flexible. It can move freely in our dormitory.


Everyone who studies microcontrollers will make a car, and I don’t want to be an exception. This is the result of these weeks. 
The functions of the car include: infrared remote control function (dual remote control is available, steering function driven by servo, stepless speed regulation function, reversing function,
parking brake function, ultrasonic obstacle avoidance function, siren, and speed measurement function to be expanded.

This is the production site, which is quite messy.

The conditions are simple!




This is an ultrasonic obstacle avoider, which has not been debugged yet. The distance measurement is relatively accurate, but it is not easy to integrate it perfectly into the whole program. Use the first channel of TIM3 to capture the high level width of ultrasonic echo in input mode. The

main control board uses the Shenzhou IV experimental board. The one in the middle that looks like a triode is the infrared receiving head. I use the second channel of TIM3 to measure the infrared pulse width decoding in input capture mode.

One is on the TCL monitoring display, and the other is on the Tianmin TV box. TC L's infrared protocol is a bit confusing, but I have a USB analog oscilloscope, so it's easy to deal with after seeing the waveform. Tianmin uses the NEC infrared protocol, but not completely, the two address codes are not inversely related. I feel that buying a USB analog oscilloscope is very helpful to learn about the microcontroller. It is not expensive, mine is only more than 100.

Use the first channel of TIM2 to drive the servo with PWM wave, the servo is MG995. Use the second channel to drive the main motor with PWM wave. The entire rear wheel part was removed from an old toy car.

The power of the car comes from two lithium batteries, which were removed from my laptop. The computer is always plugged in, and I feel that the battery is useless without it, so it is better to remove it for experiments.



The relay is used for reversing. This relay is 6V Double-pole double-throw is still rare. I think I removed it from the circuit board of the emergency light. The transistor on the lower right is used to drive the main motor. The

one on the left side of the servo is a siren. It is driven by an 8050 transistor.

The main function used is the timer function of STM32. The timer function of 32 is really powerful. The timer function of 51 cannot compare with it. Its complexity made me dizzy for a long time, but now it is relatively clear.
It can be said that the car is a carrier and a mobile experimental platform. Various functions can be added to it in the future, such as manipulators. Now I use infrared remote control, which is only temporary. When the wireless module is used well, it will be changed to wireless. That is suitable for controlling the car. Yesterday, I found that the infrared remote control failed in strong sunlight during the test drive. Later, I thought about it and it was normal. The strong infrared rays in the sunlight are enough to interfere with the remote control. Also, the TV remote control can't keep up with the steering at all, because when you need to turn quickly, the control relationship is not a linear relationship at all. I think it should be suitable to use a stepless joystick. I have studied joysticks before, and I will buy a better one to control the car in the future.
Keywords:MCU Reference address:Design of single chip intelligent car

Previous article:STM32 IO configuration and mode
Next article:Introduction to STM32 SPI pins

Recommended ReadingLatest update time:2024-11-17 03:03

MCU capability test
1. 74HC595 is a logic chip with serial input and parallel output. Call the function MDIP_HC595(0x01); output 7 low levels and 1 high level at the output end. The parameter is an unsigned 8-bit variable BYTE. Please use C language to write the function void MDIP_HC595(BYTE gLOcal_1); Answer: sbit SER=P1^0; //595 seria
[Microcontroller]
51 MCU uses printf for serial port output in Keil
Recently, some students are troubled by the problem of how to use the serial port of the microcontroller to output and display on the host computer serial port assistant during the learning process of 51 single-chip microcomputer. In fact, many development environments support the use of the most commonly used printf
[Microcontroller]
Design and implementation of real-time communication between PC and single-chip multi-machine
In the multimedia voice teaching system, bidirectional instruction transmission is required between the host computer and each student computer. Since serial communication has the advantages of high efficiency, reliability and low price, this system adopts the serial communication method. Windows95 is a non-real-tim
[Microcontroller]
Design and implementation of real-time communication between PC and single-chip multi-machine
Application of LPC21XX Series Microcontroller Based on ARM7 in BAS
1. Overview of Building Automation System Building Automation System (BAS) is actually a central monitoring system. It centrally monitors various power equipment, air conditioning equipment, cold and heat source equipment, fire protection, anti-theft equipment, etc. in a building (or building complex), so as to ach
[Microcontroller]
Application of LPC21XX Series Microcontroller Based on ARM7 in BAS
Ceva Bluetooth Low Energy and 802.15.4 IP Brings Ultra-Low-Power Wireless Connectivity to Alif Semiconductor's Balletto Family of MCUs
Balletto Bluetooth 5.3 LE and Matter Wireless MCU Family with Neural Coprocessor for AI/ML Workloads in Wireless Audio and Smart Home Ceva, a leading licensor of semiconductor products and software IP that enable intelligent edge devices to more reliably and efficiently connect, sens
[Network Communication]
Ceva Bluetooth Low Energy and 802.15.4 IP Brings Ultra-Low-Power Wireless Connectivity to Alif Semiconductor's Balletto Family of MCUs
Massive data storage for communication between MCU and PLC
1. Use the existing mature PLC technology to collect the monitoring point data of each device; 2. Use single-chip microcomputer technology to read the data collected by PLC and store it in a storage device in a certain format. The storage device can be a USB flash drive, memory card, etc.; 3. Use a card reader to
[Microcontroller]
Massive data storage for communication between MCU and PLC
A double inverted pendulum control system based on SPCE061A single chip microcomputer
1. Introduction High-voltage transmission lines and tower accessories are exposed to the wild for a long time. Due to the continuous mechanical tension, electrical flashover, and material aging, they are damaged by broken strands, wear, corrosion, etc. If they are not repaired and replaced in time, th
[Microcontroller]
A double inverted pendulum control system based on SPCE061A single chip microcomputer
51 MCU interrupt response process and sequence examples
If an interrupt source is programmed and is in an open state, and meets the conditions for interrupt response, and ① the currently executed instruction has been executed 1, the same level or high level interrupt is not currently responded to 2, and the IE, IP interrupt control register is not being operated or the REH
[Microcontroller]
51 MCU interrupt response process and sequence examples
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号