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
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.
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]
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]
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]
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]
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]
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]
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
Guess you like
- Vehicle GPS Antenna Installation Location
- MSP430F5529 generates PWM waves with CCS
- FPGA Multiplier
- Quartus2 simulation can not produce waveform
- After the microcontroller is connected to the computer via a USB cable, the problem of "unrecognized USB device" appears
- 2. GD32L233C-START environment construction
- Commonly used algorithms for drones - Kalman filter (Part 2)
- STEVAL-IDB007V1_by cruefox
- AI automatically generates Spring Festival couplets to warm up for FZ5
- STM32F407VG mount SD card