标准版
#第七届立创电赛#带有hub的USB功率计(带有上位机软件)

创建时间:1年前

描述

<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> <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="color:#0093e6;">请在报名阶段填写 ↓</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;"> </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;"><span style="font-size:24px;">这是一款USB功率计,并且带有hub可以连接蓝牙鼠标与键盘的USB,板载CH340芯片通过HUB与计算机USB连接,搭配Labview编写的上位机软件可以实现电压、电流、功耗的实时监测,在调试其他硬件时可以很容易的得到硬件的功耗情况与功耗水平。<img src="//image.lceda.cn/pullimage/kEKx7O1kyctyl9Ur2nusmfus3zFwfXsPKqgEZcA4.png" alt="kEKx7O1kyctyl9Ur2nusmfus3zFwfXsPKqgEZcA4.png"></span></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="font-size:24px;">立创训练营纯原创项目</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;"><strong><span style="color:#0093e6;">请在竞赛阶段填写 ↓</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;"> </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="font-size:24px;">采用国民技术N32G430系列芯片作为主控,负责采样电压与电流、进行简单功耗运算并驱动OLED(0.96)。</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:24px;">电流采样部分采用INA199芯片,采样电阻为40mΩ(由于我经常做的项目功耗不大,更需要关注小电流、低功耗的情况因此采用了较大的采样电阻),最大可实现1.6A电流的采样,若想达到更大的电流可更换采样电阻。</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:24px;">功率计带有SL2.1Ahub芯片,该芯片可以提供USB1转4路,其中一路连接板载的CH340用于串口通讯以及程序下载,其他三路引出可搭载外设进行数据传输。(采样的电流是三路的电流总和)</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:24px;">采用立创eda标准版进行PCB设计(会尽快转到专业版的~) PCB成品见下图</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 src="//image.lceda.cn/pullimage/vLfqcIzbZr7ZRvyZdwku5yRHD9pwhkF2x3UbNiiz.jpeg" alt="vLfqcIzbZr7ZRvyZdwku5yRHD9pwhkF2x3UbNiiz.jpeg"></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:24px;">利用立创eda专业版进行外壳设计,三维猴进行3D外壳打印,效果灰常不错</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 src="//image.lceda.cn/pullimage/11Yg5DapGzSi2ELpmJz2dr1p9DZleW2vMf9OLYud.png" alt="11Yg5DapGzSi2ELpmJz2dr1p9DZleW2vMf9OLYud.png"><img src="//image.lceda.cn/pullimage/hjDDjIWwTAeihXuENBNyfjIf3NwhZSmkeqXvru9N.png" alt="hjDDjIWwTAeihXuENBNyfjIf3NwhZSmkeqXvru9N.png"><img src="//image.lceda.cn/pullimage/Nr9vgFKnjdksLrJXnCfpYUF3tOQd10Pjh5IfNEUh.png" alt="Nr9vgFKnjdksLrJXnCfpYUF3tOQd10Pjh5IfNEUh.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 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:#0d0101;"><span style="font-size:24px;">软件部分采用Keil5进行编程,主要参考了国民技术的官方立创,具体有:</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;"><span style="color:#0d0101;"><span style="font-size:24px;">1.使能定时器产生1s定时,每隔1sRGB蓝灯闪烁表示程序正在运行,并利用串口向电脑发送一次数据</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;"><span style="color:#0d0101;"><span style="font-size:24px;">2. 使能串口printf打印函数</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;"><span style="color:#0d0101;"><span style="font-size:24px;">3. 每间隔1s,对电流与电压进行相乘得到功率累加得到mWh的数据</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;"><span style="color:#0d0101;"><span style="font-size:24px;">上位机软件采用LabVIEW编写,主要是串口信息读取与功耗作图。</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;"><span style="color:#0d0101;"><span style="font-size:24px;"><img src="//image.lceda.cn/pullimage/nL1dvhGpk4BwvZ1N6RSXRXGfb6Ap0sFRCgekd1rF.png" alt="nL1dvhGpk4BwvZ1N6RSXRXGfb6Ap0sFRCgekd1rF.png"></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 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;">*6、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="font-size:24px;"><img src="//image.lceda.cn/pullimage/DFA3u6ZVG6On3xpMcu7lrfY3vLAV5oFp0X3Z3C1K.png" alt="DFA3u6ZVG6On3xpMcu7lrfY3vLAV5oFp0X3Z3C1K.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;"><span style="font-size:24px;">芯片都是在立创买的啦,ch340、sl2.1a、n32g430一共10块拿下,oled淘宝十元差不多,外壳五块阻容以及接口算5块,一共三十元轻松拿下</span></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、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"><p style="line-height:1.8;"><img src="//image.lceda.cn/pullimage/d53IOZ57baGhDsgxcKpgjYgN4Sz34E4gSbmDngNJ.png" alt="d53IOZ57baGhDsgxcKpgjYgN4Sz34E4gSbmDngNJ.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;"><img src="//image.lceda.cn/pullimage/AwM1EmpiwloLgQg9EQXFHezPGmRK52sflT2hbLyg.png" alt="AwM1EmpiwloLgQg9EQXFHezPGmRK52sflT2hbLyg.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;">* 8、演示您的项目并录制成视频上传</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;">视频有点大,上传有点慢可以移步B站:<a href="https://www.bilibili.com/video/BV1eG411479K?spm_id_from=333.999.0.0" target="_blank">立创&国民技术训练营_带有USB hub的功率计_哔哩哔哩_bilibili</a></p> </div>

文档

Sheet_1

PCB_#第七届立创电赛#usb功率计

附件

附件名 下载
usb电压表.vi
N32G430C8L7-USBMeter.zip
cce0d677389191c792e861ef19fbce2a.mp4

评论(21)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
andylauren 回复
<p>这个得奖了吧</p>
zhaoshaox 回复
<p>666</p>
bruss 回复
<p>群除我佬(ง •̀_•́)ง加油</p>
SJ_USER 回复
<p>666</p>
少不入川 回复
<p>666</p>
RogerHD 回复
<p>6</p>
clysgs 回复
<p>学习 学习</p>
玻尔能级 回复
<p>功能强大</p>
HLzw233 回复
<p>有点东西(doge)</p>
xc777 回复
<p>666</p>
Green_Hand 回复
<p>精致</p>
立创电赛 回复
<p>logo验证需要实物图哦</p>
TuZXXX 回复
<p>巨佬,可以发下下外壳文件不:)</p>
养乐多 回复
<p>外壳文件、程序源文件、串口下载工具以及上位机Vi都放到微云里面啦https://share.weiyun.com/UbZ5PjA9<br><br/>上位机Vi只能用LabView打开,安装包太大了就没传,有需要的可以私信</p>
fenglan 回复
<p>你好,请问下载时Boot需要接到3.3V吗</p>
养乐多 回复
<p>是的,BOOT拉高然后rst</p>
eyekey 回复
<p>不错不错</p>
邓子言 回复
<p>可以发一下编译好的固件吗?谢谢</p>
邓子言 回复
<p>楼主你好,如果想达最高支持3A电流检测的话,采样电阻40毫欧换成多少合适呢?谢谢</p>
养乐多 回复
<p>INA199用的放大倍数是50,保证放大后的电压不超过单片机的量程就好,对于3A电流可以换成10毫欧</p>
邓子言 回复
<p>好的,谢谢</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