【安信可UWB室内定位模组NodeMCU-BU01】No.002-硬件测试环境搭建
<div class='showpostmsg'><p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">上一篇对开发板进行了简单的测试,确认电路都完好。这一篇主要是介绍搭建硬件电路。</font></span></span></span></span></p><p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">为了方便在户外测试,我计划做成能单独工作的两个系统模块,分别用充电宝供电,其中标签端模块需要带屏幕显示,可以观察测量距离。经过我翻箱倒柜凑齐以下电路板。如下图。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">1 </font><font face="宋体">用于测试的实验板</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">带屏幕的板卡是我以前做过的一个产品淘汰的不合格品,基于</font><font face="Calibri">STM32</font><font face="宋体">单片机设计,带显示、串口、按键等,比较适合做标签端控制。另外一个带屏蔽罩的板卡是基于</font><font face="Calibri">Arduino</font><font face="宋体">编程的评估板,带串口,适合做基站端。</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">基站端比较简单,先安排这个硬件搭建。如下图,</font><font face="Calibri">Arduino</font><font face="宋体">板对应接口都引出来了,只需要对应的连起来就行。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">2 Arduino</font><font face="宋体">板接口</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">先用杜邦线连接起来,测试电路通不通。如下图是连接好的。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">3 Arduino</font><font face="宋体">板连线</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">在</font><font face="Calibri">Arduino IDE</font><font face="宋体">里面编写一个测试程序,设置一下</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">的工作模式为基站,然后程序就一直读取</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">模块的输出并上传,以方便观察状态,如下图。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">4 </font><font face="宋体">程序设置基站模式</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">把另外一个模块连接到电脑串口,两个模块放一起,测试是否正常通讯。如下图。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">5 </font><font face="宋体">两模块联测</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">通过串口调试助手观察通讯结果,下图可见两模块能够正常测距,说明电路连接没有问题。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">6 </font><font face="宋体">通讯成功</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">然后把</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">模块和</font><font face="Calibri">Arduino</font><font face="宋体">板之间用线焊接起来,杜邦线很容易接触不良,不适合移动测试。通过充电宝给两个板板供电,就可以自由移动了,如下图,基站部分就做好了。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">7 </font><font face="宋体">基站搭建完成</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">接下来搭建标签端硬件。由于使用的不是成品开发板,整个弄起来非常繁杂,需要拆件,跳线,焊接调试接口等,整整用了我一天的时间才把硬件调整好,最终的成品如下图,虽然看着有点丑陋,但是电路是好用的。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">8 </font><font face="宋体">标签端电路搭建完成</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">标签端电路除了把</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">模块和</font><font face="Calibri">MCU</font><font face="宋体">板连接起来外,我还把通讯用的</font><font face="Calibri">TX</font><font face="宋体">和</font><font face="Calibri">RX</font><font face="宋体">线分别接了一个</font><font face="Calibri">USB</font><font face="宋体">转串口的接收端,这样方便观察两个板卡的收发数据实况。有调试串口协议需求的同学,如果没用过此方法,强烈推荐试一试,真的提高不少编程效率。</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">在</font><font face="Calibri">STM32</font><font face="宋体">上编个简单的测试程序,如下图,通过</font><font face="Calibri">4</font><font face="宋体">步把</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">模块设置成标签模式。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">9 </font><font face="宋体">程序设置标签模式</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">通过两个监视串口可以看到,两个板板通讯正常,</font><font face="Calibri">NodeMCU-BU01</font><font face="宋体">模块连续播报测试距离,如下图。</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:24.0000pt; text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">10 MCU</font><font face="宋体">通讯成功</font></span></span></span></span></p>
<p style="text-indent:24.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:12.0000pt"><span style="font-family:宋体"><font face="宋体">至此,硬件测试环境搭建完成,下一步开始设计单片机程序,实现在屏幕上显示实时测量的数据。</font></span></span></span></span></p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>可以设置测距频率吗?</p>
wangerxian 发表于 2022-2-7 10:13
可以设置测距频率吗?
<p>只通过at指令是不行的,估计得改实验板上的stm32的程序</p>
sipower 发表于 2022-2-7 13:29
只通过at指令是不行的,估计得改实验板上的stm32的程序
<p>了解。</p>
页:
[1]