加入星计划,您可以享受以下权益:

  • 创作内容快速变现
  • 行业影响力扩散
  • 作品版权保护
  • 300W+ 专业用户
  • 1.5W+ 优质创作者
  • 5000+ 长期合作伙伴
立即加入

基于Core系列第三代主机CoreS3的汽车驾驶评分器方案

05/15 09:10
3797
服务支持:
技术交流群

完成交易后在“购买成功”页面扫码入群,即可与技术大咖们分享疑惑和经验、收获成长和认同、领取优惠和红包等。

虚拟商品不可退

当前内容为数字版权作品,购买后不支持退换且无法转移使用。

加入交流群
扫码加入
获取工程师必备礼包
参与热点资讯讨论
放大
电路板图(3)
  • 方案介绍
  • 推荐器件
  • 相关推荐
  • 电子产业图谱
申请入驻 产业图谱

一、项目名称:汽车驾驶评分器

作者:aramy

二、项目概述:

公司有公用的维护车,每个员工开车习惯都不同,但是行车安全最重要。制作了“汽车驾驶评分器”这个项目,用来监督记录每次行车状态数据。出现危险驾驶行为进行扣分。

项目硬件使用CoreS3。是一个M5Stack 推出的基于乐鑫 ESP32-S3 开发的 Core 系列第三代主机 CoreS3,集成了多个传感器,其中包括这次项目使用到的加速度传感器、SD卡和2.0寸的触摸屏。另外添加了一个GROVE - GPS (AIR530)模块,使用GPS+北斗来进行定位。

1、主要框架:系统主要分为3个部分。

第一部分,收集传感器信息。GPS+北斗定位信息和加速度传感器信息。

GPS+北斗定位信息,用来获得当前车辆的详细位置和速度。有想过将交通地图集成到系统中去,但是能力有限,没能实现。定位信息结合交通地图就能获得不同道路的限速信息,从而实现对不同道路的限速评分管理,但是这个功能暂时没有能够实现。所以对速度的评分,仅仅实现了最高速的扣分(当时速超过120公里/小时则扣分)。加速度传感器用来收集车辆加减速和转弯时的加速度信息。设定了阈值,当车辆加速度超过1倍重力加速度时,意味着产生了急加速、急减速的情况,就给与扣分。

第二部分为驾驶信息记录部分。CoreS3能力有限,所以将行车时传感器获取到的数据,以文件的方式保留下来。对行车数据进行收集,为以后做出驾驶行为评估模型搭建数据基础。记录文件采取每分钟写入一个单独文件,保障文件不会因断电丢失。

第三部分为UI部分。最为车载系统,尽可能做到不干扰驾驶员的注意力。所以界面使用仪表盘方式显示了 车速和当前评分。经纬度、加速度等信息辅助显示,颜色使用较为暗淡的方式,尽量做到不干扰驾驶员的注意力。

UI界面使用了LVGL,使用了Guider工具进行UI绘制,代码使用Arduino的C来编写,编程工具使用的是Vscode+platformio。

2、打分。

系统默认驾驶员的驾驶行为为满分(10分)。扣分有三种情况。i:超速行为,当车速超过120公里/小时开始扣分,每秒扣1分。ii:当加速度连续2次(2秒)检测到超过1倍重力加速度,则扣1分。iii:当加速度超过1.5倍重力加速度,则扣1分。

// 评分标准 如果连续两次加速度超过1 或者单次加速度超过1.5 则扣一分,速度超过120KM/小时 扣1分
static int score = 10;
static float oldacc = 0; // 上次的加速度
int judgeScore(LvglQueue lvglmsg)
{
float acc = lvglmsg.acc; // 本次加速度
if (oldacc > 1 && acc > 1)
{
score--;
}
if (acc > 1.5)
score--;
if (lvglmsg.speed > 120)
score--;
oldacc = acc;
return score;
}
复制代码
21:56:00 :135600 ,latitude:2303.157471 ,longitude:11346.219727 ,speed:32.430000 ,acc_x:-0.067269 ,acc_y:0.942306 ,acc_z:-0.289605 ,gyro_x:2.837960 ,gyro_y:0.201862 ,gyro_z:0.255032 ,judge:10
21:56:01 :135601 ,latitude:2303.162109 ,longitude:11346.228516 ,speed:33.110001 ,acc_x:-0.044075 ,acc_y:0.968673 ,acc_z:-0.357965 ,gyro_x:-1.739677 ,gyro_y:0.323933 ,gyro_z:0.193996 ,judge:10
21:56:01 :135601 ,latitude:2303.162109 ,longitude:11346.228516 ,speed:33.110001 ,acc_x:-0.026497 ,acc_y:0.916916 ,acc_z:-0.331353 ,gyro_x:-5.706962 ,gyro_y:0.018757 ,gyro_z:-0.477390 ,judge:10
21:56:03 :135603 ,latitude:2303.171387 ,longitude:11346.246094 ,speed:32.830002 ,acc_x:-0.012581 ,acc_y:0.983566 ,acc_z:-0.275445 ,gyro_x:0.640694 ,gyro_y:-1.079876 ,gyro_z:-1.087742 ,judge:10
21:56:04 :135604 ,latitude:2303.175781 ,longitude:11346.254883 ,speed:31.780001 ,acc_x:0.005974 ,acc_y:0.970871 ,acc_z:-0.253228 ,gyro_x:1.128975 ,gyro_y:-0.408489 ,gyro_z:1.292629 ,judge:10
21:56:05 :135605 ,latitude:2303.180176 ,longitude:11346.262695 ,speed:31.000000 ,acc_x:-0.062142 ,acc_y:0.975753 ,acc_z:-0.346246 ,gyro_x:1.495186 ,gyro_y:-1.262981 ,gyro_z:0.804348 ,judge:10
21:56:06 :135606 ,latitude:2303.184082 ,longitude:11346.270508 ,speed:30.230000 ,acc_x:-0.063362 ,acc_y:0.989181 ,acc_z:-0.277154 ,gyro_x:3.692452 ,gyro_y:0.323933 ,gyro_z:-0.111179 ,judge:10
21:56:06 :135606 ,latitude:2303.184082 ,longitude:11346.270508 ,speed:30.230000 ,acc_x:-0.013069 ,acc_y:0.970871 ,acc_z:-0.305719 ,gyro_x:1.190010 ,gyro_y:0.018757 ,gyro_z:0.316067 ,judge:10
21:56:08 :135608 ,latitude:2303.191895 ,longitude:11346.286133 ,speed:28.850000 ,acc_x:-0.078499 ,acc_y:0.971115 ,acc_z:-0.280084 ,gyro_x:0.701729 ,gyro_y:1.117390 ,gyro_z:1.292629 ,judge:10
21:56:09 :135609 ,latitude:2303.195557 ,longitude:11346.293945 ,speed:28.230000 ,acc_x:0.001335 ,acc_y:1.002365 ,acc_z:-0.263971 ,gyro_x:1.800362 ,gyro_y:0.018757 ,gyro_z:-4.322605 ,judge:10
21:56:09 :135609 ,latitude:2303.195557 ,longitude:11346.293945 ,speed:28.230000 ,acc_x:-0.039437 ,acc_y:0.975509 ,acc_z:-0.315240 ,gyro_x:-1.251396 ,gyro_y:2.399128 ,gyro_z:-0.172215 ,judge:10
21:56:11 :135611 ,latitude:2303.202881 ,longitude:11346.308594 ,speed:26.059999 ,acc_x:-0.098763 ,acc_y:1.006759 ,acc_z:-0.239557 ,gyro_x:2.715889 ,gyro_y:2.338093 ,gyro_z:1.353664 ,judge:10
21:56:12 :135612 ,latitude:2303.206543 ,longitude:11346.314453 ,speed:24.230000 ,acc_x:-0.039193 ,acc_y:1.008224 ,acc_z:-0.315973 ,gyro_x:3.509346 ,gyro_y:2.154987 ,gyro_z:-2.552586 ,judge:10
21:56:13 :135613 ,latitude:2303.209961 ,longitude:11346.320312 ,speed:21.879999 ,acc_x:-0.020638 ,acc_y:0.885421 ,acc_z:-0.327936 ,gyro_x:-3.387626 ,gyro_y:1.605671 ,gyro_z:3.428860 ,judge:10
21:56:13 :135613 ,latitude:2303.209961 ,longitude:11346.320312 ,speed:21.879999 ,acc_x:-0.022103 ,acc_y:0.993820 ,acc_z:-0.273004 ,gyro_x:1.251046 ,gyro_y:0.568073 ,gyro_z:-1.270847 ,judge:10
21:56:15 :135615 ,latitude:2303.216797 ,longitude:11346.331055 ,speed:19.889999 ,acc_x:-0.026497 ,acc_y:0.940597 ,acc_z:-0.340875 ,gyro_x:2.105538 ,gyro_y:-0.469524 ,gyro_z:-0.538426 ,judge:10
21:56:16 :135616 ,latitude:2303.220215 ,longitude:11346.335938 ,speed:19.600000 ,acc_x:-0.053109 ,acc_y:0.885666 ,acc_z:-0.317926 ,gyro_x:4.241768 ,gyro_y:-1.507122 ,gyro_z:-0.965672 ,judge:10
21:56:17 :135617 ,latitude:2303.223877 ,longitude:11346.339844 ,speed:20.500000 ,acc_x:-0.025765 ,acc_y:0.900558 ,acc_z:-0.334283 ,gyro_x:-0.030693 ,gyro_y:1.361530 ,gyro_z:0.682278 ,judge:10
21:56:17 :135617 ,latitude:2303.223877 ,longitude:11346.339844 ,speed:20.500000 ,acc_x:-0.050667 ,acc_y:0.939132 ,acc_z:-0.320367 ,gyro_x:2.654854 ,gyro_y:1.971882 ,gyro_z:0.071926 ,judge:10
21:56:19 :135619 ,latitude:2303.231201 ,longitude:11346.349609 ,speed:20.520000 ,acc_x:-0.071907 ,acc_y:1.071457 ,acc_z:-0.265924 ,gyro_x:4.424874 ,gyro_y:2.399128 ,gyro_z:-3.468113 ,judge:10
21:56:20 :135620 ,latitude:2303.234863 ,longitude:1134635392.000000 ,speed:20.200001 ,acc_x:-0.046273 ,acc_y:0.937179 ,acc_z:-0.272516 ,gyro_x:-3.692802 ,gyro_y:3.009480 ,gyro_z:2.696438 ,judge:10
21:56:21 :135621 ,latitude:2303.238525 ,longitude:11346.358398 ,speed:19.370001 ,acc_x:0.015739 ,acc_y:0.956955 ,acc_z:-0.295465 ,gyro_x:2.166573 ,gyro_y:-1.018841 ,gyro_z:-6.580906 ,judge:10
21:56:23 :135623 ,latitude:2303.245850 ,longitude:11346.367188 ,speed:18.020000 ,acc_x:-0.020150 ,acc_y:0.856125 ,acc_z:-0.025201 ,gyro_x:-12.359795 ,gyro_y:-0.042278 ,gyro_z:-0.355320 ,judge:10
21:56:24 :135624 ,latitude:2303.249268 ,longitude:11346.371094 ,speed:17.219999 ,acc_x:-0.098519 ,acc_y:0.955734 ,acc_z:-0.188043 ,gyro_x:-3.570732 ,gyro_y:0.812214 ,gyro_z:0.438137 ,judge:10
21:56:24 :135624 ,latitude:2303.249268 ,longitude:11346.371094 ,speed:17.219999 ,acc_x:-0.014046 ,acc_y:0.978683 ,acc_z:-0.375299 ,gyro_x:0.213448 ,gyro_y:0.934284 ,gyro_z:0.926418 ,judge:10
21:56:26 :135626 ,latitude:2303.255615 ,longitude:11346.377930 ,speed:15.250000 ,acc_x:-0.093636 ,acc_y:0.840255 ,acc_z:-0.394098 ,gyro_x:-2.655204 ,gyro_y:2.216022 ,gyro_z:1.719875 ,judge:10
21:56:26 :135626 ,latitude:2303.255615 ,longitude:11346.377930 ,speed:15.250000 ,acc_x:-0.045052 ,acc_y:0.934494 ,acc_z:-0.312066 ,gyro_x:0.823799 ,gyro_y:0.629108 ,gyro_z:1.109524 ,judge:10
21:56:28 :135628 ,latitude:2303.262207 ,longitude:11346.384766 ,speed:16.420000 ,acc_x:-0.011360 ,acc_y:0.967209 ,acc_z:-0.322076 ,gyro_x:-3.204521 ,gyro_y:1.300495 ,gyro_z:1.780910 ,judge:10
21:56:28 :135628 ,latitude:2303.262207 ,longitude:11346.384766 ,speed:16.420000 ,acc_x:-0.071907 ,acc_y:0.873947 ,acc_z:-0.384332 ,gyro_x:1.678292 ,gyro_y:1.117390 ,gyro_z:0.743313 ,judge:10
21:56:30 :135630 ,latitude:2303.268555 ,longitude:11346.391602 ,speed:16.020000 ,acc_x:-0.021859 ,acc_y:0.944015 ,acc_z:-0.362359 ,gyro_x:1.800362 ,gyro_y:0.995319 ,gyro_z:1.475735 ,judge:10
21:56:30 :135630 ,latitude:2303.268555 ,longitude:11346.391602 ,speed:16.020000 ,acc_x:-0.040413 ,acc_y:0.927414 ,acc_z:-0.408502 ,gyro_x:-0.580009 ,gyro_y:0.262897 ,gyro_z:0.377102 ,judge:10
复制代码

三、作品实物图

四、演示视频

https://www.bilibili.com/video/BV13Q4y1w7Tc/

五、项目文档

链接:https://pan.baidu.com/s/1-1XPUpYTo4-4l2V1egzBjA

提取码:wsg6

推荐器件

更多器件
器件型号 数量 器件厂商 器件描述 数据手册 ECAD模型 风险等级 参考价格 更多信息
L6470H 1 STMicroelectronics Fully integrated microstepping motor driver with motion engine and SPI

ECAD模型

下载ECAD模型
$11.33 查看
LT6105IMS8#PBF 1 Analog Devices Inc Precision, Rail-to-Rail Input Current Sense Amplifier

ECAD模型

下载ECAD模型
$3.48 查看
NE555PWR 1 Texas Instruments Single Precision Timer 8-TSSOP 0 to 70

ECAD模型

下载ECAD模型
$0.31 查看

相关推荐

电子产业图谱