newlandmark

【LiChuang Development Board】WeChat applet controls the smart car

 
Overview

1. Project Introduction
      This time, the main purpose is to learn some smart car control. Secondly, because it is the first time to make a smart car, and considering cost saving, the shape is relatively rigid, because the purpose of this design is to learn better!
     The highlight of this design should be the WeChat applet control. After all, WeChat, everyone has it. It is basically impossible for a smart phone not to install WeChat, right! Therefore, the versatility is very high, and there is no trouble of bringing a separate remote control. If you are interested, you can also scan the applet code to enter, but everyone’s device is not adapted, so there is no way to connect. If you want to use it, you can also burn my firmware and use the Bluetooth module I bought (or report the Bluetooth UUID to me and add it to the applet).
 
    
2. Introduction to the applet control part
      Let’s start with the introduction of the applet part! After scanning the code to enter the mini program, click "Search Device" to scan nearby Bluetooth devices. When supported devices appear, they will be displayed at the top, that is, in the list of manageable devices. At this time, we click WeChatCar to get the device of our smart car.
 
After clicking to enter the smart car control interface, you can see the device's obstacle ranging distance, battery voltage, working current information, as well as Bluetooth connection status, control mode switching and other functions.
Here are the control modes:
    1. Touch mode: Control the direction and speed of the car by moving gestures on the wheel. It is relatively simple and easy to use.
    2. Tap mode: Tap the corresponding direction to control the movement of the car, and click Stop to stop the car.
 
    Another thing is the speed setting, including driving speed and turning speed. Note that the speed here refers to the PWM duty cycle, from 10 to 100, because if it is too low, the motor cannot rotate. The following is the setting interface of tracking control and car parameters.
The tracking part is relatively simple, with only start and stop. It seems that the rest is mainly automatically controlled by the program.
 
 
3. Hardware selection
    The main hardware is: Liteon development board, Bluetooth, motor, ultrasonic ranging module. There is nothing much to say about the Liteon development board, as everyone who does this project is using it. Let me briefly talk about the others.
    1. Bluetooth module:
        The Bluetooth module used is from Jixinwei, model: G75-C2G4A12S3a, the price is very cheap, the price when I bought it was: 3.85 yuan, AT firmware, the configuration is relatively simple, you can use the command to open the transparent transmission mode, the configuration is very simple, that is, AT firmware, all the data are string type data, so binary data is not OK, because it is truncated when it encounters 0x00, and the subsequent data is no longer sent or received. This needs attention, because of this, the communication protocol prepared at the beginning is changed into a mess.
 
    2. Motor:
         The motor is a second-hand N20 D-axis motor, the price is very cheap, more than one yuan, there are a lot of them on the Internet, just search and you will find them. Because it is a second-hand motor, the reduction ratio is not consistent, there is no way, and a motor speed correction function is added later, otherwise the bias is too serious.
         In fact, there are also advantages to choosing bad things, that is, more abnormal situations will be considered, such as inconsistent speed, which occurs even in the same batch of motors, but it is not very obvious. Including cars are the same, otherwise there is no need to do dynamic balancing. Haha! However, you should try to choose a good one, otherwise it will be troublesome.
 
     3. Ultrasonic ranging module:
          The model is HC-SR04. This module is very easy to use and the measurement is relatively accurate, but I have had some small accidents here, because this module has been bought for a long time. It was relatively normal when it was debugged at the beginning, but then I don’t know why the distance measurement suddenly did not change. I don’t know how it broke. It just so happened that I saw some things at Lao Wang’s house, and I bought his ranging module RCW-0002. This module is strange. It seems to be the same as HC-SR04 when searching for information online, but the measured distance is almost half less, and it also jumps randomly. This is the reason for the inaccurate distance measurement in the video. It is estimated to be a defective product, but the whole project has reached the end of processing, and it will take a few days to buy one, so I will make do with the measurement first. At present, it is still relatively prepared when the distance is close. At least there is no big problem in automatic obstacle avoidance, don’t you think?
 
4. Schematic diagram
     Here I will only take out a few main parts to talk about briefly. If you don’t understand the others, you can discuss with each other.
 
    1. Motor control:
         The motor control chip uses L9110.
The working voltage of L9110 is 2.7-12V (some can reach 15V), which is suitable for low-voltage working occasions. The driving current can reach 0.8A, the price is not high, SOP8 package, and the volume is not large, which is enough for this project. The four-way motor uses four chips to drive. The driving method is relatively simple. IA IB inputs high and low levels respectively, and the output terminals OA OB also output corresponding levels, so that forward and reverse rotation can be achieved. Through the single-chip microcomputer output PWM, the speed regulation can be achieved by adjusting the duty cycle.
 
2. Tracking circuit:
      As you can see here, I only use three tracking channels. The number of tracking channels is reduced, and the range of tracking is naturally narrowed. There will be some impact, but you can see in the video that it is still relatively stable, but the speed cannot be too fast, and the black line will often not be found when the corner is large. Interrupts are used in the program to check the line change problem, so the tracking effect can be optimized in the program.
      With the purpose of experimentation, the circuit was simplified and some optimizations were made in the program as much as possible.
      As for the principle of infrared tracking, you can watch the video of the car on the B station of EasyEDA. It is explained in detail, so I will not repeat it here, and I am afraid that I will not be able to explain it clearly.
 
3. Bluetooth circuit:
      The Bluetooth module uses G75-C2G4A12S3a from Jixinwei. This can be said to be the simplest circuit. Because the module is used and it is AT firmware, only TX RX is required. I will also put the AT command document of this module in the attachment.
 
 

4. Physical display and
 
 
 
demonstration video
 
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-23 13:01:50
  • Please advise on the SOT-89 package schematic symbol and PCB package drawing method
  • TMS470 interrupt problem
  • I can't figure out why the STC microcontroller
  • Use the radiotool function of CC3200
  • Overview of Metal-Oxide-Semiconductor Field-Effect Transistors
  • A great resignation letter from an IT professional

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号