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)

robot 06-03-2014 02:04 AM

[ame="https://www.youtube.com/watch?v=Mp4lk7zH-tg"]Dual bar modular arduino obd gauge - YouTube[/ame]

There is an issue with color changing only changing part of the bar's color...I'm working on that now.

(Also, all of the colors are configurable...so in the config file on the sd car I can change them to whatever...maybe in my next video I'll show that.)

aeon 06-03-2014 02:13 AM

Okay i think i'd take this anytime over displaying it on the 7 segment clock

Gesendet von meinem HTC One mit Tapatalk

robot 06-03-2014 02:30 AM

There we go:
[ame="https://www.youtube.com/watch?v=ggMrQ_KHyXE&list=UUXQz23trpy-vaCZrUAbSCTQ"]Dual bar modular arduino obd gauge themeing - YouTube[/ame]

I should give that color scheme a patriotic name.

The graphics are a little jumpy. This is probably because I'm using a random number generator to generate the values and that makes them jump around. I think i'll make a new "fake"/test harness sensor that only jumps a max of 5 units each direction each time and if it reaches the max or 0 will rest to 0.

stugray 06-03-2014 02:36 AM

Very nice!

I have been working on a very similar device but had no need for CAN or OBD.

Mine is for logging & displaying data in a racecar.
It also uses an Arduino Mega and a 2.8" LCD.

The basic requirements for mine are:
Log serial data (RS-232) from an Innovate system
LC-1 AFR and TC-4 4 channel EGT/CHT
Log Engine RPM from coil (old style tach signal)
Log various analogs
throttle position
oil temp
oil press
batt voltage
Control a small number of loads
Shift light
Alarm light
Display readable data to driver (oil temp/press, AFR, EGT) at low rate.
Trigger alarms and alert driver via Alarm light.

I have all of that with code working and logging data to a SDcard.
My latest upgrade was to be a 2.8 TFT Touchscreen, but I am having trouble getting it to work.

I also intend to experiment with a carbon fiber housing for my display when I am done.
If we agree on a common platform, we could coordiante some.

I chose the sparkfun arduino shields because I drive by their warehouse every day.

Do you have a link to the display you are using in the examples above?

robot 06-03-2014 02:40 AM

I'm using the ebay varietal of this: http://www.adafruit.com/products/358

I'd love to incorporate your code for the LC-1. You are welcome to whatever I have on my Github repository. I'll warn you, it is messy and written by someone who decided to get a Cog Sci degree and not a CS degree.

robot 06-04-2014 01:56 AM

The config file now looks like this:

Code:

splash:autox.bmp

#all of the config items for a page have to be kept in order or defaults might be use (at best)

#colorscheme use these colors -> yellow, red, green, black, blue, white, magenta
background:black
outline:red
fill:red
textdefault:blue
alert:white

#monitorlist - a list of sensors to monitor constantly and switch to if there are issues
#monitorlist:3
#sensor1:oiltemp
#sensor1pin:10
#sensor1alert:300
#sensor1:oiltemp
#sensor1pin:10
#sensor1alert:300
#sensor1:oiltemp
#sensor1pin:10
#sensor1alert:300

#pin config
#sensorName:pin
#legal sensor names:
#        oiltemp
#        oilpressure
#        boostpressure
#        temperature
#        accelx
#        accely
#        obdoiltempf
#        obdoiltempc
#        obdbrzoiltempc
#        obdbrzoiltempf
#        obdspeedkph
#        obdspeedmph
#        obdvolts
#        obdcoolant
#        obdafr //not yet
#        obdmaf //in grams/sec
#        obdiat //in deg C
#        fake
#obd sensors don't have pins associated with them

#page (aka mode) config
#as many pages as you want...the sketch will flip through until EOF and start again
#each sensor is configured per page
#obd sensors don't have pin assignments after them
#page types:
#        twobar - two horizontal bar graphs with text
#        onebar - one horizontal bar graph with text
#        cross - cross chart for accelerometer
#        round - 1 round gauge for one sensor
#sensor*text can be about 8 chars long on the one sensor pages...a little longer on the others (due to font size)
#There is a "fake" sensor...give it a pin number that is the max value you want...allows for easy testing.

#a page called logging will log the given parameters and display the first 4 as plain text
#because of the way logging closes and opens a file...make sure logging is always the last page...
#pages after logging will be skipped
pagetype:twobar
sensor1:fake
sensor2:fake
sensor1pin:300
sensor2pin:100
sensor1text:Oil Temp
sensor2text:Water
sensor1max:300
sensor2max:100
sensor1alert:190
sensor2alert:0
sensor1units:F
sensor2units:F

pagetype:round
sensor1:fake
sensor1pin:300
sensor1text:Oil T
sensor1max:300
sensor1alert:190
sensor1units:F

pagetype:round
sensor1:fake
sensor1pin:250
sensor1text:Oil Pressure
sensor1max:250
sensor1alert:200
sensor1units:Psi

pagetype:onebar
sensor1:fake
sensor1pin:300
sensor1text:Oil Temp
sensor1max:300
sensor1alert:250
sensor1units:F

pagetype:onebar
sensor1:fake
sensor1pin:21
sensor1text:Boost
sensor1max:21
sensor1alert:19
sensor1units:Psi

pagetype:round
sensor1:fake
sensor1pin:21
sensor1text:Boost
sensor1max:21
sensor1alert:20
sensor1units:Psi

pagetype:logging
sensor1:fake
sensor2:fake
sensor3:fake
sensor4:fake
sensor1pin:300
sensor2pin:200
sensor3pin:250
sensor4pin:100


robot 06-04-2014 02:01 AM

My todo list includes:
-design and build accelerometer display
-clean up graphics
-buy sparkfun obd II device (And test and debug)
-decide if slowing down the animation of the displays is a good idea or not
-add peak displays
-write code to actually log to the sd card on the logging mode (I figure I'll set it up so if the user lingers on the logging page for more than 10 seconds it will start to log.)
-background all sensor check for warnings...then display and alert to those

I got button presses working for page turning tonight:
[ame="https://www.youtube.com/watch?v=JIIwZtxxgqY"]Modular arduino TFT gauge mode switching - YouTube[/ame]

Simon99 06-04-2014 02:04 AM

Would there be a way to replace the clock by a tiny gauge ?

Sent from my SGH-I337M using Tapatalk

robot 06-04-2014 02:21 AM

Quote:

Originally Posted by Simon99 (Post 1777043)
Would there be a way to replace the clock by a tiny gauge ?

Sent from my SGH-I337M using Tapatalk

Sure, I don't see why not. I mean with time and $ anything is possible :D

I bet that there is one circuit board back there that does the clock, the flashers, and the airbag lights. The hard part will be cutting the clock out without harming the other stuff. After that I think it's just a small area with some tinted plex/plastic and you could always put your own thing back there.

mabviper 06-04-2014 08:01 AM

That was my primary choice for placement as well. I'm nowhere near your development progress though. It's still on an alpha build and I'm using STM32 micros. Hopeful before the end of the year, a prototype will be done. I'm still working on an improved shift light thing for the car. :(

Sent from my Nexus 4 using Tapatalk

marcoaferrer 06-04-2014 06:30 PM

subd

do you have a diagram on how you wired this up to your arduino. Im not very experienced arduino, I have an uno but have barely used it. but I do know how to follow instructions and work with the code a bit.:thanks:

robot 06-04-2014 06:47 PM

Quote:

Originally Posted by marcoaferrer (Post 1778658)
subd

do you have a diagram on how you wired this up to your arduino. Im not very experienced arduino, I have an uno but have barely used it. but I do know how to follow instructions and work with the code a bit.:thanks:

Wiring is all in the source code for the arduino mega to the lcd (it uses high speed SPI).

Code:

//pin reference for tft from;
/*http://webshed.org/wiki/18tftbreakout
 eBay Board        Adafruit Board        Arduino conections
 VCC        VCC        5V
 BKL        LITE        GND on eBay, 5V on Adafruit
 RESET        RESET        8
 RS        D/C        9
 MISO        MISO        12 (50 for mega)
 MOSI        MOSI        11 (51 for mega)
 SCLK        SCLK        13 (52 for mega)
 LCD CS        TFT CS        10 (53 for mega)
 SD CS        CARD CS 4       
 GND        GND        GND
 */

The mega is weird because it uses different pins for SPI stuff than the standard arduino. I'm using a mega because I included so many libraries that the "sketch" got over the 32k size limitation. The mega uses a bigger chip. It also has multiple serial hookups, so that means you can do uart serial stuff to something like the obd II device at the same time you log to a serial console, which is handy.

Sensors go to whatever analog input on the board you configure them for. The OBD II thing I have yet to buy wires into a Serial connection on the board (the arduino mega has more than one...I have it set at Serial1 now). The obd thing I plan on buying shortly is this: https://www.sparkfun.com/products/9555

I also just realized I didn't put the github link up before: https://github.com/stirobot/arduinoModularTFTgauges

Also, last night I got some peaks displaying on the bar charts and I started spacing stuff out for the accelerometer display.

I also started looking into using acrylic to make cases...so I can put this in my car in a prototype sort of way. Something like this:
http://madlabindustries.com/shop/pro...lic-mega-case/
or this
http://www.instructables.com/id/Home...-LED-Displays/

I also updated the first post to make more sense.

marcoaferrer 06-04-2014 07:07 PM

awesome man thanks for all the info.

If would be sick if we could get someone here on ft86 with a 3d printer to make a custom case :D

mabviper 06-04-2014 07:16 PM

If you get stuck on the CANbus stuff, maybe I can help out.

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.