elleny

#The4thInnovationContest#SmartCar

 
Overview
**【Please fill in during the registration stage↓】**
**Brief introduction of the work**:
       The smart car consists of two parts: the remote control and the remote control car. The remote control has three working modes (infrared transmission mode, Bluetooth transmission mode and 2.4G wireless transmission mode). The remote control car consists of a chassis (purchased on Taobao) and a control part. The remote control car has three operating modes: free control mode, obstacle avoidance mode, and tracking mode.
**【Please fill in during the competition stage↓】**
**I. Details of the work:**
1. The original intention of making this smart car: I have been doing single-chip microcomputer software programming for many years since graduation. Due to the nature of the work, there are dedicated people in charge of hardware design and circuit board production, and even circuit board welding does not need to be done by myself. My main job is that others hand over the intact circuit board and schematic diagram to me, and I will complete the program and implement its functions according to the company's requirements. Later, I had extra time, and according to my own preferences, I also wanted to try to make some small things I wanted to make. One is to practice drawing circuit boards, the second is to keep my childishness and make some toys I want to play with for myself, and the third is to strengthen my learning of hardware. Based on these three ideas, I started my hardware production. The first thing that came to my mind was the car I made in college. At that time, the car, hardware Most of them were purchased ready-made, spliced ​​together with various modules, and improved by myself. They only had a tracking function. I wanted to make a small car that can track, avoid obstacles and be controlled by a remote control. By chance, I logged into the 21IC forum and found the electronic design competition held by Jialichuang. I read the introduction and found that I met the requirements, so I signed up for the competition. I thought I could use this platform to showcase my own small creations, broaden my horizons, and learn from other people's creations. It would be even better if I could get guidance from professionals. I have always been curious about the Bluetooth module and the 2.4G wireless module, but have never used them. In order to learn these two modules, I combined them with my remote control car and remote control, and of course added traditional communication modules (infrared transmitter and infrared receiver).

2. Introduction to the smart car: a. Introduction to the main parts of the remote control, Bluetooth module, 2.4G wireless module, infrared transmitter, rocker potentiometer, 7.4V lithium battery, SWD download circuit, reset circuit, buzzer circuit, power switch, etc.; b. Introduction to the main parts of the remote control car, car chassis (2 wheels, DC motor, universal wheel, fixed frame), Bluetooth module, 2.4G wireless module, infrared receiver, 7.4V lithium battery, SWD download circuit, reset circuit, buzzer circuit, power switch, obstacle avoidance module, tracking module, ultrasonic module, motor drive circuit, USB to serial port circuit (also supports USB download program), etc.

3. Working principle of the smart car: a. Remote control: The remote control determines what command to execute through the position of the joystick, and sends the executed command through Bluetooth, wireless or infrared transmitter to control the action of the car; b. Remote control car: Receive the signal sent by the remote control through wireless, Bluetooth or infrared receiver, and work according to the instructions after parsing the command.

4. Smart car workflow (program implementation steps) @1. Power on the remote control car (a. **Note**: Only one can be selected between USB power supply and P12 battery power supply. The battery and USB voltages are inconsistent, which will cause some components to not work properly; b. At the moment of power on, the LED2 power indicator 3.3V and the LED3 power indicator 5V light up at the same time. After two seconds, the buzzer sounds and sends "Welcome to the smart car~~~~" to the serial port through USB); @2. The remote control "right joystick" "inward" ( The button is closed) "long press", then power on (a, **Note**: Only one can be selected between USB power supply and battery power supply. The battery and USB voltages are inconsistent, resulting in some components not working properly; b. At the moment of power on, the D4 power indicator 3.3V and the D3 power indicator 5V light up at the same time, and the buzzer sounds once. After the sound, you can release the remote control button); @3. Set the remote control working mode (move the right joystick to set, observe the changes in the D1 and D2 indicators, move the right joystick to the left, D1 is on, D2 is off, infrared mode; move the right joystick to the right, D1 is off, D2 is on, Bluetooth mode; move the right joystick up, D1 is on, D2 is on, wireless mode; moving the right joystick down has no effect); @4. Exit the remote control working mode (the remote control "left joystick" moves inward" ( The button is closed) "Press" to save the remote control working mode. The buzzer sounds 3 times. **Note**: In step 2, the power is turned on directly without pressing the right joystick button. The remote control mode is the mode set last time. The remote control has a mode storage function. The default infrared mode is not set last time); @5. Connect the remote control and the remote control car (automatically connect, no matter what working mode the remote control is in, after the connection is successful, a. The remote control car buzzer sounds and the remote control car **LED1 indicator light is always on**; b. The previously lit indicators of D1 and D2 will flash at a frequency of **1HZ**. **Note**: If the connection fails, a. Check whether the infrared, Bluetooth, and wireless modules are installed correctly; b. Distance Is it within the working range? Usually, infrared and wireless will successfully connect within 1S, while Bluetooth mode will connect slowly, about 10S; c. If neither a nor b occurs, turn off all power and start again from step 1); @6. After the connection is successful, set the remote control car's operating mode (move the **right joystick** to set, and observe the changes in the remote control car's **LED1** indicator light. a. Move the right joystick to the left, LED1 flashes at 100ms, free control mode; b. Move the right joystick to the right, LED1 flashes at 500ms, obstacle avoidance mode; c. Move the right joystick upward, LED1 flashes at 1s, tracking mode; d. Move the remote control "right joystick" "inward" ( The button is closed) "press and hold", the run and stop cycle is performed); @7. So far, the remote control has been set successfully.
**Notes**:
a. The remote control car's operating mode setting can only be executed when the remote control car is in **stop mode**.
b. The **free run** mode refers to the remote control controlling the car to perform actions. After setting it to free run mode, the remote control's "right joystick" "presses inward" (button closed) to **start running**. At this time, the left joystick actions "up, down, left, right" correspond to the car's "forward, backward, turn left on the spot, turn right on the spot", and the right joystick left and right actions are invalid. "Up and down" correspond to "acceleration, deceleration", and can only speed up one gear.
c. When running in **obstacle avoidance mode**, the remote control car uses the ultrasonic wave in front and the infrared obstacle avoidance modules on both sides to detect whether it is blocked (ultrasonic wave detects whether the distance is within the set range, and this car is set to 15cm). After setting the obstacle avoidance mode, the remote control's "right joystick" "presses inward" ( The button is closed) "press once" to start running and execute the action. If the detection distance is greater than 15cm and there is no obstruction on both sides, the car moves forward; if the detection distance is greater than 15cm, the left is blocked and the right is not blocked, the car turns right; if the detection distance is greater than 15cm, the left is not blocked and the right is blocked, the car turns left; if the detection distance is less than 15cm, the left is blocked and the right is blocked, the car moves backward; if the detection distance is less than 15cm, the left is not blocked and the right is not blocked, the car moves backward; if the detection distance is less than 15cm, the left is blocked and the right is not blocked, the car's left wheel rotates forward and the right wheel reverses; if the detection distance is less than 15cm, the left is not blocked and the right is blocked, the car's right wheel rotates forward and the left wheel reverses. In this mode, the left and right actions of the right joystick are invalid, and "up and down" correspond to "acceleration and deceleration". It can only speed up by one gear, and the left joystick actions are invalid. After starting running, the car keeps running until it runs out of power or the stop button is pressed.
d. When running in **tracking mode**, the remote control car passes through the two **tracking modules** in front of it for detection. It is necessary to arrange the scene in advance, use black tape to stick out the runway position, and adjust the position of the tracking module so that it is on both sides of the **runway**. After setting the obstacle avoidance mode, the remote control "right joystick" "presses inward" (button closed) to **start running**. During the running process, the remote control car passes through the two tracking modules in front of it and continuously detects signals. If the left and right tracking modules do not detect the black line, it moves forward; if the left side detects the black line but the right side does not, it turns left; if the left side does not detect the black line but the right side detects it, it turns right; if both the left and right tracking modules detect the black line, it moves left (right turn is also possible, it can be set at will). In this mode, the left and right actions of the right joystick are invalid, and the "up and down" correspond to "acceleration and deceleration". It can only speed up by one gear, and the left joystick actions are invalid. **After starting running, the car keeps running until it runs out of power or the stop button is pressed**.
**e.**After the remote control car receives the "valid" action from the remote control, the buzzer on the remote control car will sound "once". If the remote control sends the correct command but the remote control car does not execute it correctly, you need to check carefully whether the remote control car is in the receiving blind area, **especially the start and stop operation commands**. Other commands that are not executed can be resent. Once there is a deviation in starting and stopping, the car and remote control will not move synchronously. In this case, you need to reconnect the car and remote control.

5. Workflow of the smart car (program implementation steps-------flowchart): In order to facilitate the understanding of the program, the program implementation process is now drawn into a flow chart, as follows:
![flowchart.png]
**2. Describe the challenges faced by the work and the problems solved:**
1. The hardware design is relatively weak. Almost every small module is built by myself with a perforated board, and the PCB is drawn after debugging.
2. When designing the PCB, I was not proficient in drawing the package and was very slow, which wasted a lot of time;
3. After the circuit board was completed, it was found that there was some misalignment with the chassis during installation. Fortunately, the misalignment was not large, and the copper pillar was slightly tilted and installed;
4. Through this study, not only did I deepen my understanding of hardware, but I also became more proficient in PCB packaging and wiring;
5. Both the Bluetooth module and the wireless module were my first contact, and the debugging was relatively slow. I also asked many predecessors on the forum, but now I can use them proficiently;
6. Selection of motor driver. I found many motor driver related chips. Since I have been using stepper motors since graduation, I am unfamiliar with DC motor drivers. I used to use ready-made modules such as ULN2003 in school, which are too large. Now I want to build one myself, so I chose a motor driver chip with a particularly small package.

**III. Describe the key points involved in the hardware and software parts of the work:**
1. Hardware part: a. Design of tracking and obstacle avoidance circuit; b. Motor driver chip circuit; c. Voltage conversion circuit (5V and 3.3V); d. Principle of Bluetooth module and wireless module; e. Infrared transmission and infrared reception mechanism; f. Principle of rocker potentiometer. 2.
Software part: a. How does the remote control obtain the position information of the rocker potentiometer; b. How does the remote control use three modules to communicate with the remote control car; c. The use of the status indicator light. By observing the status indicator light of the remote control, you can know which working mode the remote control is in and whether it is connected to the remote control car. By observing the indicator light of the remote control car, you can know which operating mode the remote control car is in and whether it is connected to the remote control; d. The use of the state machine. After setting the working mode of the remote control, the program performs a handshake connection. The program is executed in the state machine mode.

**IV. Materials List:**
1. Remote Control

| | | | | |
| --- | --- | --- | --- | |
Comment | Description | Designator | Footprint | Quantity |
| 0905 | Active 3V | BZ1 | HYT-0905 | 1 |
| 0.1uF | Ceramic Chip Capacitor | C1, C3, C8, C12, C13, C14, C15, | | | |
C16, C17, C18 | C0805 | 10 | | |
| 22uF/10V | Ceramic Chip Capacitor | C2, C4, C10, C11 | C0805 | 4 |
| 22pF | Ceramic Chip Capacitor | C5, C6 | C0805 | 2 |
| 220uF/16V | | C7 | 6.3*7.7(Aluminum Chip) | 1 |
| 10V10uF | Ceramic chip capacitor | C9 | C0805 | 1 |
| LED/0805/RED | SMD emitter | D1, D2, D3, D4 | D0805 | 4 |
| DIP2 | Infrared emitter | D5 | HDR1X2 | 1 |
| xh2.54mm | 2.0mm cable to | J1 | XH-2.54-4 | 1 |
| USB-B | USB B type | J2 | USB-B female | 1 |
| GZ2012D601TF | Inductor | L1 | R0805 | 1 |
| M3x6 | Screw hole | M1, M2, M3 | M3-cross | 3 |
| battery | 18650 battery | P1 | Battery | 1 |
| 2.54mm | Header, 2-Pin | P2 | HDR1X2 | 1 |
| HM-1X | Bluetooth module | P3 | HM-11 | 1 |
| 8550 | SMD | Q1 | SOT-23 (PNP/NPN | 1 |
| 8050 | NPN | Q2 | SOT-23 (PNP/NPN | 1 |
| 10K/1% | SMD resistor | R1, R3, R4, R6, R7 | R0805 | 5 |
| 1K/1% | SMD resistor | R2, R10, R13 | R0805 | 3 |
| 1M/1% | SMD resistor | R5 | R0805 | 1 |
| 360R/1% | SMD resistor | R8, R9, R11 | R0805 | 3 |
| 5R1 | SMD resistor | R12 | R0805 | 1 |
| 10K | SMD resistor | R14, R15 | R0805 | 2 |
| 1K | SMD resistor | R16, R17, R18, R19 | R0805 | 4 |
| RKJXK | Rocker potentiometer | RW1, RW2 | RKJXK | 2 |
| SW-PB | Switch | S1 | SW-PB (3_6_2..5 | 1 |
| 6-pin self | Switch | S2 | 5.8*5.8 (6-pin self | 1 |
| STM32F103C8T6 | Core | U1 | STM32F103C8T6-48 | 1 |
| AMS1117-3.3 | Core | U2 | SOT-223 (three-terminal regulator | 1 |
| NRF24L01 | Wireless module | U3 | HDR2X4 | 1 |
| 8MHz | Crystal Oscillator | Y1 | XTAL.18/.42 (SMD No | 1 |

2, Remote Control Car

| | | | | |
| --- | --- | --- | --- |
| Comment | Description | Designator | Footprint | Quantity |
| TESTPAD | Test Point | +3.3V, +5V | TP-1mm | 2 |
| 0905 | Active 3V | BZ1 | HYT-0905 | 1 |
| 0.1uF | Ceramic Chip Capacitor | C1, C3, C8, C10, C11, C12, C13, | | |
| C14, C17, C19, C24, C25, C28, C29, C30, C31, C32 | C0805 | 17 | | |
| 22uF/10V | Ceramic Chip Capacitor | C2, C4, C22, C23, C26, C27 | C0805 | 6 |
| 22pF | Ceramic chip capacitor | C5, C6, C20, C21 | C0805 | 4 |
| 10V10uF | Ceramic chip capacitor | C7, C18 | C0805 | 2 |
| 47uF/16V | Aluminum | C9 | 6.3*7.7 (chip aluminum | 1 |
| 10uf (120 | Ceramic chip capacitor | C15 | C1206 | 1 |
| 220uF/16V | | C16 | 6.3*7.7 (chip aluminum | 1 |
| LED1 | Infrared transmitter | D1, D3 | φ | 2 |
| LED2 | Infrared receiver | D2, D4 | φ | 2 |
| xh2.54mm | 2.54mm line to | J1, J2 | XH-2.54-4 | 2 |
| USB-B | USB Type B | J3 | USB-B female | 1 |
| GZ2012D601TF | Inductor | L1 | R0805 | 1 |
| 100M@600Ohm | Inductor | L2 | D0805 | 1 |
| LED/0805/BLUE | SMD LED | LED1, LED2, LED3 | D0805 | 3 |
| LED/0805/GREEN | SMD LED | LED4, LED5 | D0805 | 2 |
| My_Logo | Competition logo | Logo | MY_LOGO | 1 |
| M3x6 | | M1, M2, M3, M4 | M3-cross | 4 |
| TESTPAD | Positioning hole | Mark\_Dot1, Mark\_Dot2, Mark\_Dot3, | | |
| Mark_Dot4 | Mark_Dot | 4 | | |
| Header 3 | Header, 3-Pin | P1, P2, P3, P4, P5, P6, P7, P8, | | |
| P9, P10 | HDR1X3 | 10 | | |
| 2.54mm(JST) | Header, 2-Pin | P11, P12 | XH-2.54-2 | 2 |
| HM-1X | Bluetooth module | P13 | HM-11 | 1 |
| Header 4 | Header, 4-Pin | P14 | HDR1X4 | 1 |
| VS838 | Infrared integrated | P15 | HDR1X3 | 1 |
| Tracking module | Infrared integrated | P16, P17 | HDR1X3 | 2 |
| 8550 | SMD | Q1 | SOT-23 (PNP/NPN | 1 |
| 10K/1% | SMD | R1, R4, R5, R6, R7, R11, R16, | | |
| R21, R22, R23, R24, R26 | R0805 | 12 | | |
| 1K/1% | SMD | R2, R8, R20, R25, R27 | R0805 | 5 |
| 1M/1% | SMD | R3 | R0805 | 1 |
| 0 | SMD | R9, R10, R17, R18, R19 | R0805 | 5 |
| 1R | SMD | R12, R13, R14, R15 | R0805 | 4 |
| 100R/1% | SMD | R28, R29 | R0805 | 2 |
| RPot | Potentiometer | RP1, RP2 | VR5 | 2 |
| SW-PB | Switch | S1 | SW-PB (3_6_2..5 | 1 |
| 6-pin self | Switch | S2 | 5.8*5.8 (6-pin self | 1 |
| STM32F103C8T6 | CPU | U1 | STM32F103C8T6-48 | 1 |
| A3906SES-T | Motor driver module | U3 | QFN-20N (A3906 | 1 |
| CH340G | USB to serial | U4 | SO-16S (CH340G | 1 |
| AMS1117-3.3 | Core | U5 | SOT-223 (three-terminal voltage regulator | 1 |
| AMS1117-5 | Core | U6 | SOT-223 (three-terminal voltage regulator | 1 |
| NRF24L01 | Wireless | U7 | HDR2X4 | 1 |
| LM393D | Dual Differential Comparator | U8 | SO-8 (LM393 | 1 |
| 8MHz | Crystal Oscillator | Y1 | XTAL.18/.42 (SMD No | 1 |
| 12MHz | Crystal Oscillator | Y2 | XTAL.18/.42 (no patch) | 1 |
| 2.4G wireless module | | | | 1 |
| Lithium battery rental | | | | 1 |
| Ultrasonic module | | | | 1 |
| Car chassis | | | | 1 set |
| Nylon cable ties | | | | 5 |

**Note: Material list, I don't know why the preview effect is different from the editing effect, there is a big gap, which will bring inconvenience to reading, and it still doesn't work after adjusting it many times.** **

V. Upload pictures of your works (the PCB must have the competition logo and take a photo to upload. If not, it will be regarded as giving up the competition):**
Logo, logo, logo, important things should be said three times. To make it more eye-catching, I put three logos on the PCB. This is the first time I put logos on a PCB. I checked many tutorials on the Internet and tried many times. Finally, I put them successfully. When the circuit board came back, I was dumbfounded. The logo was small. After putting the logo, I compared it with other labels. It was larger than other labels. I thought there would be no problem with clarity, but in fact..., I will put a few pictures first.
![2158340875831f2df854ed5b9d77ccf.jpg] Close-up 1,
![61684173d347e346479a224d0112783.jpg] Close-up 2 (it's up to you to make up for it),
![logo.png]
**Sixth, demonstrate your work and record it into a video and upload it; (The video content must include: work introduction; function demonstration; performance test; close-up of the competition logo on the PCB. If you do not take a close-up, it will be regarded as giving up the competition)**
Smart car demonstration video:
[http://mvqq.com/play/play.html?vid=v0919avn309&ptag=4\_7.3.5.22238\_copy](http://mvqq.com/play/play.html?vid=v0919avn309&ptag=4_7.3.5.22238_copy)
**VII. Open source documentation. **
See the attached document
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-14 10:04:30

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号