An Overview of Intelligent Vehicle Modules

Click on the above An Overview of Intelligent Vehicle Modules “Chuangxue Electronics” to follow and easily learn electronic knowledge.

Chuangxue Electronics Subscription Account

Daily updates on technical articles in the electronics industry and the latest news on microcontrollers, making it easy to learn anytime, anywhere.

I was fortunate to participate in the National College Student Electronic Design Competition during the summer of 2011. During the preparation process, I worked on several modules and gained some understanding of various design ideas and solutions (mainly focused on control). I have organized the following points hoping to assist everyone.

1. Choosing a Microcontroller

The commonly used main controller chips include STC 89C52/STC12C5A60S2 (51 series), ATMEGA16/128 (AVR), PIC16F877 (PIC), MSP430F149 (MSP430), STM32F103VET6 (STM32), EP2C8Q208C8 (CPLD/FPGA), LPC2103 (ARM7), S3C2440 (ARM9), etc. Generally, microcontrollers can output PWM signals to control motor speed, adjusting the vehicle’s speed and direction. The PWM output of the 51 microcontroller is simulated using internal programs (of course, some enhanced 51s are exceptions). Other series of microcontrollers such as AVR, PIC, MSP430, MC9S series, etc., all have PWM output capabilities, and different frequencies and duty cycles can be generated by manipulating the internal registers of the microcontroller. Additionally, factors such as timer counts, interrupt numbers, and operating speed may also affect the selection of microcontrollers. It’s not necessarily true that a higher-end chip is better; using FPGA, DSP, ARM9, etc., in this context can often be seen as a waste of resources or overkill—using too much for a small task or using it incorrectly. Here, I recommend using a slightly higher-end microcontroller (compared to 51), for two reasons: 1. The functionality is significantly more powerful, not just limited to PWM output. Some even integrate AD conversion interfaces, which provide great convenience for our designs. 2. For learning purposes, the 51 is really too simple (of course, there are also 4-bit microcontrollers, which we won’t discuss here). We should adopt a mindset of pursuing more knowledge, learning, and exploring the profound mysteries of the universe; otherwise, one might mistakenly believe they have mastered the microcontroller.

Regarding learning microcontrollers, I must mention a few points.

1. Do not be afraid: These different series of ICs are creations of human wisdom. We are also human, and it is impossible for us not to learn them. Those who do not learn well usually fall into two categories: one is using the wrong methods, and the other is unwilling to spend time, with the latter being more common. After learning the 51, the learning methods for other series of microcontrollers are also similar, just a bit more complex. Don’t just think of microcontrollers as something very profound and mysterious that you can’t approach. A good attitude and mindset lead to good learning; try it and see.

2. Recognize a fact: learning microcontrollers does not mean you can do everything. A microcontroller is just a tool; its power lies not in its capabilities but in how we utilize it and in what context. A good microcontroller programmer is not necessarily someone who can recite all the internal register names and operation instructions. Why? Because, as I mentioned earlier, it’s just a tool; what truly empowers it is how you program, utilize, and control it, meaning you need to have good programming ideas and be able to express those ideas through your code, which gives you the potential to become a microcontroller expert.

It seems I have digressed; let’s get back on track.

2. Choosing a Motor

Common types of motors include three: DC (reduction) motors, stepper motors, and servos. In intelligent vehicle construction, the former is more commonly used.

Now, we are not discussing structure and working principles but mainly how to control and change direction and speed.

DC (reduction) motor: The speed and direction can be changed by adjusting the voltage level and direction. Using PWM motor drivers (which will be discussed in the next section) to control the motor, the duty cycle effectively changes the average voltage across the motor terminals. As for controlling the high and low levels of the control pins to change direction, it simply involves changing the voltage direction across the motor terminals.

Stepper motor: Speed is adjusted using frequency. Changing the energizing sequence of the phases can alter the speed.

Servo: Can be controlled directly using I/O ports without a driver chip. Control uses a PWM signal of a certain frequency. The typical PWM frequency is 50Hz, where a high level time of 0.5ms to 2.5ms corresponds to servo angles of -90° to +90°.

When discussing motor selection, one point must be noted: regardless of the type of motor chosen, it is impossible to make the vehicle run perfectly straight without any control algorithms. After all, manufacturers cannot produce motors that are completely identical. Moreover, when assembling vehicle components, the mechanical structure may not be perfect either. Recognizing this is essential; we faced significant setbacks in this area initially.

Of course, motors are not only used in vehicles; control-related topics are fundamentally connected to motor control. As for how to choose a motor, readers should evaluate the pros and cons themselves and make cautious decisions.

3. Choosing a Motor Driver

Commonly used DC motor driver chips include: H-bridge constructed with transistors or MOSFETs, and integrated drivers like L293, L298N, MC33886, BTN7960B, etc. A major difference in usage is the range of operating currents. The most commonly used is L298N (dual H-bridge, two DC motors, one stepper motor, dual 2A). Here, I will only mention the ideas; specific circuit diagrams can be easily found online, and I do not want to overstep.

Common stepper motor drivers include: ULN2003/ULN2803 (Darlington transistors), L297+L298N, TA8435H, THB7128, etc., along with commonly seen high-power driver modules. Some drivers have microstepping capabilities, allowing the stepper motor to rotate a small angle per pulse. The principles and circuit diagrams for these will not be discussed here.

4. Measuring Speed

No matter what device or principle is used, speed is usually measured by counting pulses. Common sensors include: Hall sensors + magnets, photoelectric sensors + black tape, photoelectric sensors + encoders, and speed encoders commonly used in Freescale intelligent vehicle competitions. The principle will not be explained; effectively, measuring speed is about measuring pulse frequency. Methods include frequency measurement, perimeter measurement, input capture, etc. Of course, these methods can also be used for distance calculation and achieving more precise cornering functions. Compared to Hall sensors, using photoelectric encoders generally offers higher accuracy. Common 100-line photoelectric encoders can be purchased on Taobao for about 20 yuan.

5. Measuring Time

In problems, there are usually requirements for time measurement. Two common methods are: using internal timers of the microcontroller for timing; or using real-time clock chips, such as DS12C887, DS1302, etc. (which can only measure to the second; if time measurement requirements are not high and the timer is insufficient but I/O ports are available, this method can be used).

6. Line Following Sensors

Line following typically involves black and white lines (it could also be grid-based). Common sensors include: ST188, RPR220, TCRT5000, infrared transceivers, laser sensors, cameras, etc. Among these, ST188 and RPR220 are the most commonly used, and in circuit design, level conversion is often done using inverters or comparators.

There is also a scenario where the black line is not a guiding line but a boundary, such as in the 2011 National Competition’s intelligent vehicle.

Additionally, the layout of line following sensors should not be limited to a straight-line arrangement; the best sensor layout should be chosen based on actual requirements. If you feel line following has become boring and want to challenge yourself, you might consider tackling line re-following, which can be quite exciting.

7. Obstacle Detection Module

Aside from line following, the basic function of the vehicle also includes obstacle detection. Common sensors include: infrared transceivers/receivers, photoelectric switches (detection distance may vary depending on obstacle color), ultrasonic modules (easily affected by external interference, requiring special software handling), etc. The main usage differences lie in the length of the obstacle detection distance and whether the distance to the obstacle can be measured.

8. Communication Module

Line following and obstacle detection can also fall under this category, as they involve communication between external objects and the vehicle. For instance, in the 2011 National Competition’s overtaking problem, simple communication between two vehicles can use obstacle detection sensors. However, in this section, I want to focus on wired and wireless communication.

Wired communication: Simple wire transmission of high and low level data. More complex methods include SPI, IIC, RS232, RS-485 bus communication, CAN bus, etc.

Wireless communication: Commonly used methods include: wireless or network. If the network is not applied to the project, it is generally unnecessary. Here, I will introduce wireless modules. Common modules include: PT2262/2272 modules, NRF24L01, CC1100, NRF905, Bluetooth modules, Zigbee wireless network modules, etc. The data transmission distances of these modules vary, and they can generally be purchased at electronics markets or on Taobao.

9. Alarm Module

When it comes to alarms, sound and light naturally come to mind. A simple implementation can use a buzzer or LED indicator. To reflect intelligence, voice ICs such as ISD2560, ISD4004, MP3 modules, etc., can also be chosen. Customized language content chips can also be purchased on Taobao.

10. Display Module

Common types include: LED digital tubes, LCD1602, LCD12864, NOKIA5110, TFT color screens, and commonly seen touch screens. Generally, for display purposes, LCD1602 or NOKIA5110 is sufficient.

11. Temperature and Humidity Sensors

Temperature sensors include thermistors, thermocouples, PT100/Pt1000, DS18B20, AD590, DHT11, etc.

Humidity sensors include resistive sensors, DHT11, HS1101, etc.

Some resistive sensors can convert resistance changes into frequency changes using Schmitt triggers formed with 555 timers.

12. AD/DA Module

Some microcontrollers have integrated A/D or D/A functions.

Common A/D chips include: ADC0832 (8-bit, dual-channel, serial control), ADC0809 (8-bit, 8-channel, successive approximation, parallel), ADC0804 (8-bit, parallel), TLC1543 (switched-capacitor, 10-bit, 11-channel, serial interface), TLC2543 (12-bit, serial interface, switched-capacitor, 11-channel), TLC5510 (8-bit high-speed AD), AD7705 (16-bit SPI interface, 1MW ultra-low power, 2/3 channels, 1Mksps, DIP16, high precision, ultra-low power), AD7822BA (8bit, 2Msps, high speed, low power), etc.

Common D/A chips include: DAC0832, TLV5618, MAX504 (10-bit serial, 600mw), DAC902u (12bit, 165M high-speed DA), etc.

13. Amplifier Circuit Module Production

Common operational amplifiers and comparators: uA741, OP07 (low noise, high precision, 500mW, single channel, low noise, low drift)/OP27 (low noise, high precision, high, 8MHz, single channel, low noise, low drift)/OP37 (TI’s precision operational amplifier), TL082/TL084, LM311, NE5532 (high-speed low-noise dual operational amplifier, known as the king of operational amplifiers), AD620 (instrumentation amplifier, high precision low power 1.3mA, dedicated instrumentation amplifier), voltage-controlled amplifier AD603 (programmable amplifier, low noise, 90MHz, low power), AD781 (sample and hold, high-speed, high precision), LM393/LM339, LM358 (low power dual operational amplifier, can work with a single power supply), LM324 (this was the only chip used in the 2011 National Competition comprehensive evaluation topic, four-channel operational amplifier, can work with a single power supply), TBA820M (low-power audio amplifier), OPA842ID (unity gain stable, low noise, voltage feedback operational amplifier), OPA820ID (broadband, low distortion, unity gain stable, voltage feedback operational amplifier), ICL7650 (chopper-stabilized amplifier), LM386 (audio amplifier), etc.

Besides making small signal amplifier circuit modules, one must also be familiar with filter circuit design {for example, several specialized integrated circuits like MAX297CPA (low-pass filter, high-speed, low drift), MAX267 (high-pass filter, high-speed, low drift)}. Additionally, one can try making audio amplifiers.

14. Light/Flame Detection Module

Light-sensitive resistors, photodiodes, phototransistors, silicon photovoltaic cells, etc. Reference topic: light source tracking system.

Flame detection uses infrared flame sensors (detecting infrared light in the wavelength range of 700 to 1100nm). Reference topic: fire extinguishing robot.

The challenge in designing this is how to improve anti-interference capabilities, as fluorescent lights, sunlight, etc., can be common sources of interference. Moreover, in audio signal collection, how to resist interference is also very important.

15. Tilt/Angle Sensors

Tilt sensors: Used in the 2007 National Competition electric vehicle balance control topic; refer to that year’s technical report for sensor selection.

Electronic compass (can achieve precise angle measurement).

16. Audio Signal Detection Module

Sound detection: uses electret microphones to capture signals, which are then amplified; filters can be designed to retain only the effective frequency sounds. The sound navigation system from the 2009 National Competition is also quite classic. I recommend students involved in control-related topics to try this out if they have the opportunity. Since there is no GPS signal indoors, I believe that sound positioning will become one of the technologies in future indoor location development.

17. Solutions for Insufficient I/O Ports

Since some microcontrollers come in DIP40 packages, I/O resources are indeed limited. Using two or more microcontrollers is a viable option; after all, technology is trending towards “multi-core.” Additionally, consider whether it’s feasible to use some serial-to-parallel conversion chips (such as 74HC595, 74HC164, etc.) to control peripheral devices; that might also be a good idea.

18. System Control Solutions and Algorithm Design

PID algorithms, incremental algorithms, positional algorithms; learn how to implement them in C language. Also, understand PID parameter tuning methods. Reference topics: water temperature control systems, Freescale intelligent vehicle design reports, etc.

Advanced process control strategies: fuzzy control, model predictive control, neural network control, etc.

The most commonly used is still the PID control algorithm.

Recommended topics: 1997 National Competition water temperature control system, 2011 National Competition vocational group sail control system.

19. Upper Computer Software

If you have the ability and interest, you can try developing handheld upper-computer software. Additionally, MFC, Delphi, LabVIEW, etc., are also valuable software. If time permits, I suggest you learn LabVIEW (it’s relatively simple to get started).

20. Signal Generation

DDS chips: AD9850 (125MHz, 28 pins), AD9852, AD9854, etc.

ICL8038 (used for low-frequency signal generation), MAX038 (quite expensive, seems to be discontinued and hard to find).

Using operational amplifiers to generate triangle waves, square waves, and sine waves is also mentioned in electrical engineering textbooks.

Moreover, using microcontrollers to control DA chips can also generate waveforms.

21. Image Recognition Module

Generally, cameras are chosen, with distinctions between CMOS and CCD. Additionally, the supply voltage for CMOS cameras is generally +5V for normal operation, while CCD cameras typically operate at 12V. Cameras can also be digital or analog; using external high-speed AD converters can convert the data from analog cameras into the voltage signals used by microcontrollers. However, image processing with cameras is quite challenging and has not yet appeared in electronic competitions. If readers are interested, they can participate in the camera group of the Freescale intelligent vehicle competition, which will greatly enhance their skills.

22. Color Sensors

Image recognition is indeed quite challenging, but if you only need to distinguish objects by color, you might consider color sensors, such as TCS3200D.

23. Gas or Smoke Sensors

The smoke sensor MQ-2 can be used to detect combustible gases like CO and CH4. Generally, it’s used for amplified filtering or AD sampling.

Other sensors include CO2 sensors, CO sensors, alcohol sensors, etc.

24. Drawing/Simulation Software

Proteus, Multisim, Protel 99 SE, Protel DXP 2004, Altium Designer 10, etc. The first two are mainly for simulation, while the latter three are for schematic design and PCB production. Here, I must reiterate: do not overly rely on simulation software. Many components in simulation software may not exist, and the performance of components you can find may not accurately reflect reality. Please use it cautiously; otherwise, if errors occur, you might mistakenly think it’s a programming issue, leading to wasted time in troubleshooting.

25. Some Additions

(1) Power Supply Module:

Common voltage regulation modules include ±12V, ±9V, ±5V, 3.3V; AMS1117, LM7805/7905, LM7809/7909, LM7812/7912, LM317/337, LM2940, (switching chip) LM2576, etc. Furthermore, consider how to choose power supply chips if large current/voltage outputs are needed.

(2) Minimal System:

Identify a microcontroller that you are familiar with for competition, such as C51, AVR, PIC, MSP430, CPLD/FPGA, STM32, Sunplus microcontroller, DSP, ARM7/ARM9, etc., and create a minimal system that exposes all ports for future expansion.

(3) Isolation Optocoupler Selection:

6N137 (high-speed optocoupler 10Mbit/S), 6N135 (1M bit/S), 6N138 (100K bit/S), TLP521, PC817A (linear optocoupler), IL420 (SCR-type optocoupler), HCNR200 (linear optocoupler), etc.

(4) Proximity Switch (detecting metals).

(5) Ultrasonic Sensors (distance measurement, obstacle avoidance).

(6) Acceleration Sensor MXD2020EL.

(7) Current Sensor TBC-XS5 series Hall current sensor.

(8) Voltage Sensor TBV5/25A series Hall voltage sensor.

(9) Varistor 14D471K.

(10) LED display indicators.

(11) Matrix keyboard.

(12) Electric Vehicle: Choose based on different venues and topic requirements (two-wheel drive three-wheel, two-wheel drive four-wheel (like tank vehicles), four-wheel drive vehicles, similar to Freescale vehicle models, etc.).

(13) Batteries: Lithium batteries 8V, 12V (may also be used). If conditions allow, separating the power supply for the motor and control system can enhance system stability and reliability.

(14) How to measure droplet velocity, how to measure liquid level height, etc. For instance, measuring the water volume in the water-carrying robot in the 2010 Zhejiang Provincial Competition was crucial. Additionally, the infusion control system in the same year’s hospital bed was also key.

(15) Note:

1. The prices of the above chips or modules may be relatively high; generally, companies offer free samples or evaluation boards for application.

2. It is advisable to organize modules and programs during routine training (e.g., small system boards, etc.), so they can be directly used during competitions, saving a lot of time. This is also a key factor in achieving good results.

26. About Papers

Some may feel that we are learning technology, programming, and designing circuits, and spending time and energy on writing documents is simply a waste of life. Others may feel lost when writing documents, not knowing where to start; clever students would naturally remember to search online. I want to say that do not think this is wasting youth or squandering life; learning to write documents well is even more important. An excellent engineer is always willing to share knowledge with others, and through this exchange, not only can one gain wisdom, but they can also become more knowledgeable themselves. In this era of advanced networking, this exchange is no longer limited to verbal communication; some people write books, some manage, or frequently visit forums, while others write blogs, all aimed at guiding future generations or receiving critiques from experts (or you might think they are just showing off). Your learning is limited, but the power of collective learning through exchange is limitless; only by sharing your wisdom with others can you receive help from more people, which can be considered a double-edged benefit.

Moreover, in future graduation theses, project management in work, etc., your document writing ability will also be a significant test. While you are young, why not practice more? Do you want to regret not working hard when you were young?

After finishing each topic, consider writing a technical report. Don’t forget that in competitions, the report also carries significant weight.

27. Conclusion

I would like to thank the Party for its careful cultivation, and I appreciate the guidance from Teacher Zhao and the seniors from the College of Measurement and Control over the past year. Thank you to my teammates Liu and Chen for their help, allowing us to experience an unforgettable time in our lives together. I also want to thank the younger students of the Yanbei 514 Electronics Association who specialize in soldering, and especially thank the college for its financial support, which allowed us to participate in electronics design. Regardless of the sweet, sour, bitter, or spicy, time always moves forward, and we must move forward too. I hope that future students will continue to work hard and bring glory to themselves and the college.

Due to my limited skills and time, the above content may inevitably contain errors or omissions. Everyone is welcome to criticize, correct, and supplement; please be gentle with the experts and do not throw bricks.

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

How to Share to Moments

Click on the upper right corner An Overview of Intelligent Vehicle Modules in the pop-up menu select An Overview of Intelligent Vehicle Modules to share to Moments.

How to Follow “Chuangxue Electronics”

1. On WeChat, click the upper right corner “+” Click “Add Friends” → Search for “Chuangxue Electronics” in “Find Official Accounts” to find and follow us. 2. You can also search for WeChat ID “Chuangxue Electronics” to find and follow us.

How to View Historical Messages

Click the upper right icon to enter

Leave a Comment