标准版
#第八届立创电赛#ESP32-C3蓝牙小车

创建时间:6个月前

2010 5

视频

描述

<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>目前网络上智能小车方案非常多,大多采用的是主控芯片ESP32,电机驱动L298N,单路电源供电等方案,成本较高、体积较大、稳定性较差。</p> <p>本项目基于合宙的ESP32-C3开发板、DRV8833、麦克纳姆轮、锂电池等元件,采用两路电源供电,避免小车四轮启动时,ESP32-C3开发板电流不足重启;主板尽可能采用较少的贴片电子元器件,方便焊接、组装;整套成本不足50元,具有成本低、体积小、稳定性高等特点,适合中小学生学习、二次开发。</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: #000000; 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;"><span style="color: #000000; font-size: 14px;">100%开源,便于中小学生学习和二次开发。</span></p> <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;"><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>本项目的硬件采用低成本方便,锂电池使用小米电动牙刷拆下来的小电池,整套小车成本不超过50元。</p> <p>1、主控芯片:采用合宙ESP32-C3开发板,价格12.9元。支持以下功能:</p> <p>——1路SPI FLASH,板载4MB,支持最高 16MB</p> <p>——2路UART接口,UART0~UART1,其中下载口为UART0</p> <p>——5 路 12 比特 ADC,最高采样率 100KSPS</p> <p>——1路低速SPI接口,支持主模式</p> <p>——1路IIC控制器</p> <p>——4路PWM接口,可使用任意GPIO</p> <p>——GPIO外部管脚15路,可复用</p> <p>——2路贴片LED指示灯</p> <p>——1路复位按键+1路BOOT按键</p> <p>——1路USB转TTL下载调试口</p> <p>——2.4G PCB板载天线</p> <p> <img src="//image.lceda.cn/pullimage/waVDD4woFedLQ0peHPx5i1PZqal7O0Hv7cYGTfTY.png" alt="ESP32-C3" width="1132" height="183"></p> <p>2、电机驱动:两块国产小体积DRV8833电机驱动模块,价格1.8元/块。每个模块可驱动2个直流减速电机。</p> <p> <img src="//image.lceda.cn/pullimage/0M0okeEu4p7FhBHkQ9Y4GFdVwWW2cgr7rVhJ1Xvb.png" alt="小体积DRV8833" width="830" height="152"></p> <p>3、电源方案:采用两路电源方案,一路为ESP32-C3供电,一路为电机供电,避免互相干扰。ESP32-C3的供电采用一个3.7V锂电池通过LDO(HT7333-A)降压稳压到3.3V供电。电机供电采用一个3.7V锂电池通过DRV8833直接供电。如果要让小车的速度更快,可以考虑采用2个3.7V锂电池供电,7.4V的电压能让小车速度更快。</p> <p> </p> <p>4、设计的主板</p> <p>主板尽可能采用较少的贴片电子元器件,成本详见BOM表。ESP32-C3、DRV8833等模块采用2.54排针固定,电池、电机采用XH2.54插件连接,方便焊接、组装,以及元件重复利用。</p> <p>主板原理图如下:</p> <p><img src="//image.lceda.cn/pullimage/Ip1mCAUdCHwUurlXKJxVDRqyep7CFH2tydfiiTjQ.png" alt="原理图" width="700" height="495"></p> <p>初学PCB设计,画得丑了点。</p> <p> </p> <p>PCB图:<img src="//image.lceda.cn/pullimage/y9oSlqLiawaEiXTLbJ2Il469UUtiJ1ptd5BYAPzN.png" alt="PCB图" width="675" height="671"></p> <p> </p> <p>效果图:</p> <p><img src="//image.lceda.cn/pullimage/0VIRYToRzSp3PaU5qAKEwdqtGPsfnqt264bohWaC.png" alt="效果" width="618" height="613"> </p> <p>实物图:</p> <p><img src="//image.lceda.cn/pullimage/RtHOHcsUBGtgFbx60FVn1FEWsvvj4HXJbudOMxK2.jpeg" alt="主板" width="500" height="480"></p> <p> </p> <p>焊接图: </p> <p><img src="//image.lceda.cn/pullimage/jWJkBq5uZWJlKuCgVWqui4hC9IA1vODxMb8zfaWN.jpeg" alt="焊接" width="600" height="451"></p> <p>PCB板只有HT7333-A和3个贴片电容比较难,其他都简单。</p> <p> </p> <p> 5、电机和麦克纳姆轮</p> <p>某宝上买的成套材料,25元。结果发过来2个电机是坏的,重新买的2个颜色和速度还和前面的不一样,导致小车横向行走有点弯。</p> <p><img src="//image.lceda.cn/pullimage/wIi6FjoVG6sXMh6vdaQJQs7lks2blQ2qEeVlajy7.png" alt="麦轮" width="1200" height="162"><img src="//image.lceda.cn/pullimage/87hg73ptOvXgkkJUfZEAdFB5pwpYPff6Z3bmeukH.png" alt="麦轮2" width="600" height="613"></p> <p> </p> <p>6、遥控器</p> <p>手机APP,节省成本。</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;">7、成果图</p> <p>组装好的成品:</p> <p><img src="//image.lceda.cn/pullimage/iXMfdoHPc2rElE5BSDcmUkZ3Fx2LxuZiWqTQZSxL.jpeg" alt="成品" width="600" height="511">背面:</p> <p><img src="//image.lceda.cn/pullimage/gY9mbhnLZYaiQ7YpryD9IeYEjLd64F8MkP7qkdJ0.jpeg" alt="背面" width="600" height="477"></p> <p>小车加上舵机和超声波模块:</p> <p><img src="//image.lceda.cn/pullimage/DpzlZlqMnUfVFNZ3BhvESUHh69u7Otpa7IsmFljh.jpeg" alt="超声波" width="600" height="439"></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>合宙ESP32-C3支持Lua、MicroPython、乐鑫IDF等开发方式,本项目采用MicroPython开发。</p> <p>1、手机蓝牙APP</p> <p>蓝牙区分为经典蓝牙(Classic Bluetooth)和低功耗蓝牙(BLE),低功耗蓝牙一般为蓝牙4.0及以上的。合宙ESP32-C3配备的蓝牙5.0属于BLE,不向下兼容经典蓝牙。所以要通过手机蓝牙APP遥控ESP32-C3小车,则需要支持BLE的APP,我测试了好多APP才找到这个可用的。(iOS请自搜)</p> <p>Bluefruit Connect:https://cnas.lanzoum.com/ivoGu0pre7xc,密码:4phz</p> <p>注:文件为Android/HarmonyOS版,IOS版请自行搜索。这个APP有提供四向按键,且按下按键和放开均有发送消息。</p> <p><img src="//image.lceda.cn/pullimage/XRVtwa6XVy87qRa1Bkp38nWuogxisSUnqjj9kfhs.gif" alt="APP" width="600" height="802"></p> <p> </p> <p>2、蓝牙遥控原理</p> <p>要通过手机蓝牙APP控制ESP32-C3小车,原理分三步:</p> <p>① 实现蓝牙广播和连接。</p> <p>② 手机蓝牙APP按下按键,通过蓝牙向ESP32-C3发送数据,需要测出每个按键发送的数据。</p> <p>③ 蓝牙发送的数据被存入到BLE_MSG全局变量中,根据BLE_MSG决定小车行动(前后左右停止)。</p> <p> </p> <p>3、测试轮子转向</p> <p>小车每个轮子由两个引脚控制,通过引脚的高低电平控制轮子转动的方向。编写代码前,需要先测试,出每个轮子的转向。测试代码如下:</p> <p>from machine import Pin</p> <p>from time import sleep_ms</p> <p> </p> <p># 定义GPIO引脚,L表示左,R表示右,fw表示前轮,bw表示后轮,1表示向前,0表示向后</p> <p>Lfw1 = Pin(10,Pin.OUT)     # GPIO10引脚,左前轮电机向前</p> <p>Lfw0 = Pin(7,Pin.OUT)      # GPIO7引脚,左前轮电机向后</p> <p>Rfw1 = Pin(19,Pin.OUT)     # GPIO19引脚,右前轮电机向前</p> <p>Rfw0 = Pin(8,Pin.OUT)      # GPIO8引脚,右前轮电机向后</p> <p>Lbw1 = Pin(3,Pin.OUT)      # GPIO3引脚,左后轮电机向前</p> <p>Lbw0 = Pin(2,Pin.OUT)      # GPIO2引脚,左后轮电机向后</p> <p>Rbw1 = Pin(6,Pin.OUT)      # GPIO6引脚,右后轮电机向前</p> <p>Rbw0 = Pin(18,Pin.OUT)     # GPIO18引脚,右后轮电机向后</p> <p> </p> <p>Lfw1.value(1)</p> <p>Lfw0.value(0)</p> <p>Rfw1.value(1)</p> <p>Rfw0.value(0)</p> <p>Lbw1.value(1) </p> <p>Lbw0.value(0)</p> <p>Rbw1.value(1)</p> <p>Rbw0.value(0)</p> <p> </p> <p>4、完整代码</p> <p>详见我们的微X公众号文章:<a href="https://mp.weixin.qq.com/s?__biz=MzkzNDQzMTc0OA==&mid=2247484002&idx=1&sn=7b6e45acbfd6cf3efb0b4cd3471d114e&chksm=c2bc1f09f5cb961fc5193c0a2de23bc102cbb50d70eee16277587e5fd7f09305d86a776e4de1#rd" target="_blank">基于MicroPython的蓝牙遥控小车2.0来了!</a></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 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;"><img src="//image.lceda.cn/pullimage/prKLS7ZHNkLT9WGbJFcQ9ceDQ9RY7ji7boVrbr6z.png" alt="bom" width="1200" height="725"></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;">*7、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height: 1.8;"><img src="//image.lceda.cn/pullimage/YGmFOSMM5H7I3besSqLfz8kZU5cchYDFrElEMHXe.jpeg" alt="LOGO" width="600" height="451"><img src="//image.lceda.cn/pullimage/a0nuNA4VZ3mH9pPkghYshA5wJ938IY71LDP8hRAZ.jpeg" alt="logo2" width="700" height="526"></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;">请上传包含大赛logo的项目图片,logo以丝印形式印刷在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;"><span style="color: #95a5a6; font-size: 14px;">点击zip下载大赛logo标识! <span style="text-decoration: underline;"><a href="https://image.lceda.cn/easyedaResource/images/%E7%AB%8B%E5%88%9B%E7%94%B5%E8%B5%9B%E6%A0%87%E8%AF%86.rar" target="_blank">(大赛标识).zip</a></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;">* 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;"><span style="color: #95a5a6; font-size: 14px;">视频要求:请横屏拍摄,分辨率不低于1280×720,格式Mp4/Mov,单个视频大小限100M内;</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: #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> <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: 14px;">更多详情:<a href="/posts/15a52db9fd7d40c492eb505280278e45" target="_blank">https://diy.szlcsc.com/posts/15a52db9fd7d40c492eb505280278e45</a></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> </div>

文档

#第八届立创电赛#ESP32-C3蓝牙小车

PCB_#第八届立创电赛#ESP32-C3蓝牙小车

BOM

ID Name Designator Footprint Quantity spiceSymbolName JLCPCB Part Class
1 10uF C1,C2 C0805 2 LCSC C0603
2 0.1uF C3 C0805 1 LCSC C0603
3 HX25003-2A CN1,CN2,CN3,CN4,CN5,CN6 CONN-TH_2P-P2.50_HX25003-2A 6 LCSC HX25003-2A https://so.szlcsc.com/global.html?k=C442299&ref=editor
4 JTAG CN7,CN8 HDR-TH_4P-P2.54-V-F 2 LCSC JTAG https://so.szlcsc.com/global.html?k=C9900002996&ref=editor
5 SS12D00G3 SW1,SW2 SW-TH_SS-12D01-GX 2 lcsc SS12D00G3 https://so.szlcsc.com/global.html?k=C9900018735&ref=editor
6 ESP32-C3 U1,U5 ESP32-C3-合宙 2 changfeng10000li ESP32-C3 COPY
7 DRV8833两路直流电机驱动板模块 U2,U3,U1,U6 DRV8833两路直流电机驱动板模块 4 1234pd DRV8833两路直流电机驱动板模块
8 HT7333-SOT89 U4 HT7333_SOT-89 1 NUAA_Haoran HT7333-SOT89

附件

暂无

评论(5)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
cnas2023 回复
<p>最终代码放在gitee上,地址:<a href="https://gitee.com/py2012/blecar2.0" target="_blank">https://gitee.com/py2012/blecar2.0</a></p>
snqzgq16888 回复
<p>人一生能活一万多天,而我确一天重复了一万次</p>
verysunshine 回复
<p>冲冲冲,拿奖拿奖拿奖,必须支持一下!希望作者做出更多有意思的项目!!!<br/>冲冲冲,拿奖拿奖拿奖,必须支持一下!希望作者做出更多有意思的项目!!!</p>
立创电赛 回复
<p>点赞+收藏+评论赢500元京东E卡:<a href="https://diy.szlcsc.com/posts/9d4438cf6d3848d3a53c50e029514a91" target="_blank">https://diy.szlcsc.com/posts/9d4438cf6d3848d3a53c50e029514a91</a></p>
立创电赛 回复
<p>恭喜您在“瑞萨MCU杯”第八届立创电子设计开源大赛中获得三等奖,相关奖励及证书将于近期发出!</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