标准版
#第七届立创电赛#带PD诱骗的桌面电压电流表

创建时间:6个月前

描述

<div class="document"> <div class="document"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 1、项目功能介绍</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">基于CH224K和国民技术N32G430C8,可实时监测输出电压及电流,也可随时调整诱骗电压至9V/12V/15V/20V,设备也带有防误触功能,避免误触导致电压的突然变化。</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/6HXYdIg4XVd1rchCJNv0S4EO4FMMth5W5AcHmfRk.png" alt="6HXYdIg4XVd1rchCJNv0S4EO4FMMth5W5AcHmfRk.png"></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*2、项目属性</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;"><span style="color:#95a5a6;"><span style="color:#000000;font-size:14px;">首次公开</span></span></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 3、开源协议</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#ffffff;font-size:14px;background-color:#843fa1;">GPL 3.0</span></p> <p> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*4、硬件部分</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">主控采用国民技术的N32G430C8,N32G430系列采用32-bit ARM Cortex-M4F内核,最高工作主频128MHz,支持浮点运算和DSP指令,集成高达64KB嵌入式加密Flash,16KB SRAM,集成丰富的高性能模拟器件,内置1个12bit 4.7Msps ADC,3个高速比较器,集成多路U(S)ART、I2C、SPI、CAN等数字通信接口。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;">PD诱骗芯片采用CH224K,CH224 单芯片集成 USB PD 等多种快充协议,支持 PD3.0/2.0,BC1.2 等升压快充协议,自动检测 VCONN 及模拟 E-Mark 芯片,最高支持 100W 功率,内置 PD 通讯模块,集成度高,外围精简。集成输出电压检测功能,并且提供过温、过压保护等功能。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;">此芯片可通过3个引脚的高低电平来实现不同诱骗电压的切换:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><img style="margin-left:auto;margin-right:auto;" src="//image.lceda.cn/pullimage/Qpq49ZFdhaJZ9kGqvzpVC0P84ZxYrpUuOaMFpSdD.png" alt="Qpq49ZFdhaJZ9kGqvzpVC0P84ZxYrpUuOaMFpSdD.png"></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;">在发出诱骗指令后,主控MCU通过ADC功能引脚结合分压电阻实现实时监测,如果诱骗成功,则相应指示灯会被点亮,OLED会显示当前电压及输出电流。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><strong><span style="font-size:18px;">降压芯片</span></strong></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;">降压芯片采用LP2950ACDT-3.3RG,最大输入电压可达30V,输出电压为3.3V,最小压差:450mV@(100mA) 输出电流:100mA 3.3V </span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:18px;color:#1875df;">防误触</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">按钮可以设定诱骗的电压,在按住后蜂鸣器会提示即将切换输出电压,OLED显示屏会显示即将切换的电压值,按键需要持续3秒,直到OLED显示CONFIG(确认!),输出电压才会被切换到设置值,如按键持续时间少于3秒,OLED则会显示CANCEL(取消),更改电压的操作将不会被执行。这样的设计可以防误触,避免突然切换电压导致损坏用电设备。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">实机演示:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">按下按钮后屏幕显示即将变更的电压:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;"><img src="//image.lceda.cn/pullimage/4p515jPdcI4mHLeXiMlXmESiuUq0nMjgzkpVYo99.png" alt="4p515jPdcI4mHLeXiMlXmESiuUq0nMjgzkpVYo99.png" width="275" height="118"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">按下程序3秒,屏幕显示确认,电压调整指令即将执行:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;"><img src="//image.lceda.cn/pullimage/oHSVqflfSpGtWigqwT85NA8zg9vWZ6YwtugXxjq5.png" alt="oHSVqflfSpGtWigqwT85NA8zg9vWZ6YwtugXxjq5.png" width="275" height="89"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">中途松开按钮,显示取消,输出电压不会变更:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;"><img src="//image.lceda.cn/pullimage/Yk67DY6NKM8vNQZ3Jm5sRQhcBia0tpZKT7sZkMtT.png" alt="Yk67DY6NKM8vNQZ3Jm5sRQhcBia0tpZKT7sZkMtT.png" width="276" height="111"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;">调整完成,显示实时的电压电流及功率:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="font-size:16px;color:#000000;"><img src="//image.lceda.cn/pullimage/c1QuxdHOqdW5VSp4vHbgV1NEEx8R7GnlMTiZlXPs.png" alt="c1QuxdHOqdW5VSp4vHbgV1NEEx8R7GnlMTiZlXPs.png" width="276" height="108"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*5、软件部分</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">编程软件采用KEIL,相关的硬件支持包和代码可以在附件下载,主要的代码在main.c文件中,根据需要引用部分外部库,bsp_delay.h用于支持延时函数;bsp_key.h用于处理按键输入;<br>bsp_led.h用于处理引脚输出,此处主要用于驱动电压指示LED和控制诱骗芯片的3个引脚;MonoScreen.h用于驱动OLED显示屏,具体的配置可以在inc文件夹找到并更改相应的文件。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">烧录程序使用SDW接口:3.3V、GND、SWCLK、SWDIO,使用的是创芯工坊的PWLINK,此烧录器支持多款主流芯片、也支持KEIL在线调试、同时也支持串口通信。配置界面如图:</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;"><img style="margin-left:auto;margin-right:auto;" src="//image.lceda.cn/pullimage/P7yCc1VVYfnnEEIIRmsahC1AQIqeo4d5lQeBBhYg.png" alt="P7yCc1VVYfnnEEIIRmsahC1AQIqeo4d5lQeBBhYg.png" width="689" height="367"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">需要注意的是电平设置需为3.3V,避免损坏OLED。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">注:若您的项目涉及软件开发,请在附件上传对应的工程源码。这里可以详细说明您的软件流程图、功能模块框图、相关算法的解释或科普、源码结构、编译环境的搭建和配置、源码编译方法、程序烧录方法等。推荐图文并茂的形式向别人介绍您的想法。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*6、3D外壳</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">外壳正在建模生产中,可能不能在截止日期前提交了... ...</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt pap-left-indent-1.6em" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*7、BOM清单</h3> <hr class="horizontal-splitline normal-bold-2"><p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#000000;font-size:16px;">BOM在页面底部已自动生成</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"><span style="color:#95a5a6;font-size:14px;">注:项目涉及的BOM清单。这个位置请上传BOM的截图。清单详情请以PDF的格式上传到附件中。建议包括型号、品牌、名称、封装、采购渠道、用途等内容。具体内容和形式应以表达清楚项目构成为准。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">*8、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"><p style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/m1Y9deMFOGrQ6IQ7SbftKhpTcwzdFE8fy6f1SSxC.png" alt="m1Y9deMFOGrQ6IQ7SbftKhpTcwzdFE8fy6f1SSxC.png"><span style="font-size:56px;">&<img src="//image.lceda.cn/pullimage/HRvRpXhgnIHLjp1ZjajWPwApXciK4bAknLCEEhJa.png" alt="HRvRpXhgnIHLjp1ZjajWPwApXciK4bAknLCEEhJa.png"></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;">* 8、演示您的项目并录制成视频上传</h3> <hr class="horizontal-splitline normal-bold-2"><p style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height:1.8;"> </p> </div> </div>

文档

Sheet_1

PCB_#第七届立创电赛#桌面可调电源

BOM

ID Name Designator Footprint Quantity
1 YS-MBZ9055C05R42 BUZZER1 DIP-BUZZER-14.1X7 1
2 4.7u C1 C0805 1
3 0.1u C2,C3,C5,C6,C7,C8,C9,C10,C11,C15,C16,C17 C0805 12
4 12pF C13,C14 C0805 2
5 HDR-F-2.54_1x4 H1 HDR-F-2.54_1X4 1
6 HDR-F-2.54_1x6 H2 HDR-F-2.54_1X6 1
7 HDR-M-2.54_1x3 J1 HDR-M-2.54_1X3 1
8 LED-TH-5mm_B LED1,LED2,LED3,LED4 LED-TH_BD5.0_BLUE 4
9 LED-0805_R LED5 LED0805_RED 1
10 10K R2,R4,R7,R11 R0805 4
11 1k R3,R14,R16,R17,R19,R20 R0805 6
12 1.5k R5,R8,R12 R0805 3
13 10k R6,R9,R10,R15 R0805 4
14 0.01 R13 R1210 1
15 100k R18 R0805 1
16 12X12X7.3 SW1,SW2,SW3,SW6 SW-TH_4P-L12.0-W12.0-P5.00-LS12.5 4
17 1TS002A-2300-5000 SW4,SW5 SW-TH_L6.0-W3.5-LS6.6 2
18 CH224K U1 CH224K 1
19 N32G430C8L7 U2 LQFP-48_L7.0-W7.0-P0.50-LS9.0-BL 1
20 INA199B1DCKR U3 SC-70-6_L2.2-W1.3-P0.65-LS2.1-BL 1
21 78M05_C2891842 U4 TO-252-2_L6.5-W5.5-P4.58-LS9.8-BR-CW 1
22 GT-USB-7002B USB1 USB-C-SMD_GT-USB-7002B 1
23 8MHZ X1 HC-49US_L11.0-W4.6-P4.88 1

附件

附件名 下载
N32G430C8固件.zip
《带PD诱骗的桌面电压电流表》-功能介绍及演示.mp4

成员

评论(15)

成功
工程所有者当前已关闭评论
LCDS 回复
<p>项目进度如何啦······</p>
Baymax 回复
<p>完成啦 正在编辑内容呐</p>
xiao_小维。 回复
<p>这个R15 R18分压电阻用100k不对劲吧。电压过高</p>
Baymax 回复
<p>这个是一个10K的和一个100K的 好像没同步过来 等会刷新下康康</p>
xiao_小维。 回复
<p>10k跟100k20v电压多少你算算</p>
xiao_小维。 回复
<p>这种高电压的就怕电阻挂掉可以加钳位二极管芯片自带的话当我没说</p>
Baymax 回复
<p>最高电压20V 线路电阻共110 000欧姆,计算线路电流为I=U/R=20/110000=0.0001818A, MCU的ADC引脚测量电压最高为:U=IR=0.0001818X10000=1.818V<br><br/>即:当输出为最高电压20V时芯片ADC引脚承受电压为1.818V,根据国民技术<a href="https://atta.szlcsc.com/upload/public/pdf/source/20220608/411F2C1C49F3955F5F0689A973473AF7.pdf" target="_blank">N32G430x6/x8 数据手册</a>第27页ADC内容指出:</p><br/><br/><p>ADC输入范围:VREF- ≤ VIN ≤ VREF+</p><br/><br/><p>即:输入电压在ADC的量程范围内</p>
xiao_小维。 回复
<p>受教了</p>
Baymax 回复
<p>一起学习</p>
xiao_小维。 回复
<p>大佬我下午抄了你的板子,为啥不用合金采样电阻?我平时都用合金采样电阻。期待大佬上传固件</p>
Baymax 回复
<p>这里有两个原因:<br><br/>次要原因:这个表测量电流的最小分辨率是10mA。采样电阻1%的误差和0.1%的误差在最终结果上差别很小;<br><br/>主要原因:家里有这个,不用再另外购买了😂,这个实物也是采样电阻,精度和合金电阻几乎一致。</p><br/><p>固件这几天更新😛</p>
xiao_小维。 回复
<p>交个作业。板子画好一个月了,才想起来做,分压电阻没到没敢插充电头。</p><p><img src="//image.lceda.cn/pullimage/9Rn8gLo195yQlLbsrTvx6L3JmdBuxuWfEXE7r4Ql.webp" alt="9Rn8gLo195yQlLbsrTvx6L3JmdBuxuWfEXE7r4Ql.webp"></p>
xiao_小维。 回复
<p><img src="//image.lceda.cn/pullimage/bOsomKTtQGbJoYjaAxdohHoyvZmoobFHVIM6fHrT.webp" alt="bOsomKTtQGbJoYjaAxdohHoyvZmoobFHVIM6fHrT.webp"></p>
Baymax 回复
<p>可以的 很棒捏 能运行就是成功 后面再慢慢改进吧</p>
LCDS 回复
<p>恭喜您在“国民技术N32 MCU杯”第七届立创电子设计开源大赛中获得鼓励奖,更多详情见:<a href="https://diy.szlcsc.com/posts/ce62d5686424460db0a26a6b90277d78" target="_blank">https://diy.szlcsc.com/posts/ce62d5686424460db0a26a6b90277d78</a></p>
goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow