Toyota GR86, 86, FR-S and Subaru BRZ Forum & Owners Community - FT86CLUB

Toyota GR86, 86, FR-S and Subaru BRZ Forum & Owners Community - FT86CLUB (https://www.ft86club.com/forums/index.php)
-   Electronics | Audio | NAV | Infotainment (https://www.ft86club.com/forums/forumdisplay.php?f=27)
-   -   New gauge project... (https://www.ft86club.com/forums/showthread.php?t=64562)

marcoaferrer 06-18-2014 05:58 AM

I'm hoping to get the money together soon to start building mine and figuring out mounting location. I also need to get an obd2 splitter so i can hopefully keep the use of my p3 gauge


Sent from my iPhone using Tapatalk

robot 06-19-2014 05:03 PM

I think I figured out the oil temp thing.

I think I send it "07E02101" and get back a 29 byte answer and use the 29th byte (aka "AC" (which, as an aside was something I was being dense about until last night. The numbering system for returns is documented as A=1, B=2,...,AA=27, AB=28, AC=29) and subtract 40 to get oil temp in C.

I'll try it later tonight.

(If this works then I can also probably get that fuel tank level thing working as well.)

tedo 06-23-2014 05:01 PM

Hi robot,

it should be the last byte in the message, see my code: http://mbed.org/users/chrta/code/Obd...emperature.cpp

Since i do the CAN message decoding on my own, my packet data length may differ from yours.

BTW: I will use this display http://www.adafruit.com/products/1431 (1,5" OLED)

marcoaferrer 06-23-2014 05:05 PM

@alpine

robot 06-23-2014 07:40 PM

Quote:

Originally Posted by tedo (Post 1811619)
Hi robot,

it should be the last byte in the message, see my code: http://mbed.org/users/chrta/code/Obd...emperature.cpp

Since i do the CAN message decoding on my own, my packet data length may differ from yours.

BTW: I will use this display http://www.adafruit.com/products/1431 (1,5" OLED)

I've avoided putting all the very technical discussion in here...so, I'll just link it: https://forum.sparkfun.com/viewtopic...172108#p172108

It turns out the PID is actually a CAN one and I was reading it wrong because the ELM command set returns it with numbered "stanzas" and not just in one long string.

stugray 06-23-2014 08:09 PM

Quote:

Originally Posted by robot (Post 1783963)

ILI9325/ILI9328/HX8347 - usually package with delicate touch panels, but cheapish ($20) and easy to find - 2.8" or 3.2" (even slightly larger)
...
I was looking at other LCD's (slightly larger 2.4" and 2.8" and stumbled on this: http://henningkarlsen.com/electronics/library.php?id=51


.

I have been messing around with the ITEAD 2.8" ITDB02 LCD/Touchscreen combo arduino shield.
When I plug it into the Arduino Leonardo, I can get it to work fine for my application, but I dont have enough EEPROM for the SDCard library.

So I got a Mega, and the shield doesnt "just work" like it did with the Leo & UTFT Lib.

So now I want to get it to work in serial mode, but havent messed with it much.
If I could get that working I would try to get the touchscreen to work for very basic gestures.

robot 06-23-2014 08:19 PM

Quote:

Originally Posted by stugray (Post 1811980)
I have been messing around with the ITEAD 2.8" ITDB02 LCD/Touchscreen combo arduino shield.
When I plug it into the Arduino Leonardo, I can get it to work fine for my application, but I dont have enough EEPROM for the SDCard library.

So I got a Mega, and the shield doesnt "just work" like it did with the Leo & UTFT Lib.

So now I want to get it to work in serial mode, but havent messed with it much.
If I could get that working I would try to get the touchscreen to work for very basic gestures.

So, the issue is possibly that some of the spi specific pins on the mega are different. Don't use serial mode, it's probably slow as crap.

https://learn.adafruit.com/1-8-tft-d...eed-spi-wiring Shows you the different pins. The rest of the tutorial is probably not helpful for your setup.

"On Atmega 328/168/8 type Arduinos ('classic' type) the hardware SPI pins are 11 (MOSI), 13 (SCK) and 10 (CS). For Megas it is 51 (MOSI), 52 (SCK), and 53 (CS). The CS pin can be a different pin but if you use any other pin you must still have the hardware SPI CS pin (10 or 53) as an output!"

robot 07-18-2014 03:00 AM

I got oil temp working. It was a pain.

Code:

    Serial1.println("AT SH 7E0");
    getResponse();
    Serial1.println("2101");
    Serial.println("brz oil temp");
    //value = ( (getResponseCAN('4', 11) ) - 40) * 1.8 + 32; //29th byte - 40 (?)
    getResponse();
    //Serial.println(&rxData[109]);
    //Serial.println((float)strtol(&rxData[109],0,16));
    value = ((float)strtol(&rxData[109],0,16) - 40) * 1.8 + 32;
    Serial.println(value);
    //Serial1.println("AT D"); //these two lines make the next 2101 reading get cut off
    //Serial1.println("AT E0");
    //Serial1.flush();
    delay(40);
    Serial1.println("ATSP6");//doesn't work and is slow (probing for protocol takes work)
    //getResponse();

I can't seem to get coolant working. When I query the ECU for 0105 I get "?" and when I query the ECU for what PID's it supports I get not supported for 0105 and 0167. Am I doing something wrong or is one of these supported, because I know I can get coolant temps using torque on my phone.

robot 07-18-2014 03:39 AM

http://www.gps-laptimer-forum.de/vie...hp?f=20&t=1364

The one jpg link in the thread is a screenshot of someone with a prog querying the ecu for what pids it supports. ECT is supported. ECT is engine coolant temp. I must be doing something wrong. I bet there is still data in a buffer or something when I start reading the coolant temp and the offset messes it all up.

stugray 07-18-2014 10:26 AM

robot,

Curious - Have you looked at using a droid phone as the interface/display unit for the arduino?
I see that there is a USB HOST library for Droid, but I havent dug into it much.
I think that would be an excellent choice for these purposes as almost everyone has an old droid smart phone laying around.

Then from the Arduino's poit of view, all IO is just through the Serial IF (no need for the UTFT lib.)

robot 08-04-2014 12:51 AM

If anyone is interested I could use some help. I'm stuck on the timing of the OBD II UART device. I sort of, almost have readings working from all of the PIDs. They just aren't working one after the other.

mabviper 08-04-2014 12:52 AM

How fast is your refresh rate? I'm polling at around 30ms period for rpm without any issues.

Sent from my Nexus 4 using Tapatalk

robot 08-04-2014 12:57 AM

Quote:

Originally Posted by mabviper (Post 1880719)
How fast is your refresh rate? I'm polling at around 30ms period for rpm without any issues.

Sent from my Nexus 4 using Tapatalk

I'm not sure that's really the issue. Maybe it is.

Depending on how I have things set up I start of with no readings and then after looping through several pages I get readings ok. OR I get readings from everything but the water temp. I'm kind of confused at the moment and should probably do some code cleanup to help things out.

I did find this...and it was extremely helpful:
https://forum.sparkfun.com/viewtopic...32457&start=60 (it's the post by rocketboy...it's basically a way for you to type commands in from a serial monitor and see the responses.)

http://forum.arduino.cc/index.php?topic=258730.0 is my call for help on the Arduino forums. I should have studied more CS in school.

mabviper 08-04-2014 01:41 AM

Anytime I have timing issues, I usually relax all timings. For CAN, the identifier ID also relates to priority. The higher the number, the lower the priority. If you're reading all values by sending out a request for each value, I suggest increasing your loop delay.

Sent from my Nexus 4 using Tapatalk


All times are GMT -4. The time now is 01:26 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
User Alert System provided by Advanced User Tagging v3.3.0 (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.


Garage vBulletin Plugins by Drive Thru Online, Inc.