ELM327電纜外殼上的標(biāo)簽,用細(xì)小的星形螺釘擰下4個螺釘
然后拿出木板。
提示: 借用Girlfrien/妻子的表情,并在連接到OBD2連接器的連接器的一側(cè)做一個標(biāo)記,以這種方式將其取出時會知道它會走到哪一邊,因?yàn)樗梢噪p向移動,因此在此可指示的情況下,無需移除上述連接器。
將2線連接到板上的TX和RX引腳,在隨附的照片中,我包括了USB Bridge芯片的引腳排列信息。請小心,盡管我設(shè)法取消焊接了一些我無法放回的組件,但幸運(yùn)的是,此后它仍然可以工作。
提示:對arduino進(jìn)行編程,以便對其進(jìn)行編程寫入串行監(jiān)視器時,它們之間有一些短的延遲,然后將跳線電纜連接到arduino的TX引腳上,并與電路板的另一端相碰,以查看在哪里可以進(jìn)行一些串行活動,表面安裝的LED閃爍為發(fā)生通信,不幸的是,這在RX端不起作用,但是在圖片中很容易看到我將其焊接到板上的位置。
注意: USB電纜通過4針連接器連接到板上,我將中間的2條切掉,以便ELM327在連接時無法與PC通信,這樣,它僅從PC的USB端口和板上的串行控制器獲取電源將不會被允許Arduino與之交談的PC占用
一旦將其放回盒子中,我就將其錄音因?yàn)樵谖业募哲囍校渥訐踝×宋业穆罚瑹o法在駕駛員座位上駕駛它,所以我將把外殼用于其他用途。
步驟2:將Arduino LCD Shield連接到Arduino
將Arduino LCD Shield連接到arduino,然后將其連接到要編程的PC。
下面是我的Arduino Sketch,我注意到格式混亂有了一些代碼,我可以獲得一些與此版本有關(guān)的信息,您也可以在此處查看代碼。
http://techtinker.co.za/viewtopic.php?f=14&t=17
// include the library code:
#include
//Declare Serial Read variables
int CmdCount=1;
byte inData;
char inChar;
String BuildINString=“”;
String DisplayString=“”;
long DisplayValue;
String SentMessage=“”;
int ByteCount=0;
long A;
int B;
int WorkingVal;
String WorkingString=“”; //Declare Buttons
int MenuID=0; // initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); void setup()
{
// set up the LCD‘s number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0);
Bootup();//Simulate Bootup process doesnt have to be here this only makes it look cool
Retry:
lcd.setCursor(0, 0);
lcd.print(“Connecting.。..。. ”);
lcd.setCursor(0, 1);
lcd.print(“ ”);
Serial.begin(38400);
delay(500);
//Send a test message to see if the ELM327 Chip is responding
SentMessage = “ATI”;
Serial.println(“ATI”);delay(500);ReadData();
if (BuildINString.substring(1,7)==“ELM327”)
{
lcd.setCursor(0, 0);
lcd.print(“Welcome.。. ”);
lcd.setCursor(0, 1);
lcd.print(“Connection OK ”);
delay(1500);
}
else
{
lcd.setCursor(0, 0);
lcd.print(“Error ”);
lcd.setCursor(0, 1);
lcd.print(“No Connection! ”);
delay(1500);
goto Retry;
}
delay(1500);
} void loop() {
int x;
x = analogRead (0);
//Serial.println(x);
lcd.setCursor(10,1);
if (x 》 800 and x 《 820){lcd.print (“Select ”);}
if (x 》 620 and x 《 630){if (MenuID》0){MenuID--;}delay(250);}//Left
if (x 》 400 and x 《 415){lcd.print (“Down ”);}
if (x 》 190 and x 《 215){lcd.print (“Up ”);}
if (x 》 -10 and x 《 10){if (MenuID《11){MenuID++;}delay(250);} //Right if (MenuID==0){lcd.setCursor(0, 0);lcd.print(“01 Coolant Temp ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 05”;Serial.println(“01 05”);delay(300);ReadData();}
if (MenuID==1){lcd.setCursor(0, 0);lcd.print(“02 IAT Temp ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 0F”;Serial.println(“01 0F”);delay(300);ReadData();}
if (MenuID==2){lcd.setCursor(0, 0);lcd.print(“03 Ambient Temp ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 46”;Serial.println(“01 46”);delay(300);ReadData();}
if (MenuID==3){lcd.setCursor(0, 0);lcd.print(“04 Throttle % ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 11”;Serial.println(“01 11”);delay(300);ReadData();}
if (MenuID==4){lcd.setCursor(0, 0);lcd.print(“05 CAT 1 Temp ”);lcd.setCursor(0, 1);lcd.print(“Not Implemented ”);}
if (MenuID==5){lcd.setCursor(0, 0);lcd.print(“06 CAT 2 Temp ”);lcd.setCursor(0, 1);lcd.print(“Not Implemented ”);}
if (MenuID==6){lcd.setCursor(0, 0);lcd.print(“07 CAT 3 Temp ”);lcd.setCursor(0, 1);lcd.print(“Not Implemented ”);}
if (MenuID==7){lcd.setCursor(0, 0);lcd.print(“08 CAT 4 Temp ”);lcd.setCursor(0, 1);lcd.print(“Not Implemented ”);}
if (MenuID==8){lcd.setCursor(0, 0);lcd.print(“09 RPM ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 0C”;Serial.println(“01 0C”);delay(300);ReadData();}
if (MenuID==9){lcd.setCursor(0, 0);lcd.print(“10 Vehicle Speed ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 0D”;Serial.println(“01 0D”);delay(300);ReadData();}
if (MenuID==10){lcd.setCursor(0, 0);lcd.print(“11 Air Flow Rate ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 10”;Serial.println(“01 10”);delay(300);ReadData();}
if (MenuID==11){lcd.setCursor(0, 0);lcd.print(“12 Barometric ”);lcd.setCursor(0, 1);lcd.print(DisplayString);SentMessage = “01 33”;Serial.println(“01 33”);delay(300);ReadData();}
步驟3:掛鉤直到您的車輛
對Arduino進(jìn)行編程后,請確保將Arduino的TX/RX引腳連接到ELM327板上的TX/RX引腳。
該代碼通過發(fā)送命令“ ATI”來確保其能夠與ELM327芯片通信,如果i t并非液晶顯示屏上將顯示“錯誤,無連接”,如果它可以正常工作的話,它將在液晶顯示屏上顯示歡迎消息。
從那里,您只需按左右按鈕即可在
冷卻液溫度,IAT溫度,環(huán)境溫度,油門%,RPM,車輛速度,空氣流速,大氣壓力
您可以添加如果愿意,可以根據(jù)需要將更多菜單更改為
有關(guān)更多PID的信息,請參見Wikihttp://en.wikipedia.org/wiki/OBD-II_PIDs。
您可以使用再次插入窗口的手機(jī)支架來固定它,并使用USB手機(jī)充電器為Arduino供電,ELM327將通過引腳16上的OBD端口供電,引腳16為正,引腳4/5為負(fù)。
責(zé)任編輯:wv
-
掃描儀
+關(guān)注
關(guān)注
2文章
426瀏覽量
67905 -
Arduino
+關(guān)注
關(guān)注
188文章
6473瀏覽量
187420
發(fā)布評論請先 登錄
相關(guān)推薦
微軟已修復(fù)掃描儀USB連接問題
OBD接口位置在哪里 OBD掃描儀使用方法
如何將三維激光掃描儀與BIM結(jié)合使用
三維激光掃描儀與無人機(jī)結(jié)合的應(yīng)用
三維激光掃描儀使用技巧 三維激光掃描儀測量精度分析
三維激光掃描儀應(yīng)用領(lǐng)域 三維激光掃描儀與傳統(tǒng)測量工具比較
大幅掃描儀掃描地圖怎么操作
蔡司激光三維掃描儀有效掃描金屬材料

何為電磁干擾(EMI)掃描儀,哪里需要它?

如何選擇電磁干擾(EMI)掃描儀,看看這幾點(diǎn)

lidar激光雷達(dá)掃描儀有什么用
[can開發(fā)板] 一款低價can/obd2總線Linux開發(fā)板
工業(yè)級gom三維掃描儀的工作原理


評論