Use a 10cm USB cable to connect to the device and get an extendable USB ammeter. Use
analog IIC to control the OLED screen
* 1. Project function introduction
USB ammeter
* 2. Project attributes
are not original and have not participated in the competition
* 3. Open source agreement
GPL3.0
* 4. Physical verification diagram

* 5. Software part
1. Main control
N32G430C8L7 microcontroller product uses a high-performance 32-bit ARM Cortex™-M4F core, integrated floating-point unit (FPU) and digital signal processing (DSP), and supports parallel computing instructions. The highest operating frequency is 128MHz, integrated up to 64KB on-chip encrypted storage Flash, and supports multi-user partition authority management, and supports 16KB embedded SRAM. It has an internal high-speed AHB bus, two low-speed peripheral clock buses APB and bus matrix, supports 40 reusable I/Os, provides a rich set of high-performance analog interfaces, including a 12-bit 4.7Msps ADC, supports 16 external input channels and 3 internal channels, and provides a variety of digital communication interfaces, including 4 U(S)ARTs, 2 I2Cs, 2 SPI/I2Ss, and 1 CAN 2.0B communication interface. The N32G430C8L7 microcontroller product can work stably in the temperature range of -40°C to +105°C, with a supply voltage of 2.4V to 3.6V, and provides a variety of power consumption modes.
Not many resources are used in this case, and the internal clock has been open sourced to meet the design requirements, so there is no need for an external clock circuit. It should be noted that each power pin of the chip needs to be connected to an additional 100nF external filter capacitor, and the 1st pin of the chip needs to be connected to an additional 4.7uf filter capacitor.
2. The voltage conversion
uses the AMS1117 voltage regulator chip with a maximum output of 18V to 3.3V, and a maximum output of 1A, which is sufficient for the microcontroller. The circuit connection is relatively simple, which is suitable for the needs of this design.
3. Current sampling
The current sampling part is the INA199B1DCKR current sensing amplifier (also called a current sensing amplifier), which is often used for overcurrent protection, precision current measurement for system optimization, or closed-loop feedback circuits. This series of devices can sense the voltage drop across the shunt resistor at a common-mode voltage of -0.3V to 26V independent of the power supply voltage.
*6.
The software part of the BOM list is mainly ADC sampling and analog IIC driving OLED