专业版
#第七届立创电赛#USB电流计

创建时间:2年前

描述

<div class="document"> <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;"><span style="color:#95a5a6;font-size:14px;">       USB电流计,可以实时显示USB输出的电、电压、功率大小,电压最小显示1mV,电流最小显示1mA,功耗最小显示1mW。理论最大输入电压30V,最大输入电流16A。当电流为0,15秒后进入休眠状态,电流不为0时,立即退出休眠模式。</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;">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:#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;">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;"><strong class="ql-size-13">GPL 3.0</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;"> </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;"><strong>(1)复位按键</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;"><strong>       </strong>SW1为按键,R1为上拉电阻,C1为滤波电容。复位按键在实际中几乎没有使用,可以选择删除,下载程序时,可以在keil中直接勾选reset的选项。</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><img src="//image.lceda.cn/pullimage/Tv4jeHoCQ5fgABAeT9Ql8PO6uFm3jbtWTs0N5UiS.png" alt="Tv4jeHoCQ5fgABAeT9Ql8PO6uFm3jbtWTs0N5UiS.png" width="351" height="207"></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;"><strong><strong>(2)BOOT</strong></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;"><strong><strong>       </strong></strong>预留BOOT接口,正常使用时,可以不焊接排针。</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/jqkuH7q0cLElq6b4sBNrjO7gnhOgnOKFCUEBhJuQ.png" alt="jqkuH7q0cLElq6b4sBNrjO7gnhOgnOKFCUEBhJuQ.png" width="348" height="370"></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>(3)转3.3V</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;"><strong>      </strong> 电源方案采用LDO芯片,原理图中的LDO为友台半导体,最大输入电压30V,由于第一版中,Vin和Vout引脚画反了,所以实物使用的是AMS117-3.3,最大输入电压只有18V。</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;">       原理图已经更新为UMW(友台半导体)的芯片,如果使用AMS117-3.3,需要将原理图和PCB进行更改。</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><img src="//image.lceda.cn/pullimage/tbcJ6jlHrI2B58zYf0AoA4kwnGfz2ZZtubyKq4Wv.png" alt="tbcJ6jlHrI2B58zYf0AoA4kwnGfz2ZZtubyKq4Wv.png" width="346" height="250"></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;"><strong>(3)烧录接口</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;"><strong>      </strong> N32G430芯片可以使用ST-Link进行烧录,官方的烧录接口加了串口,此处未添加。</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><img src="//image.lceda.cn/pullimage/uUtssB39vleI22ZDoWZ9MOAS9fx2cJ1yR49xvQUt.png" alt="uUtssB39vleI22ZDoWZ9MOAS9fx2cJ1yR49xvQUt.png"></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;"><strong>(4)电流测量</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;"><strong>        </strong>电流测量采用的芯片为INA199A3,采集1mΩ电阻两端的压降,电压的放大倍数为200,理论最大测量电流16A。</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;">  PCB中,VCC线和GND线以加粗至50mil。</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><img src="//image.lceda.cn/pullimage/CaMbXz5Jeadi20Efw2tMJYkoMySq4m6BXXiSqsbI.png" alt="CaMbXz5Jeadi20Efw2tMJYkoMySq4m6BXXiSqsbI.png" width="539" height="373"></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;"><strong>(5)电压测量</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;"><strong>       </strong>电压测量采用100K电阻和10K电压进行分压。</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><img src="//image.lceda.cn/pullimage/F1oMXpt0rIwfXQ1v6KxiACC9XP1DJ9MuFnqneZmi.png" alt="F1oMXpt0rIwfXQ1v6KxiACC9XP1DJ9MuFnqneZmi.png"></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;"><strong>(6)0.96‘ TFTLCD彩屏</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;"><strong>     </strong> TFTLCD彩屏采用SPI通信方式,采用软件SPI方式通信(硬件SPI通信移植失败),背光引脚与单片机的PWM输出引脚连接,可以通过改变PWM的脉冲宽度来调整LCD的亮度(软件未写此部分)。</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;">     TFTLCD在某宝只需6RMB,还是非常划算的。</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><img src="//image.lceda.cn/pullimage/qFrgfwcqxKn4M4c5RndrxbltlTo6vRJFoLHuK79y.png" alt="qFrgfwcqxKn4M4c5RndrxbltlTo6vRJFoLHuK79y.png" width="481" height="252"></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;"><strong>(7)RGB</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;"><strong>      </strong> 原理图中设计的是3色RGB彩灯,由于RGB灯的器件封装没买对,实物中用两个LED代替了RGB使用。</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><img src="//image.lceda.cn/pullimage/aSoVBzPdZROb12iHn50hM6stmeTy7FdF7qNCW5XU.png" alt="aSoVBzPdZROb12iHn50hM6stmeTy7FdF7qNCW5XU.png" width="498" height="227"></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;"><strong>(8)MCU</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;"><strong>        </strong> 电压与电流的测量引脚必须接到有ADC功能的IO口上。</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><img src="//image.lceda.cn/pullimage/qGHZuPeu5JInZoTjU05INsAFssf03RMn9WM0nsm1.png" alt="qGHZuPeu5JInZoTjU05INsAFssf03RMn9WM0nsm1.png" width="732" height="604"></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;"> </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;"> </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>见附件!</strong></p> <p> </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、实物展示</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;"> </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>(1)正面照片</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;"> </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><img src="//image.lceda.cn/pullimage/GCtcBTiypitU4P6PuG0jLx3olwKuvbn10LTkO6ne.jpeg" alt="GCtcBTiypitU4P6PuG0jLx3olwKuvbn10LTkO6ne.jpeg" width="499" height="168"></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;"> </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>(2)背面照片</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;"> </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/xPA3KNSmzTIZ1SRRbZdG9q6y5xtDvYgDypjDQZLd.jpeg" alt="xPA3KNSmzTIZ1SRRbZdG9q6y5xtDvYgDypjDQZLd.jpeg" width="496" height="148"></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>(3)启动照片</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;"> </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/WJgLHOtxkeo5MDujpQKmMXsOxTSTyLV15Nw20ZO4.png" alt="WJgLHOtxkeo5MDujpQKmMXsOxTSTyLV15Nw20ZO4.png" width="563" height="263"></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>(4)运行照片</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;"> </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><img src="//image.lceda.cn/pullimage/EBvpUtNZC6TFfLB85vEOvft094BwfWIJMLrBkWyy.png" alt="EBvpUtNZC6TFfLB85vEOvft094BwfWIJMLrBkWyy.png" width="566" height="360"></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;"> </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>(5)休眠照片</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;"> </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><img src="//image.lceda.cn/pullimage/vu5wE6m7FUEnAb6zqNIXX5StPYVCFUqgpsP1JmFs.png" alt="vu5wE6m7FUEnAb6zqNIXX5StPYVCFUqgpsP1JmFs.png"></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;"> </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>(6)演示视频</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;"> </p> </div>
  • 正常.mp4

  • 休眠.mp4

  • 快充.mp4

文档

BOM

暂无

附件

附件名 下载
正常.mp4
休眠.mp4
快充.mp4
N32G430_USBMeter.zip

评论(25)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
23studio 回复
<p>牛啊 牛啊</p>
立创电赛 回复
<p>记得进行立创电赛logo验证哦</p>
xianqz 回复
<p><img src="//image.lceda.cn/pullimage/BPF0pVDFnkd8LkwT3HMyDU1mtUMizlpcVYAlJZkF.webp" alt="BPF0pVDFnkd8LkwT3HMyDU1mtUMizlpcVYAlJZkF.webp"></p>
xiaoxiaoLM 回复
<p>可以</p>
wj180519 回复
<p>精度咋样</p>
smartpilot 回复
<p>有电流 没有电压,不知道哪里出问题了</p><p><img title="点击查看大图" src="//image.lceda.cn/pullimage/DKVEn8kynJQLrgRJ1RsQri5w6XYLIStnWMKOPUMn.webp" alt="DKVEn8kynJQLrgRJ1RsQri5w6XYLIStnWMKOPUMn.webp"></p>
xiaoxiaoLM 回复
<p>电压采集使用的是电阻分压,先用万用表测量一下分压之后的电压值,如果不对,就是硬件的问题;如果有电压值,就是软件的问题,在程序里面打印一下ADC采集的值,然后一步一步调试</p>
zgy15615520717 回复
<p>请问在ina199中输出电流是怎么换算的,在程序中有没有看懂</p>
xiaoxiaoLM 回复
<p>电流 = ADC采集值 * (3.3V/4095/200/0.001)</p>
LIANGGUOYUAN 回复
<p>电压最小显示1mV,电流最小显示1mA,功耗最小显示1mW是怎么算的,按照你的电路图,电流最小分辨率是4ma,怎么显示的1mA???</p>
hxpaaa 回复
<p>请问大佬,怎么下载程序?要搭建什么下载环境?谢谢</p>
hxpaaa 回复
<p>请问大佬,怎么下载程序?要搭建什么下载环境?谢谢</p>
xiaoxiaoLM 回复
<p>电流的最小分辨率为4mA,电流最小变化幅度也就是4mA,都是4的倍数,不会是1mA的,工程写的有误哈,还是你比较仔细[emojis:强]</p>
xiaoxiaoLM 回复
<p>改程序的话,可以搭建Keil的环境;只需下载程序的话,压缩包的Project/Objects文件夹下有个hex文件,使用STM32 ST-LINK Utility或者STM32CubeProgrammer软件就可以</p>
hxpaaa 回复
<p>好 谢谢</p>
biubius 回复
<p>请教一下大佬电流是怎么算的呀[emojis:晕]? VI OUT的电压 / R2电阻么?</p>
xiaoxiaoLM 回复
<p>是的,电流 = ADC采集值 * (3.3V/4095/200/0.001),0.001就是电阻的大小,3.3V/4095/200是电阻两端的电压</p>
biubius 回复
<p>好的,谢谢</p>
hxpaaa 回复
<p>你好我用的是stm32cubeprogrammer 下载的,但是总是显示链接不上,我看好像是能链接ST-LINK但是链接识别不了芯片,这是怎么回事啊?帮我看下谢谢</p><p><img title="点击查看大图" src="//image.lceda.cn/pullimage/saGqPwRkHhycVMaFY0qYN2tBzjPkyK9Ub3JRpTmj.webp"><img title="点击查看大图" src="//image.lceda.cn/pullimage/Bd3eo4qHqbv40SAWV8Bk8Th1zZHX16bbaENfnqGf.webp"></p>
xiaoxiaoLM 回复
<p>可能stm32cubeprogrammer不支持下载N32吧,我这个还没有试过,要么你用keil试一下能不能下载</p>
hxpaaa 回复
<p>keil没用过不知道下载步骤是什么,能告知我一下吗?非常感谢,另外如果用keil软件的话要用ST-link还是Jlink下载程序啊?</p>
xiaoxiaoLM 回复
<p>你在CSDN上搜一下,上面的帖子很多的</p>
zhss25800 回复
<p>能不能改成竖屏显示??????</p>
mestrious-boy 回复
<p>好厉害,学习一下</p>
LD 回复
<p>规格书中是高测感测好像,作者用的低测感测,看TI的应用笔记说是低侧感测的弊端之一是监测的负载直接与系统接地相连<br/>会产生损耗。up有做对应补偿不?<br/><a href="https://www.ti.com.cn/cn/lit/ab/zhca667f/zhca667f.pdf?ts=1727435042236" target="_blank">https://www.ti.com.cn/cn/lit/ab/zhca667f/zhca667f.pdf?ts=1727435042236</a><img title="点击查看大图" src="//image.lceda.cn/oshwhub/4b567a486c924798b4437d8c9fab3e16.png" alt=""><img title="点击查看大图" src="//image.lceda.cn/oshwhub/da123980a85741d4ad20ff831a878dba.png" alt=""></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