加入星計(jì)劃,您可以享受以下權(quán)益:

  • 創(chuàng)作內(nèi)容快速變現(xiàn)
  • 行業(yè)影響力擴(kuò)散
  • 作品版權(quán)保護(hù)
  • 300W+ 專(zhuān)業(yè)用戶
  • 1.5W+ 優(yōu)質(zhì)創(chuàng)作者
  • 5000+ 長(zhǎng)期合作伙伴
立即加入

基于Core系列第三代主機(jī)CoreS3的汽車(chē)駕駛評(píng)分器方案

05/15 09:10
4040
服務(wù)支持:
技術(shù)交流群

完成交易后在“購(gòu)買(mǎi)成功”頁(yè)面掃碼入群,即可與技術(shù)大咖們分享疑惑和經(jīng)驗(yàn)、收獲成長(zhǎng)和認(rèn)同、領(lǐng)取優(yōu)惠和紅包等。

虛擬商品不可退

當(dāng)前內(nèi)容為數(shù)字版權(quán)作品,購(gòu)買(mǎi)后不支持退換且無(wú)法轉(zhuǎn)移使用。

加入交流群
掃碼加入
獲取工程師必備禮包
參與熱點(diǎn)資訊討論
放大
電路板圖(3)
相關(guān)方案
  • 方案介紹
  • 推薦器件
  • 相關(guān)推薦
  • 電子產(chǎn)業(yè)圖譜
申請(qǐng)入駐 產(chǎn)業(yè)圖譜

一、項(xiàng)目名稱(chēng):汽車(chē)駕駛評(píng)分器

作者:aramy

二、項(xiàng)目概述:

公司有公用的維護(hù)車(chē),每個(gè)員工開(kāi)車(chē)習(xí)慣都不同,但是行車(chē)安全最重要。制作了“汽車(chē)駕駛評(píng)分器”這個(gè)項(xiàng)目,用來(lái)監(jiān)督記錄每次行車(chē)狀態(tài)數(shù)據(jù)。出現(xiàn)危險(xiǎn)駕駛行為進(jìn)行扣分。

項(xiàng)目硬件使用CoreS3。是一個(gè)M5Stack 推出的基于樂(lè)鑫 ESP32-S3 開(kāi)發(fā)的 Core 系列第三代主機(jī) CoreS3,集成了多個(gè)傳感器,其中包括這次項(xiàng)目使用到的加速度傳感器、SD卡和2.0寸的觸摸屏。另外添加了一個(gè)GROVE - GPS (AIR530)模塊,使用GPS+北斗來(lái)進(jìn)行定位。

1、主要框架:系統(tǒng)主要分為3個(gè)部分。

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

GPS+北斗定位信息,用來(lái)獲得當(dāng)前車(chē)輛的詳細(xì)位置和速度。有想過(guò)將交通地圖集成到系統(tǒng)中去,但是能力有限,沒(méi)能實(shí)現(xiàn)。定位信息結(jié)合交通地圖就能獲得不同道路的限速信息,從而實(shí)現(xiàn)對(duì)不同道路的限速評(píng)分管理,但是這個(gè)功能暫時(shí)沒(méi)有能夠?qū)崿F(xiàn)。所以對(duì)速度的評(píng)分,僅僅實(shí)現(xiàn)了最高速的扣分(當(dāng)時(shí)速超過(guò)120公里/小時(shí)則扣分)。加速度傳感器用來(lái)收集車(chē)輛加減速和轉(zhuǎn)彎時(shí)的加速度信息。設(shè)定了閾值,當(dāng)車(chē)輛加速度超過(guò)1倍重力加速度時(shí),意味著產(chǎn)生了急加速、急減速的情況,就給與扣分。

第二部分為駕駛信息記錄部分。CoreS3能力有限,所以將行車(chē)時(shí)傳感器獲取到的數(shù)據(jù),以文件的方式保留下來(lái)。對(duì)行車(chē)數(shù)據(jù)進(jìn)行收集,為以后做出駕駛行為評(píng)估模型搭建數(shù)據(jù)基礎(chǔ)。記錄文件采取每分鐘寫(xiě)入一個(gè)單獨(dú)文件,保障文件不會(huì)因斷電丟失。

第三部分為UI部分。最為車(chē)載系統(tǒng),盡可能做到不干擾駕駛員的注意力。所以界面使用儀表盤(pán)方式顯示了 車(chē)速和當(dāng)前評(píng)分。經(jīng)緯度、加速度等信息輔助顯示,顏色使用較為暗淡的方式,盡量做到不干擾駕駛員的注意力。

UI界面使用了LVGL,使用了Guider工具進(jìn)行UI繪制,代碼使用Arduino的C來(lái)編寫(xiě),編程工具使用的是Vscode+platformio。

2、打分。

系統(tǒng)默認(rèn)駕駛員的駕駛行為為滿分(10分)??鄯钟腥N情況。i:超速行為,當(dāng)車(chē)速超過(guò)120公里/小時(shí)開(kāi)始扣分,每秒扣1分。ii:當(dāng)加速度連續(xù)2次(2秒)檢測(cè)到超過(guò)1倍重力加速度,則扣1分。iii:當(dāng)加速度超過(guò)1.5倍重力加速度,則扣1分。

// 評(píng)分標(biāo)準(zhǔn) 如果連續(xù)兩次加速度超過(guò)1 或者單次加速度超過(guò)1.5 則扣一分,速度超過(guò)120KM/小時(shí) 扣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;
}
復(fù)制代碼
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
復(fù)制代碼

三、作品實(shí)物圖

四、演示視頻

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

五、項(xiàng)目文檔

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

提取碼:wsg6

推薦器件

更多器件
器件型號(hào) 數(shù)量 器件廠商 器件描述 數(shù)據(jù)手冊(cè) ECAD模型 風(fēng)險(xiǎn)等級(jí) 參考價(jià)格 更多信息
FSA644UCX 1 onsemi 2:1 MIPI D-PHY (1.5Gbps) 4-Data Lane Switch, 3000-REEL
$2.15 查看
ADF4106BRUZ 1 Analog Devices Inc 6 GHz integer-N PLL

ECAD模型

下載ECAD模型
$7.15 查看
VNH7070BASTR 1 STMicroelectronics Automotive fully integrated H-bridge motor driver

ECAD模型

下載ECAD模型
$3.23 查看

相關(guān)推薦

電子產(chǎn)業(yè)圖譜