aytwartoofyoroo

USB voltage and ammeter with PD/QC deception, monitoring and Emarker reading

 
Overview

Change log


First published on 2022-7-14

2022-7-16 Released the original PCB files of Lichuang EDA, corrected some document errors, and modified the K value labeling error of the thermistor in the BOM.

2022-8-12 1. Upload firmware and update software tutorial

                  2. The PCB is slightly modified, and pads are added to the screw holes to increase the ground reflow area.

                  3. Improve the welding tutorial and fix some document errors

                  4.BOM modification

                   (1) Add purchase links for studs and screws and unify them into a new solution to reduce thickness and cost.

                   (2) Replace the button purchase link to reduce costs

                   (3) Change the power supply filter capacitor to a smaller one to reduce costs.

                   (4) Replace the high-precision 10K resistor with an ordinary 10K resistor to reduce costs.

                   (5) Add Taobao cheap screen purchase link to reduce costs

                   (6) Change the screen current limiting resistor to 15R to reduce the maximum backlight brightness and improve backlight light leakage

2022-8-16 Solved the problem of high minimum operating voltage, please see the hardware and welding tutorial for details

2022-8-31 Updated welding IBOM, firmware updated to 1.1.5, please see the announcement in the group for update log details

                   

 

Features


USB power meter based on ESP32-PICO-D4, the display uses a 0.96TFT color screen, the voltage and current sampling part uses the INA226/INA231 solution, PD monitoring and deception uses the FUSB302PD physical layer chip, QC monitoring and deception uses the ADC and DAC of ESP32, in theory It also supports other A-port protocols, but there is no other A-port communication device on hand to collect the communication process of the protocol.

Basic functions of this watch:

1. Basic bidirectional voltage and current monitoring, simple self-consumption zero calibration, real-time monitoring of D+ D- voltage, real-time charging protocol (only supports PDQCDCP for now).

2. Voltage deception: full voltage deception of QCQC3, FIXPPS deception of PD3.0.

3. Software coulomb meter can calculate the amount of electricity charged. The charging voltage, current and actual load time can be calculated.

4. A variety of data records, which can monitor the board temperature, the maximum and minimum voltage, current, and power values ​​during the charging process, and the average voltage, current, and power values.

5. With offline data recording, you can choose whether to inherit the last data and continue recording to prevent accidental power outage data loss. At the same time, it can also record and display 5 groups of recently recorded data. The recorded content is the average value of voltage, current, power, and load. Time, charging mAh and mWh.

6. This watch has almost complete PD logic packet capture function and common PD data packet analysis function. It can monitor the PDO of the charger, display the currently applied RDO in real time, record and display every data packet in the communication process, and Parse common data packets.

 

Firmware update, rollover communication group: 788013120

This watch requires registration and activation. Individual DIY users can join a group to obtain a registration code for free.

 

This watch is small in size and difficult to make! ! ! Please do what you can! ! !

If this is your first time or you have just started to solder PCBs, we strongly do not recommend you try to make this watch! ! !

 

Unauthorized commercial use of this watch is prohibited!

 

Main interface

Main interface

 

PD deception interface                                                         

PD deception interface

PPS deception interface

PPS deception interface

Emarker reading interface                                                   

Emarker reading interface

PD packet capture analysis

PD message interface

 

 

See the video at the bottom for detailed function demonstration

 

 

 

Hardware and soldering tutorials


The main control adopts ESP32-PICO-D4, with simplified peripherals and smaller board size. It has WIFI and Bluetooth functions for later development of the host computer.

MP2451/MP2456 can be used for DCDC, and INA226 (maximum voltage 36V)/INA231 (maximum voltage 28V) can be used for current monitoring chips.

PD monitoring and deception uses FUSB302 physical layer chip.

A-port monitoring and deception directly use the ADC and DAC of ESP32. Currently, the A-port protocol only supports QC/QC3. In theory, other A-port protocols are also supported, but there are no other A-port communication devices on hand to collect the communication process of the protocol.

The screen uses a 0.96 TFT color screen and is driven by ST7735S.

 

About the minimum operating voltage of the system

We have received feedback that due to the low-voltage and high-current direct charging battery solution used by old Huawei and old OPPO, the minimum charging voltage under low battery is very low (minimum below 4V), resulting in insufficient DCDC voltage for the meter to start. This has been solved. Solved The solution is to connect a diode at the output end of DCDC to the BST end of DCDC. The diode can be 1N5819WS, which is already used in the table, or 1N4148WS, with the cathode of the diode facing BST, as shown in the figure. After connecting this diode, the lowest working voltage MP2451 that has been measured so far is 3.58V (completely normal and can still be reduced, but there is no test equipment), and MP2456 is 3.38V (can work normally, but the output voltage has been reduced to 3V, the screen will become darker and the temperature measurement will be inaccurate). Before the modification, the minimum operating voltage of MP2451 was 4.2V, and that of MP2456 was 3.8~4.1V (depending on the physical condition). This modification has been updated to the PCB. If you have previously built the board and have low voltage requirements, you can add it yourself according to the picture. The distance between the two pads is moderate and it is not difficult to fly the wires.

 

 

Welding precautions:

1. Essential tools:

A relatively easy-to-use small-head ferrule (component spacing is small, and it is difficult to use if the head is too big), LED desoldering board/hot air gun (soldering LGA, QFN), solder wire, solder paste, flux, tweezers, suction Tin tape (to increase fault tolerance), board washing water (to wash buttons and boards)

 

2. Welding and inspection sequence:

      2.1 First solder the ESP32 and the 10k resistor under the ESP32 and the separate button in the upper right corner. Use a multimeter to test the continuity of the screen cable pins on the back to the ground. If there are only three pins connected to the ground, it is normal (there is a bottom of the ESP32 (If the screen signal line is short-circuited on the pad), solder the burning wire ( TTL's RX is connected to the board's TX, and TX is connected to the board's RX ), and test whether there is output from the serial port and whether the program can be programmed ( the program needs to be short-circuited to IO0 to power on) , that is, a separate button in the upper right corner, you can short-circuit it with tweezers or press the button), confirm that the welding is OK and remove the burning wire.

      2.2 Next, solder FUSB302, INA231/226 and two 4.7k resistors. Solder the burning wire and flash the iic test program in the attachment. The program will output the scanned iic address through the serial port. Connect the burning wire and open a serial port software (such as Arduino's serial port monitor) with a baud rate of 115200. , check whether 0x22 and 0x40 can be correctly scanned (if 0x44 is scanned, it is fake 226, complain to the merchant) these two iic addresses.

      2.3 Then weld the MOS and the 10K resistor next to the MOS, decoy the button, weld the burning wire, and burn the USB table firmware ( the burning program needs to short-circuit IO0 to power on) . Test both ends of the two deception buttons with the multimeter on and off . When the recording wire is not connected (that is, when the power is off ), it is equivalent to a diode, with only one conductor conducting. When the recording wire is connected (that is, when the power is on ), it is equivalent to a wire, with bidirectional conduction, and you can continue to the next step.

      2.4 Solder the remaining front components (except the Type C ports at both ends) according to your mood, and be careful not to touch the above-mentioned components that have been soldered.

      2.5 正面焊接完成后,重复上述的所有测试项,确认无误后即可继续焊接剩下的Type c口,背面的检流电阻、天线、屏幕。

      2.6 进行成品测试,测试各功能是否正常。检查屏幕显示内容是否正常,PDQC诱骗能否正常使用。关于PD诱骗:在连接双c线或者公头插入充电器是不亮屏的,需按下下面的PD诱骗按键才可正常亮屏并自动进入PD诱骗界面,且松手不息屏,若松手息屏或直接亮屏,则是未正确进行2.3中的mos检查,mos有连锡或者虚焊,哪边的诱骗按键存在上述问题,则是哪边的mos焊接有问题,需重焊mos

 

3.部分焊接难点的方法

      3.1 ESP32先给芯片本体四周的引脚上锡(中间的大焊盘不要上锡,若不小心上了锡,应该用吸锡带拖平,然后重新给四周的引脚上锡),然后在PCB上,给PCB上一层助焊剂,用镊子给ESP32四周的焊盘涂上适量的锡膏(注意不要涂到中间大焊盘上),然后用镊子尖,只在中间的大焊盘上点上一丁点焊锡膏。然后将芯片按方向准确放在焊盘上,上加热台,待焊锡熔化之后,轻压ESP32,将多余的焊锡挤出,从加热台上取下,用烙铁拖掉多余的焊锡。(这种方法可以极大的避免连锡虚焊,反正我焊了二三十次没失手过)

     3.2 MOS的焊接,可以不用焊锡膏,用烙铁给MOS本体引脚上锡,然后在PCB上刷一层助焊剂,给PCB上的MOS焊盘上锡,将MOS按方向放置在PCB上,放上加热台,熔锡后用镊子轻推MOS,能自动回位即可。

     3.3 INA231的焊接,同样给PCB上助焊剂并用烙铁给PCB上的焊盘上锡,INA231为BGA封装,出厂已自带锡球,可以不用给芯片引脚上锡,按方向放在PCB上,放上加热台,熔锡后用镊子轻推INA231,能自动回位即可,与esp32不同的是,千万不要压INA231,压了必连锡。

 

 

焊接好如下图

Welding component side

screen surface

 

 

打板与组装教程

打板资料与焊接ibom图均在附件中

产品由3块板子组成,主板可选0.8/1.0,上下盖板为1.0,中间由铜柱连接,螺丝固定,屏幕采用1mm泡棉胶固定到板子上。

铜柱采用M2*2与M2*2.5铜柱组合,螺丝采用M2 3mm以下的螺丝(小头薄头最好),整体厚度为7.3~7.5mm.

 

若嘉立创打板显示拆单嫌疑拒绝打板,可以去EDA原文件中重新生成Gerber文件打板。

面板打板审核说铣槽太小容易断板的话,回复接受断板发货不投诉即可。

在EDA原文件中,主板这四处DCR错误可忽略。

6lcQLHpnjzWmQhfuLg3uNLxWgZS45lhybswqFETH.png

 

 

组装零键一览                                                 

Component family portrait

 屏幕固定方式

Screen fixation method

 

软件与烧录教程


 

固件名构成:

开头的字母:TTL则表示为TTL烧录固件,不能进行OTA升级。OTA则表示为OTA升级的固件,不能使用TTL烧录。

中间的数字:软件的版本号,数字大的为新固件

末尾的字母:屏驱动版本,若使用的屏幕为立创商城购买,则选择LCSHOP。若为淘宝购买,则选择TAOBAO

 

 

TTL烧录

1.第一次烧录必须使用TTL烧录器,且只能烧录开头写着TTL的固件,不可使用OTA开头的固件,接线为3V3—3V3 RX—TX TX—RX GND—GND,烧录需要进入flash下载模式,进入方式为在上电时短接IO0到地,本PCB的IO0为右上角单独的那个按键,上电时用镊子短接焊盘,或者焊接一个按键并上电时按下按键均可。(是按住按键上电,不是烧录时按下按键

 

2.将TTL烧录器连接电脑,打开电脑的设备管理器,在端口那一栏里找到TTL烧录器使用的端口,打开附件中的flash_download_tool软件,在弹出的方框中将chiptype选项改为ESP32,点击OK进入,将配置选项改为如下图所示,选择你需要烧录的固件,地址如下面打勾的绿色那行所示,其他行不用管,其中COM选择你的TTL烧录器使用的端口,将ESP32如 1. 所示进入flash下载模式,点击START即可烧录。(每次烧录只能选择一个固件,烧录地址均为0x0000,最前方的勾勾为选择烧录的固件,该行变为绿色即为选中了该固件烧录。)

 

3.烧录完毕后,重新给ESP32上电,使ESP32退出flash下载模式,才能通过串口软件查看串口输出是否正常。

 

 

 

OTA升级

1.OTA的前提是已经通过TTL烧写了表的固件OTA升级只能选择OTA开头的固件,不能选择TTL开头的固件。OTA升级方式为网页,无需其他软件。

 

2.进入OTA升级的方式为按住+键上电,即面向屏幕最右边的按键。第一次上电会自动创建AP热点,并在屏幕上显示AP热点已创建字样,用手机或电脑连接名称为USBMETER的热点,打开网页,在网址栏输入192.168.4.1这个IP地址(若使用手机连接配网请关闭流量),会自动进入配网网页界面,在网页中输入你的WIFI账号与密码,点击保存,即可完成配网。

 

3.完成配网后会自动关闭热点进入WIFI链接状态,屏幕会显示正在链接字样。若长时间(约15s)无法连接到设置的WIFI,会自动重新创建WIFI热点并进入配网模式(注意:在该模式下不会尝试连接WiFi),需要重新上电进入OTA模式才能重新尝试连接WIFI,若完成了配网却无法连接到WIFI,请将表拿到靠近WIFI的位置并重新上电进入OTA模式尝试连接,若仍无法连接,请在进入配网模式时重新进行配网并仔细确认检查输入的WIFI账号密码是否正确。

 

 

4.成功连接上WIFI后,会显示WIFI已连接的字样,此时屏幕上会显示表的IP地址,将手机或者电脑连接至与表同一个WIFI网络下,在网页上输入表上显示的IP地址,稍等一段时间(会有点慢),会进入USBMETER OTA升级系统的网页,点击上传文件,选择需要升级的固件(OTA开头),点击Update并等待一段时间,会自动升级完成,完成后表会自动重启。

 

 

使用教程与操控逻辑


上端三个按键为操控按键,分别为确认、+、-按键,负责界面交互。下方两个按键为诱骗按键,负责选择是否进入PD诱骗模式。

Each of the three control buttons has three control logics, namely short press (press and release within 0.5s), long press (press and release within 0.5~2s) and hold (press and hold for more than 3s without letting go).

 

In any interface, short pressing the + and - keys will switch the interface or cursor.

In the main interface, short press the confirmation button to enter the menu. In other interfaces, short press the confirmation button to confirm the selection.

 

In any interface, long press the confirmation button to return to the previous menu.

Except in certain interfaces (referring to interfaces that require a long press to switch the cursor or quickly turn pages), long press the + and - buttons to flip the screen and manually pause the screen respectively.

 

In any interface, press and hold the confirm key to return to the main interface.

In the main interface, press and hold the + and - buttons to enter the PD (need to be in PD deception mode) and QC (need to be in non- PD deception mode) deception interface respectively. In the interface that requires quick page turning, press the button to quickly turn up the page. page, page down.

 

PD deception is triggered by the exclusive PD button. When the CC line is inserted into the female end of the meter , press and hold one of the deception buttons to trigger the PD deception mode and automatically enter the PD deception interface. Which button to press and hold to trigger depends on your CC line. direction. When the male end of the watch is inserted into the female end of the charger, press and hold any deception button to trigger the PD deception mode and automatically enter the PD deception interface.

 

The current firmware cannot use QC deception on the C port of a charger that supports PD because QC deception will be automatically disabled in PD deception mode.

For some PD deceptions that have modified the A port , you may need to press and hold the correct deception button first, and then insert the Type C cable into the female socket of the watch to successfully enter the deception mode.

 

Please note that whenever you use the deception function, please disconnect the load on the backend of the table, or ensure that the load connected to the backend of the table is within control. I am not responsible for any consequences arising therefrom.

 

 

BOM list


 

 

Detailed demonstration video

Video 1: PD deception, monitoring & Emarker reading demonstration

Video 2: Demonstration of current monitoring and other functions

Video 3: QC deception demonstration

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-24 02:30:36

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号