1. Project function introduction:
USB power meter, 1% accuracy, 0.96-inch OLED display (official 0.91-inch), can view current, voltage, power, chip temperature, does not support fast charging version, maximum measurement 6V, 2.8A.
2. Hardware
schematic drawing:
AMS1117-3.3V is used for power supply, and the circuit provided by the chip data sheet can be viewed in the external circuit.
Main control circuit: Refer to the "N32G430C8L7-STB Data Sheet" of LiChuang Mall to draw the external circuit, mainly including the chip's input power supply filtering, external crystal oscillator 8MHZ, reset, BOOT0, download and debug interface circuit, etc.
Voltage sampling: Use the voltage division principle for AD sampling. It should be noted that the sampling resistor here needs high precision.
Current sampling: Use INA199A1DCKR, voltage output, current shunt monitor (also known as current sensing amplifier) is often used for overcurrent protection, precision current measurement for system optimization or closed-loop feedback circuit, and the gain used here is 50V/V.
PCB drawing:
layout first and then routing; the power line should be thicker, and the filter capacitor should be close to the principle; the crystal oscillator clock circuit should not be layered with the chip and should be close to the corresponding pins, and the line length should be the same (differential equal length wiring); the USB female socket should be slotted and the tail should be exposed a little, and the male card slot should have space, which can be checked by viewing the 3D perspective, and the line can be checked by filtering. If there is no problem, teardrop copper is laid on the board.
Welding part:
Equipment: Deer Fairy LED desoldering station in a certain treasure, Anlixin solder paste (syringe), solder oil, tin wire, desoldering device, tweezers, yellow flower soldering iron (knife head), high temperature resistant tape
Suggestion: For patch welding, first apply a little solder paste syringe on each solder point (prefer less to more), then put resistors, capacitors, chips (from small to large),
assemble the desoldering station, power on (pay attention to ventilation, whether the wires are short-circuited, do it in an open place, and don't let the wire touch the heating table),
and then you can enjoy the beautiful scenery of the solidified solder paste! Don't heat it for too long! ! Finally, check whether there is any tin connection or cold soldering. If so, use soldering oil and soldering iron tip to repair it.
(Pay special attention when soldering. You can solder according to the PCB diagram and the schematic diagram one by one. Use shift+X, or you can solder by displaying the component values. Solder carefully.
Most problems are welding problems. You can use the multimeter buzzer, voltage, and resistance to check whether there are any problems with the welding. Check the chip pins carefully)
3. Software part (Note: This program does not require soldering of the crystal oscillator, but uses an internal clock)
Use the official program code to add an internal temperature sensor (see the attachment for the code)
Screen code modification:



ADC collects voltage and current part:



Internal temperature sensor:
By consulting the manual




, you can use ST-Link, serial port, etc., please refer to the other burning methods provided in the attachment for details
4. Competition LOGO verification


The above information is compiled from the 2022 Jialichuang EDA and National Technology Summer Training Camp
5. Demonstrate your project and record it as a video and upload it