sigma

#The 7th Lichuang Electric Competition# Expandable USB current meter

 
Overview
1. Introduction to project functions
The current sampling can detect and display the current passing through the meter, the voltage at both ends of the power supply, and the power in real time. It supports general 5V charging. After plugging in the expansion module, it can support high-voltage fast charging.
2. Project attributes
This is my first attempt at open source design, and it is also my first time to do something really practical. Referring to the official schematic diagram, the sampling circuit is mainly retained. The core board circuit refers to the national technology hardware evaluation version. For cost considerations, the high voltage support is expanded into a detachable module, which reduces the cost of the ammeter itself. The project must have shortcomings and areas worth improving. If I have time, I will try my best to improve it.
3. The open source agreement
uses the GPL3.0 open source agreement
. 4. The hardware part
is designed using the professional version of EasyEDA.
1. Current sampling: The current measurement relies on the sampling resistor to convert the current signal into a voltage signal (Ohm's law). Since the voltage is relatively small, an amplifier circuit is used to amplify the voltage. ASM1117 is used here, and then the PA1 of N32 is used. ADC measures the voltage value and calculates the corresponding current.
2. Voltage sampling: Since the maximum sampling voltage of the microcontroller ADC is 3.3V, and the USB output is at least 5V, a resistor divider must be used. Here (91k
and 10k resistors are used to construct a 110 voltage divider, and then PA2 is used to sample the value.
3. Power supply circuit: For cost considerations, the ammeter body disconnects the USB data line , so that the charger can only output 5V voltage, so that the main body can use LDO voltage reduction, which is low-cost and sufficient for 5V to 3.3V reduction;
if you need to test the fast charging mode, the LDO power supply mode has too much power loss and too much thermal power, so the main body has introduced six sockets for power module expansion sockets to expand the power supply mode. Plug in the power expansion module, the module can change the MOS tube gate level, turn off the MOS tube to shield the LDO circuit and use the BUCK voltage reduction circuit in the module to power the main body,
and at the same time connect the two differential data lines of the USB to realize the communication between the charger and the power-consuming device, thereby triggering fast charging.
4. Display circuit: Use PB13 and PB14 to simulate IIC communication to establish a connection with the 0.91-inch oled, and directly insert the module into the socket.
5. Download circuit: In order to save interfaces, use serial port download, two data cables of the common female socket, download, just need to connect the four wires of USB to serial port to a male connector, and then insert the female socket to connect to the computer to download.
5. The software part
is mainly based on the official program to modify the program of simulating IIC interface.
6. BOM list
7. Competition LOGO verification
 
 8. Demonstrate your project and record it into a video and upload it
 
[Self-made USB ammeter based on N32-Bilibili] https://b23.tv/KSzh46D
 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-12 21:50:57
  • Infrared temperature sensor
  • printf print error
  • Several comparisons: Analysis of the differences between 4G and 5G
  • Verilog small question ask
  • NEC microcontroller related information collection
  • Steps to port μC/OS-Ⅱ to MSP430F149

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号