1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Simple Dash on Arduino+LCD with GameDash

Discussion in 'DIY peripherals' started by TOPMO3, Jun 22, 2015.

  1. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    ===========================================
    added 10.05.2016

    just realized all pic's links are broken, corrected.
    changed wiring scheme to use A5 and 13 pins
    changed sketch to 02a version

    ===========================================
    Added 08.08.2015

    Hi All!

    I think Im done for a while with the project, so I wanted to describe functionality and made a small how-to guide

    Dash has 2 screens for output information (switch by “Screen” button):
    screen 1: RPM, Speed, Fuel left %, Gear, Lap, Fuel Burning Rate
    screen 2: Water Temp, Oil Temp, Fuel left in Liters and %
    RPM Lights and Engine warnings displayed in every screen.


    You can tune parameters (“Settings” button):
    RPM Min threshold - at which RPM leds begin to light
    RPM Max threshold - at which RPM stripe is full and after that leds will blink
    RPMAutotune - 0 or 1, details below
    Water Temp warning - at this temp the water dash will showed in RED. The dash will showed in YELLOW at 80% of this
    Oil Temp warning - same as water but for oil temp.
    Fuel % and Litres warning - same as water but for % and Litres of fuel accordingly.


    A few words about RPM shift algorithm:
    - simplest and default mode is when dash "learn" max rpm for current session and simply blinks at 98% of it. This controlled parameter RPMAutotune=1.
    - manual mode is when you can define min threshold (at which LEDs start to light) and max threshold (at which lights begin to blink). This should be useful for more fine-tuning RPM lights for different cars (RPMAutotune=0)
    - and mode based on telemetry (like iRacings` ShiftPercentPct). Currently it works only in iRacing I guess, because I don’t think any other game use this method for rpm lights (output in %%, lights should blink on 60%). I hope I will add support for other games in the future.


    Engine warnings in the form in which it exists also are iRacing only. For them, iRacing provided bit mask, which decomposes in the sketch as:
    R - Rev limiter
    W - Water Temp Warning
    F - Fuel Pressure Warning
    O - Oil Pressure Warning
    E - Engine Stalled
    P - Pit Speed Limiter


    I make a vid for more clarity


    I mount the dash in holes of my G27, this way:

    flz9czs4watc.jpg


    Ok, now to technical aspects.

    I’m using Arduino Leonardo, but UNO R3 should works nice too.

    TFT LCD is this which has ILI9341 lcd driver, so I can use standard AdaFruit libraries - Adafruit GFX graphics core and Adafruit_TFTLCD. After download you need to rename them to Adafruit_GFX and Adafruit_TFTLCD respectively (read readme.txt!) and place this libraries to your documents/arduino/libraries directory.

    NeoPixel strip is this, which works with Adafruit_NeoPixel, also need to rename folder to 'Adafruit_NeoPixel' and install in Arduino Libraries folder.

    I bought buttons in local store for less then $0.5 each. So total cost for the project for me is Ard ($10.25) + TFT LCD ($9.89) + NeoPixel Strip ($6.26) + 6 buttons (6*$0.5) = $29.4

    Wiring is pretty simple, the diagram is below:
    post-1259-0-10125800-1439524274.jpg


    I.e.:
    PIN A5 - “Screen” button
    PIN 11 - “Settings” button
    PIN 13 - “Increase” button
    PIN 12 - “Decrease” button
    PIN “Reset” - “Reset” button
    PIN 10 - NeoPixel strip DIN


    GameDash settings:

    post-1259-0-59780500-1439522442.jpg

    post-1259-0-29386300-1439522434.jpg

    Arduino sketch is attached.


    ===========================================
    Original post 22.05.2015
    Hi all!

    decided to make small project using LCD and NeoPixel strip.
    Arduino sketch based on excellent work by soraz (thanks for it!)

    still wip, tested only in LFS so far. I'm in desperate need of a iRacing plugin, begin to write the plugin by myself but not a big progress yet.
    in TODO list - second screen with more info and buttons
    Arduino sketch attached, if someone interested
    ============================================

    Attached Files:

    • Like Like x 10
    • Winner Winner x 7
    Last edited: May 10, 2016
  2. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,463Coins
    Ratings:
    +3,318 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    Hi @TOPMO3
    Great project!
    Do you know that you can gather the dash data via Game Dash? The iRacing plugin does not export any dash data but it could be added fairly easily.
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  3. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    @TOPMO3
    Excellent project!
    Really amazing work!
    Thanks for the vid!!

    If you not using GameDash, you can use it to make the input to your project standardized. (Like: Speed,Rpm,etc...) Then simply construct the output you need per game with GameDash, and your project will work with more games!

    Nice Work!
    yobuddy
    • Like Like x 1
    • Informative Informative x 1
  4. wokcz

    wokcz New Member

    Joined:
    May 29, 2015
    Messages:
    27
    Location:
    Argentina
    Balance:
    232Coins
    Ratings:
    +14 / 0 / -0
    Looks pretty nice, bookmarking it! I will probably get into building a dashboard once I finish my sim. Thanks for sharing.
  5. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Thanks guys!!
    really appreciated

    Yes, I'm using GameDash, I can't attached screenshots, but settings are:
    BitsPerSec - 115200
    Data Bits - 8
    Parity - None
    Stop Bits - 1

    Interface Output - R<Dash2>G<Dash3>S<Dash1>F<Dash6>
    R - RPM
    G - Gear
    S - Speed
    F - Fuel
    Shutdown Output - Z0000
    • Like Like x 4
  6. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi all!

    Well, I don't know how, but finally somehow I managed to write working iRacing plugin.
    I attached it, it will be great if someone else tested it!
    Zip file contains file iRSDKSharp.dll, which needs to be manually placed to plugins folder ( something like C:\Users\<Username>\AppData\Local\SimTools\GamePlugins)

    Also I have some weird behaviour in gamedash - it shows actual value of water temp insteed of dash's name "Water". All other dashes are showed nice. Made screenshot for more clear explanation of this.
    But anyway I can live with it some time.

    Untitled.png

    I believe plugin works only in 64bit game (how guys is it possible to set 2 different const _ProcessName in plugin?) and gather only dashboard telemetry.
    Dash_1 - Speed,m/s
    Dash_2 - Rpm
    Dash_3 - Gear
    Dash_4 - Fuel Remaining, %
    Dash_5 - Fuel Remaining, Litres
    Dash_6 - Lap
    Dash_7 - Oil Temp, C
    Dash_8 - Water Temp, C
    Dash_9 - Players last lap time, s
    Dash_10 - Delta time for best lap, s
    Dash_11 - Delta time for optimal lap, s
    Dash_12 - BlinkRPM

    I'm happy boy now and returning to progging my little arduino! :)
    See you later!

    Attached Files:

    • Like Like x 2
    • Creative Creative x 1
  7. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    @TOPMO3, the water name problem is probably just a typo in the plugin.
    I would be happy to take a look if you would like to post the source.
    yobuddy
    • Friendly Friendly x 2
    • Like Like x 1
  8. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    @yobuddy, thanks a lot for your help! Source code is attached.

    Attached Files:

    • Like Like x 1
    • Useful Useful x 1
  9. jschulze

    jschulze New Member

    Joined:
    Apr 18, 2012
    Messages:
    4
    Occupation:
    Designer
    Location:
    Houghton, MI
    Balance:
    245Coins
    Ratings:
    +7 / 0 / -0
    Thanks for this! Been working on a f1 style wheel and this will work perfectly!
    • Agree Agree x 1
  10. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,133
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    47,910Coins
    Ratings:
    +5,027 / 16 / -0
    I found and fixed the problem in GameDash itself. :blush
    For now a simple workaround is to change slot 8 to slot 13.

    so change "Dash_8 - Water Temp, C"
    becomes "Dash_13 - Water Temp, C"
    and just don't use slot8 at all.
    Its just the title that shows wrong for slot 8, it should work just fine...
    The fix for this will be in the next update of GameDash...

    It also looks like some of the plugin has been disabled?
    so it may only work for dash stuff?
    anyway, just a little update on what I found.
    :popcorn


    @value1,
    when and if you have time, maybe you could look at adding this dash stuff to the official plugin for IRacing?
    • Winner Winner x 2
    • Like Like x 1
  11. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Yes, it works fine this way, thanks!
    And yes, its just my draft plugin and it only works for dash stuff :)
  12. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,463Coins
    Ratings:
    +3,318 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    Nice work, @TOPMO3! Well done :cheers
    I posted an update here.
    • Like Like x 3
    • Winner Winner x 1
  13. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Thank you very much, Thomas! :)


    just want to share the little progress I made.
    I developed 3 screens,
    1st one shows - RPM, speed, fuel remaining in %, gear and lap
    2nd - water and oil temps, fuel remaining in % and litres
    3rd - last lap time, session best lap time, delte to best lap, gear and lap
    RPM LED stripe works in every screen.

    short vid (sorry for ugly quality and mouse driving guys! :blush )


    Now I'm need to take a deeper look to RPM shift lights algorithm.
    Cheers!
    • Like Like x 4
    • Winner Winner x 1
  14. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Just short update
    programmed 3 different algorithms for RPM LED lights:
    - simplest and default mode is when dash "learn" max rpm for current session and simply blink at 98% of it
    - manual mode is when you can define min threshold (at which LEDs start to light) and max threshold (at which lights begin to blink). This should be useful for more fine-tuning RPM lights for different cars
    - and mode based on telemetry (like iRacings` ShiftPercentPct). This will work only if game can provide
    appropriate telemetry of course.
    and wired 4 buttons for ability to easier changing the settings (brightness, thresholds for RPM LEDs and warning colors. etc)


    But there is a problem which I can't resolve yet. Everything working nice only after first start of GameDash. If I quit a game and then start it again - arduino no longer sees an input data and in Task Manager I see hang process of GameDash which I can't kill.
    Is it possible GameDash open a new serial connection for new game start? Should I handle Startup - Output and Shutdown - Output, i.e. open a serial connection for Startup - Output and close it for Shutdown - Output in arduino sketch?
    :sos
    • Like Like x 1
  15. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,463Coins
    Ratings:
    +3,318 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider
    @yobuddy: Can you help?
    • Agree Agree x 1
  16. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi All!

    I think Im done for a while with the project, so I edited the first post adding small tutorial
    • Like Like x 2
  17. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Hello !

    After the TM1638 dashboard I made, I'm making a new one based on your great design. I have some issues with the LCD I got from DX
    If I use the lib from adafruit you mentionned I just get a white screen. If I use the modified lib from here it improves the situation a bit: now the LCD shows garbage caracters but I cn spot Fuel, RPM spped, and other strings. When sending data to serial, it sometimes displays the value (like S0000) but most of the time crashes the sketch?
    With this updated lib, the sample graphicstest works nicely. It reports a ILI3941 as show below:

    FT LCD test
    Using Adafruit 2.8" TFT Arduino Shield Pinout
    TFT size is 240x320
    Found ILI9341 LCD driver


    I also added the testtext function from the example to your code in the setup and it worked.
    Any hints ? I' a bit stuck for now.

    Bonus question: what do you use to have this carbon-fiber look ?

    Thanks
    Last edited: Oct 5, 2015
  18. Nick Moxley

    Nick Moxley Well-Known Member

    Joined:
    Dec 13, 2013
    Messages:
    2,779
    Occupation:
    Owner/Operator- Moxleys Rantals
    Location:
    Winnipeg Manitoba Canada
    Balance:
    17,054Coins
    Ratings:
    +2,504 / 30 / -2
    My Motion Simulator:
    2DOF, 3DOF, DC motor, JRK
    • Like Like x 1
    • Agree Agree x 1
  19. TOPMO3

    TOPMO3 Active Member

    Joined:
    May 12, 2015
    Messages:
    133
    Location:
    Russia
    Balance:
    890Coins
    Ratings:
    +201 / 0 / -0
    Hi @vthinsel

    you can see Fuel, RPM, etc strings (ie "titles"), but no actual values, do I understand you right?
    Do they in correct places like in my video? If so I expect you find correct library for your LCD and issues only with data from GameDash.
    Garbage chars is most likely for Gear
    Ok, can you fisrt check that GameDash shows correct values in itself? Then try to output only one dash value (for example Speed or Rpm) from GameDash and see how its shows on LCD. If it works than try to add another value and so on. Such sequental approach can tell you what value crashed the ard.

    And what game do you using? I tested the sketch only in LFS and iRacing, so it can be easer to troubleshoot in these games. GameDash settings in the OP are for iRacing, if you need those for LFS I can make screenshots of them when I will be at home

    @Nick Moxley is right, I used cheep carbon tape. Front panel of my dash consist of two slices - there is thin aluminium plate with carbon tape placed on it under the plexiglas one
  20. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Hello,
    I haven't tried yet with a game, just using the serial console to send data and see how it behaves. The screenshot below is after sending "S0000" through the arduino console windows, which made "83" appear.
    IMG_20151006_141120[1].jpg

    If I send something like 'S0200' it crashes and reboots.
    I'm using arduino 1.6.5r5, with different libs as explained earlier. Really strange......

    Thanks for the carbon tip, I looks very nice and pro. I just odered some :)