Project Description
This project uses Liangshan School as the main control to realize the 2021 National College Student Electronic Design Competition I topic with power generation function. This project is jointly completed by team leader Lei Chaolin, team members Zhou Yin, and Zhao Xiaolin. The
open source agreement
GPL3.0
project related functions
use the Lichuang Liangshan School development board as the core to realize the 2021 National College Student Electronic Design Competition I topic: Energy storage car with power generation function. The car has a liquid crystal display function and uses a supercapacitor (farad capacitor) as an energy storage element. Manually push the car in the manual power generation area shown in Figure 1, from point A to point B in a unidirectional straight line, repeat this process 5 times, complete a complete charging process, and charge the supercapacitor. After the car is charged, complete the specified actions as required.
Project attributes
This project is open to the public for the first time and is my original project. The project has not won any awards in other competitions.
Project schedule:
May 16th: Confirm the plan;
May 17th: Schematic diagram
; May 23rd: Receive PCB;
May 24th: Welding;
May 24th: Program debugging;
June 3rd: Debugging completed.
Design principle:
1.1: Topic analysis:

1.2: The topic focuses on the utilization efficiency of power generation, how to generate more electricity and use less, so I
use a brushless motor in the power generation part. According to the experiment, the rated power generation voltage of the generator is 10V.
After consulting the data, the charging voltage of the supercapacitor shall not exceed 5% of the rated voltage (the minimum voltage limit of the capacitor: 10.5V).
Therefore, we choose to connect 4 2.7V supercapacitors in series to form a 10.8V supercapacitor as the energy storage element of this design.
Since the operating voltage of the single-chip control system is 5V, the supercapacitor output selects a high-efficiency DC-DC buck module to step down the single-chip and walking motor.
The drive part is designed with a brushless reduction motor with a rated power of 1W and a rated speed of 100RPM.
1.3 This design divides power generation and drive into two parts, each with independent functions. In this way, the utilization efficiency of our power supply is very high, and we can walk a longer distance. The actual walking distance can be ten meters.
1.4 The detection circuit uses a capacitive proximity sensor with lower power consumption at the same accuracy, and an infrared beam tracking module.
At the same time, because some sensors only need to work for a short time during the test, in this project, a circuit system that completely cuts off the power after the detection is completed is designed specifically to avoid the situation where the sensor continues to consume power when it is not working. The above

figure is a framework diagram of the entire system,
which is mainly divided into 6 parts. First, the generator motor generates electricity to the farad capacitor, and then the capacitor boosts and bucks the voltage to the main control, sensor and motor. Why is boost and buck used here? Because when the capacitor voltage is lower than 5V, the boost mode will be automatically turned on to squeeze the capacitor to 1V, so that we can fully utilize the energy. Since the metal detector is more power-consuming,
we use a control transistor to disconnect the power supply during the basic part and start powering the power supply during the performance part.
2.1 Main control circuit


The above picture shows the development board used in this project, which is Liangshan School. You can buy it in LiChuang Mall.
The main control of Liangshan School has a very good advantage. It comes with a DAP downloader. At the same time, the downloader integrates a serial port function, which can download and debug programs more conveniently and locate problems in the program more quickly.
After December 5, 2022, the main control of LiChuang Liangshan School development board was upgraded from GD32F450ZGT6 to GD32F470ZGT6. The two chips are compatible. The main difference is that the main frequency of GD32F450ZGT6 is 200, SDRAM 256K, and the main frequency of GD32F470ZGT6 is 240, SDRAM 512K.
2.2 Farad capacitor group circuit

The above picture shows the car farad capacitor circuit, which is 4 capacitors in series, with an indicator light at the motor end, which is the first requirement of the basic part. When the motor generates electricity, the indicator light will light up. The role of the diode is unidirectional conduction to prevent the generated electricity from being put back. The maximum current of SS54 is 5A and the withstand voltage is 40V, which fully meets the parameters of our discharge motor. The 100nf capacitor is a decoupling capacitor. When the brushed motor generates electricity, high-frequency noise will be injected into the entire system, so connecting 100nf can reduce the noise.

The above picture shows the energy storage capacitor of the car. The above picture

shows the generator motor of the car.
2.3 Motor drive circuit

The above picture shows the motor drive circuit, which uses NPN plus PNP drive circuit. Because the question only requires our motor to move forward, our motor only needs to rotate in one direction. The role of the diode is to continue the current, because when the motor stops rotating, there will be a reverse electromotive force to prevent the microcontroller from burning. When the MOTO foot is high, Q7 is turned on, Q6 is turned on, and the motor runs. When MOTO is low, Q7 is turned off, Q6 is turned off, and the motor stops running.

The above picture shows the motor for walking, which has extremely low power consumption.
2.4 Metal sensor interface circuit

The above picture shows the metal sensor. When metal is detected, Q4 is turned on and the level of JC1 is 3.3V. When there is no metal, Q4 is turned off and JC1 is at a low level. POWER2 is the power supply for controlling the sensor to prevent power waste in the basic part.

The above picture shows the metal sensor used in the car, which is powered by 5V.
2.5 Power supply circuit

The above picture shows the power supply circuit, which consists of an MT3608 boost chip and an MT2492 buck chip. The function of the output diode is to prevent perfusion. When the input voltage is higher than 5V, the buck circuit works and outputs 5V power to the microcontroller. When the voltage is lower than 5V, MT3608 works and boosts to 5V to the entire system. The efficiency of these two chips is above 95%, which is very power-saving and suitable for our power generation car project. We must check whether the voltage output by the auxiliary power supply is normal before inserting the Liangshan faction, otherwise the microcontroller may be burned. There is a fuse on the Liangshan faction, and the protection work is still in place.
The measured standby power consumption of the whole system is 5V 25mA. During the basic part, the power consumption is 5V 87mA, and the power consumption is 5V 124mA. The maximum power generation voltage is 9V and the current is about 0.5A.
2.6 External circuit The

figure above shows the external circuit, which is connected to the tracking sensor and the OLED display.
The tracking sensor outputs a high level when it senses the black line and a low level when it senses the white background. The sensitivity must be adjusted before use. The Q1 transistor is responsible for turning on the tracking. Since the first question does not need tracking, it does not need to be turned on to save power.
Software description
The program has been uploaded. The program part is relatively simple, which is a simple tracking, but it has been optimized for a long time.

The above is the main tracking program in the program. It has high requirements for the power supply voltage. Under different voltages, it is necessary to adjust the speed range by itself. The program is displayed

in the mian function. The figure above shows the overall structure of the power generation car. The upper part is the power generation motor and the lower part is the travel motor. Due to the height of the PCB and the overall height of the car, the tracking cannot be designed on the PCB (too high to be sensed), so we use a small tracking module, which is cheap and easy to replace. The picture above is the Liangshan School main control. Please be aware of the direction when inserting. The picture above is the generator motor, which has strong power generation capacity. Push hard when pushing.




The above picture shows the overall structure of the power generation vehicle. It uses aviation aluminum plates to facilitate drilling. At the same time, the wiring harness is laid underneath and has been insulated to a certain extent.
Design precautions
Everyone must be careful about capacitor discharge. Due to the large current, tweezers can burn red. Be sure to pay attention to safety during the discharge process!
Other
demonstration videos: You can upload attachments for the demonstration video. The maximum attachment can only be a 50M file. Files larger than 50M can be placed on other network disks or video websites. Just put the address link here.
Project attachments: Works participating in the event must upload project-related program attachments to the open source platform or personal code storage cloud. The maximum attachment supports 50M upload (please do not upload in the LiChuang workspace, there are restrictions)