iOdkS

[LCSC Development Board] Smart Car (LCSC 2023 Winter Camp)

 
Overview
The target
design is an intelligent car based on the Liangshanpai development board.

Functions include: basic movement (forward, backward, and steering), infrared tracking, ultrasonic obstacle avoidance, Bluetooth remote control, battery detection, and low battery warning.
Technical Stack:
Hardware fundamentals (circuit design, PCB, soldering),
programming skills (C, software fundamentals and software debugging),
information retrieval,
problem-solving skills,



schematic design instructions
, pin assignment



, connection labels,
pin
descriptions.




Motor




LF+
PB4
Left front wheel +


LF-
PA7
Left front wheel -


RF+
PA3
Right front wheel +


RF-
PA2
Right front wheel -


LB+
PB0 Left
rear wheel +


LB-
PB1 Left rear wheel
-


RB+
PA0 Right rear
wheel +


RB-
PA1 Right rear wheel - Tracking XJ01 PA15 Tracking 01 XJ02 PC10 Tracking 02 XJ03 PC12 Tracking 03 XJ04 PB13 Tracking 04 XJ05 PB15 Tracking 05 Button KEY_M PB5 Sport mode switch button KEY_S PE5 Start sport button LED LED_L PA12 Left headlight LED_R PG7 Right headlight LED_M PB3 KEY_M Indicator LED_S PE2 KEY_S Indicator Bluetooth STATE PF9 Status pin TXD PF7 microcontroller's serial transmit pin RXD; PF6 microcontroller's serial receive pin EN; PF10 enable pin; PB12 ultrasonic module TRIG pin; PB10 ultrasonic module TRIG pin ECHO pin; PB10 ultrasonic module ECHO pin; Buzzer BUZZER; PF8 buzzer ; ADC ; PC5 ADC voltage detection power supply. Power requirements analysis: Liangshanpai development board: 3.3V or compatible 5V (3.3V output available) ; Tracking circuit: 5V; Ultrasonic module: 5V; Buzzer: 5V; Bluetooth module: 3.3V; Motor driver: RZ7899 chip, not exceeding 25V. Power supply design: Uses 14500 lithium batteries (two in series, 7.4V). Then, through a Schottky diode and a toggle switch, it is connected to a linear regulator (LDO), which outputs a stable 5V DC voltage. The motor driver is powered directly from the lithium battery VCC, approximately 7.4V. Bluetooth power comes from the Liangshanpai development board, 3V. Other components are powered from the LDO, 5V. Component Functions and Connections: Schottky Diode: Prevents reverse battery connection; SS34 is selected. Positive terminal connects to the lithium battery, negative terminal connects to the toggle switch. Toggle Switch: Controls power supply on/off. LDO: Reduces battery voltage to a stable 5V to power other components in the circuit that require 5V input. Input connects to VCC, output connects to two capacitors for filtering to prevent interference. LED: Indicates power supply on/off. Positive terminal connects to VCC, negative terminal connects to GND through a current-limiting resistor. In this example, the LEDs include two parts: status indicator and lighting. Status display LEDs will be described in the corresponding modules; here we only focus on the lighting LEDs. Lighting: LED_L and LED_R for vehicle lighting. Component Connections: Status display LEDs will be described in the corresponding modules; here we only focus on the lighting LEDs. Buttons : Primarily used for status switching. Component Functions and Connections: KEY_M: Mode button. One end connects to the GPIO input pin, the other end is grounded. KEY_S: Start button. One end connects to the GPIO input pin, the other end is grounded. [Note]: When the button is pressed, the GPIO port is at a low level. Therefore, the GPIO needs to be configured as a pull-up input mode to detect the low level. Alternatively, a pull-up resistor can be added to pull the IO level high, thus eliminating the need for pull-up input configuration. For motor driving , since the microcontroller's IO current is very weak and cannot drive the motor rotation properly, a motor driver chip must be used. The RZ7899 motor driver chip is selected here.















































































































































































The RZ7899 is a DC bidirectional motor drive circuit suitable for automatic valve motor drives, electromagnetic door lock drives, etc. This circuit features good anti-interference capabilities, minimal standby current, and low output resistance. It also has a built-in diode to release reverse inrush current from inductive loads.
Two logic input terminals, BI and FI, control the motor's forward, reverse, and braking. By connecting BI and FI to the microcontroller's I/O ports and changing the microcontroller's I/O port level, the output pin level of the chip's control terminal can be changed, allowing for forward/reverse rotation, stopping, and braking control of the motor. Connecting the BI and FI pins to the microcontroller's timer channel pins allows for the use of the microcontroller's timer PWM output function to control the motor speed, thereby changing the speed of the intelligent vehicle.
Features of the RZ7899 chip:

minimal standby current (less than 2uA); wide operating voltage range (3.0V~25V);
emergency stop function; overheat protection;
overcurrent and short-circuit protection; SOP8 package.


Truth table for the driver chip:
Component connection instructions:

BI: Back input. Connect to the timer channel pin of the microcontroller.
FI: Forward input. Connect to the timer channel pin of the microcontroller.
BO: Back output. Connect to the motor pin.
FI: Forward output. Connect to the motor pin.
GND: Ground.
VCC: 7.4V. Before using the

ADC voltage acquisition circuit
, it is necessary to know the ADC's bit depth (i.e., accuracy). According to the user manual, the GD32's ADC is 12-bit, so the accuracy is 2^(12) - 1 = 4095, and the accuracy range is 0~4095. Since the I
/
O port is only compatible with a maximum of 5V, exceeding 5V will burn out the I/O port. The battery's operating voltage is 7.4V (maximum 8.4V, minimum 6.6V), which exceeds the I/O port's maximum compatible voltage. Therefore, a voltage divider circuit is needed. The voltage after voltage division should not exceed the I/O port's maximum compatible voltage.
So, how do we calculate the actual value of the acquired voltage from the ADC value?

Linear mapping. Calculation process: Premise: Assume the ADC is 12-bit, the battery power supply is a maximum of 8.4V and a minimum of 6.6V (below which an alarm will be triggered to remind charging);
-------Calculate the ADC value knowing the voltage-------
(1) The voltage ratio of the ADC terminal: 10K/(10K+10K+10k)≈0.3333;
(2) When the battery power is at its highest, the voltage obtained by the voltage divider at the ADC terminal is: 0.3333*8.4V≈2.7997V
When the battery power is at its lowest, the voltage obtained by the voltage divider at the ADC terminal is: 0.3333*6.6V≈2.1998V
If we refer to 3V, that is, 3V when fully charged and 0V when
depleted, the ADC value when the battery power is at its highest is: (2.7997/3V)*4095=3821
The ADC value when the battery power is at its lowest is: (2.1998/3V)*4095=3002
-------Calculating Voltage from ADC Value-------
If we refer to 3V, that is, 3V when fully charged and 0V when de-charged;
through the inverse operation of the above formula, we know that the voltage value corresponding to any ADC value is: V_value=(ADC*3)/4095 Unit: V


Buzzer
The buzzer uses an active buzzer with a built-in oscillation source, which will sound as long as it is powered on. However, because the pin driving capability of the microcontroller is weak, it cannot directly drive the buzzer. Therefore, a PNP transistor is used as an electronic control switch, and the buzzer's on/off state is controlled by the output voltage of the microcontroller's I/O.

When the I/O output is high, the voltage at the emitter is not much greater than the base voltage, the transistor is not conducting, and it is in the cutoff state, so the buzzer does not sound. When the
I/O output is low, the voltage at the emitter is much greater than the base voltage, the transistor conducts, current flows from the emitter to the collector, and the buzzer sounds.

Component Function and Connection Instructions:

Buzzer: The positive terminal is connected to the collector of the transistor, and the negative terminal is connected to GND.
1k resistor: Current-limiting resistor to prevent excessive current from entering the GPIO.
10k resistor: Interference protection resistor. Connected between the emitter and base.
PNP transistor: Emitter connected to +5V, base connected to the GPIO pin via the current-limiting resistor, collector connected to the positive terminal of the buzzer. For

Bluetooth
, directly select a Bluetooth module. When selecting, pay attention to the VCC value (5V OR 3.3V) and ensure proper power supply matching.
Also, when connecting the microcontroller pins, pay attention to the serial port pin connections: Bluetooth RXD --- Microcontroller TXD, Bluetooth TXD --- Microcontroller RXD.
Use a 1*6 2.45mm header to draw the schematic. For
ultrasonic testing
, select an HC-SR04 ultrasonic module.
Ensure the receive and transmit pin connections are correct. Use a 1*4 2.45mm header to draw the schematic.
The tracking
circuit design utilizes the principle that infrared light reflects differently when encountering different colored ground surfaces. The tracking circuit uses the ITR9909 infrared photoelectric switch, which integrates an infrared emitter and receiver. A five-channel tracking circuit is used, with sensitivity adjustable for each channel via a variable resistor. An LM393 voltage comparator chip is used; since one comparator chip supports two channels, only three comparator chips are needed.

The principle for detecting black lines is that the infrared emitter emits light to the ground; when the infrared light encounters a white surface, it is reflected, and the infrared receiver receives the reflected light. After passing through the voltage comparator, the output is low.
The principle for detecting black lines is that the infrared emitter emits light to the ground; when the infrared light encounters a black surface, it is absorbed, and the infrared receiver does not receive the reflected light. After passing through the voltage comparator, the output is high.

The comparator's output pin is connected to the microcontroller's GPIO, and the GPIO is set to input mode.
The schematic
diagram is organized, separating different modules with boxes and providing explanations.
The PCB layout and wiring are shown in
the Bluetooth APP
demonstration.
program.rar
PDF_【LCSC Development Board】Smart Car (LCSC 2023 Winter Camp).zip
Altium_【LCSC Development Board】Smart Car (LCSC 2023 Winter Camp).zip
PADS_【LCSC Development Board】Smart Car (LCSC 2023 Winter Camp).zip
BOM_【LCSC Development Board】Smart Car (LCSC 2023 Winter Camp).xlsx
96252
Variable gain amplifier (basic version)
The LTC1966 was used for detection, and the AD603 was used for amplification.
For details, please see CSDN: http://t.csdnimg.cn/0TDkd
and Zhihu: "Programmable Variable Gain Amplifier (Basic Version)" - Layout's article - Zhihu https://zhuanlan.zhihu.com/p/679622619
. LCSC's text editor is too difficult to use. Here are some actual test images, or you can watch the video directly.
Manual Mode_1.mp4
Automatic mode.mp4
ADC Data Compilation.xlsx
PDF_Variable Gain Amplifier (Basic Version).zip
Altium_Variable Gain Amplifier (Basic Version).zip
PADS_Variable Gain Amplifier (Basic Version).zip
BOM_Variable Gain Amplifier (Basic Version).xlsx
96253
DIY Mini Speaker
This is my first time building an amplifier, and I'm a complete audio novice. I'd appreciate any guidance from experienced users. I'm using the Texas Instruments TPA3116 Class D digital amplifier chip, and it has three input methods: wired AUX 3.5mm headphone and RCA inputs, and Bluetooth input. It supports 2.0 dual-channel stereo.
To build a low-cost speaker yourself,
we first need to know what materials are needed. For beginners like me, all we need is for the speaker to make a sound.
We need a sound-producing element, which is the speaker,
a power amplifier, and a cabinet.
Power amplifiers are available online, and we can also make one ourselves. This project focuses on building a power amplifier.
 
What are the circuit modules on this amplifier board?
1. First, no matter what board you make, the first thing you need to do is the power module! This supports three power input methods: Type-C input, DC power socket with an inner diameter of 2.5mm, and screw-type terminal blocks/5mm 1x2P.
 
This supports 12V and 5V voltages.
The second is the preamplifier
input module
 
, the most important amplifier chip circuit module.
 
Physical demonstration and
 
 
 
 
notes: The outer casing cannot be used directly and needs modification!
 
d985e42fbcec52ae61095dd1819ad855.mp4
8a801ce6f8a13449d5ae0558fd4b5bd8.mp4
PDF_DIY Mini Speaker.zip
Altium_DIY Mini Speaker.zip
PADS_DIY Mini Speaker.zip
BOM_DIY Mini Speaker.xlsx
96255
SGL8022W Card Light
The card reading light based on the SGL8022W has two versions with touch-controlled LED brightness
: one focusing on aesthetics and the other on practicality.
Only the aesthetic version was ultimately manufactured using a PCB.
Cause: ~~It was my classmate's birthday, and I wanted to make him a gift during LCSC's "Warm Winter Creations for the New Year" event. LCSC happened to be holding a "Warm Winter Creations for the New Year" contest, and I happened to have a chip I wanted to make a touch lamp, so I took the opportunity.

Thus, this touch lamp project came about.

Planning:
Main Controller: Since it's a touch lamp, it definitely needs to support touch. After researching online, I decided to use the SGL8022W as the main controller, which directly supports touch. (SGL8022W chip manual: https://item.szlcsc.com/82803.html)

Power Supply: The first version decided to use a TP4056 (chip manual: https://item.szlcsc.com/772193.html) + 18650 for power supply, plus a USB 6PIN for charging the 18650 and powering the lamp. The second version uses a CR2032 power supply plus a USB 6PIN power supply scheme. The first version used a Schottky diode circuit for automatic power switching, but the second version, due to laziness, simply changed it to manual power switching (dog head).

Voltage regulation: An AMS1117-3.3 (chip datasheet: https://item.szlcsc.com/20102431.html) was used for the 3.3V input voltage regulation scheme.



Schematic Diagram Section:
1. SGL8022W: Directly referenced the typical circuit provided in the chip datasheet, but considering that the control scheme does not need to be modified later, OT1 and OT2 were fixed as having no brightness memory and a gradual brightening/dimming mode
![image.png] 2. First version of TP4056: Referencing the typical circuit provided in the chip datasheet and the circuit design in https://blog.csdn.net/eletronicfish/article/details/131671126 (thanks to the author for the open source)
![TP4056 circuit.png] 3. Second version of CR2032: A total of 4 cells were used, with two cells connected in series and two connected in parallel
![battery.png]
4. AMS1117-3.3: Referencing the typical circuit provided in the chip datasheet and a tiny bit of memory (dog head)
![AMS1117-3.3.png]
5. USB Input: USB_TYPE_C_6PIN
![USB.png]
6. LED Section: Eight white LEDs connected in parallel
![LED.png] 7. Manual Power Supply Selection: A mechanical selection mechanism was used
![Power Supply Selection.png] 8. Automatic Power Supply Selection: The circuit design in https://blog.csdn.net/eletronicfish/article/details/131671126 was referenced
![Power Supply Selection 2.png]
PCB Design
Component Packages: Most components were packaged in 0805 for easy hand soldering (dog head).

First version: Four-layer board. Signal traces were placed on the top and bottom layers. Inner layer 1 was VCC, and inner layer 2 was GND. Major components were placed on the top layer, such as the circuitry surrounding the TP4056 and the SGL8022W. The bottom layer contained eight LEDs and touch pads.
Touch Pads:
![Touch Pads.png]
Second version: After learning that color silkscreen printing only supported two-layer boards, the design was redrawn. Except for a few places where thin lines were used, the line width was generally 30mil. A picture of Li Xingyun was added to the top layer (he's really handsome...)
![Top layer silkscreen.png] A picture of Zhang Tian Anxing and Happy New Year was added to the bottom layer (~~to pass censorship~~)
![Bottom layer silkscreen.png]
3D shell:
First version: Too basic, too lazy to explain.
Second version: First, generate the shell frame using the board outline, then adjust the specific values:
![3D values.png] (depending on the situation)
Next, cut grooves on the side according to the PCB:
![3D groove.png] To allow light to pass through the bottom, cut grooves at the bottom
![Bottom groove.png] To fix the PCB, add screw posts
![Bottom groove.png] The shell is done (dog head)

SGL8022W characteristics
![SGL8022W.png]
Soldering:
Solder small components first, then large components. Be careful not to brittle the USB. The LED in the practical version is drawn backwards, too lazy to correct it. Remember to reverse it when you solder it yourself.

Video address:
https://www.bilibili.com/video/BV1g64y1w7y1/
PDF_SGL8022W Card Light.zip
Altium_SGL8022W Card Light.zip
PADS_SGL8022W Card Light.zip
BOM_SGL8022W Card Light.xlsx
96256
LM2596S voltage regulator
The LM2596S is a commonly used step-down voltage regulator chip widely used in electronic devices. It is a step-down regulator with switching function that can stably convert an input voltage (usually a higher DC voltage) to a lower output voltage.


Input Filter Capacitor: Connect the input power supply to the VIN pin of the LM2596S chip. To reduce noise and fluctuations in the input power supply, a suitable electrolytic capacitor is typically connected in parallel between the input power line and VIN. This capacitor is generally selected with a value of tens to hundreds of microfarads (µF).


Output Filter Capacitor: Connect the load requiring voltage regulation to the VOUT pin of the LM2596S chip. To reduce output voltage ripple and provide a stable power supply, a suitable capacitor needs to be connected in parallel at the output. The capacitance value is determined according to specific application requirements, with common values ​​ranging from tens to hundreds of microfarads (µF).


Output Inductor: To improve conversion efficiency and reduce output ripple, a suitable inductor can be connected in series between the VOUT pin of the LM2596S chip and the output filter capacitor. The inductor value is generally between tens and hundreds of microhenries (µH).


Control Switch: The LM2596S chip has an internal switch used to control the switching time of the input voltage, realizing the buck regulation function. A suitable inductor is connected to the SW pin of the chip to control the conduction and shutdown of the switching transistor.

PDF_lm2596s voltage regulator.zip
Altium_lm2596s voltage regulator.zip
PADS_lm2596s voltage regulator.zip
BOM_lm2596s voltage regulator.xlsx
96261
electronic
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-26 15:32:14

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号