Sunday 22 September 2013

Euro Truck Simulator 2 - Prototype Real Dashboard


The game Euro Truck Simulator 2 (ETS2) has a telemetry API to allow plugins access to the data about the in-game vehicle. I've created a plugin to send the data down a serial port to an Arduino microprocessor, which then controls the servos, LEDs and an LCD screen.

 This initial prototype is made from cardboard, with the components just pushed through from the back.

This is the back of the dashboard, showing the Arduino board (blue) connected to the other components.

Video of it working is here:

Update:
You can download a copy of the plugin source and a pre-built plugin here:
http://downloads.silasparker.co.uk/dashboard_plugin_2.zip
http://downloads.silasparker.co.uk/ets2_dashboard_v3.zip (New version of code)
The code is now up on Github here: https://github.com/skyhisi/ets2_dashboard

Photo of final device made from MDF, the paint finish is terrible in bright light !
Update:
Video of how it works it here:

Update:
Fixed plugin built in wrong mode. Note, you may also need to install the Visual Studio 2010 Re-distributable package from here: http://www.microsoft.com/en-gb/download/details.aspx?id=26999
 

90 comments:

  1. hello i like your dash can you send me the plugin??

    ReplyDelete
    Replies
    1. Hi, I've updated the post to include a link to the source and a pre-built plugin for Windows.

      Delete
    2. Hi, i can not make it work in 64-bit, you can help me?

      Delete
  2. Hello I love the dash but I need the pinout of display, servos,leds... Thx.

    ReplyDelete
    Replies
    1. Hi, you can see the pins used at the top of the arduino_controller.ino file in the source download zip. It doesn't matter too much what pins you use, it's sometimes easier to just wire it up and then change the software to match.

      Delete
    2. Thank you very much for your answer

      Delete
  3. can you crate a readme file or something explaining how to get your patch installed? as tried a couple of other videos, they show the system working with the Audrino, but when I tried with my Audrino then it doesn't seem to work with the servo's.

    ReplyDelete
    Replies
    1. Hi, to install the software on the Arduino, use the normal Arduino IDE to flash the board. For the plugin you should be able to just put the pre-built DLL into the plugins folder.

      To test the connection, wire up an LED (with resistor) to the indicator pins and use the indicators in the game. If the indicators work but not the servos, then the servos aren't compatible with the standard Arduino library. If the indicators don't work, then check the game log file (%USERPROFILE%\My Documents\Euro Truck Simulator 2\game.log.txt) for error messages, the Arduino must be on COM port 3.

      Delete
  4. you could show video where are placed the files from your download. His dash is very cool

    ReplyDelete
    Replies
    1. The DLL needs to go in the plugins folder (this is normally C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\bin\win_x86\plugins).

      The ino file needs flashing to the Arduino.

      The other files are the source code for the DLL in case you want to add more features.

      Delete
  5. Silas Parker,I made myself this prototype using stepper motors. If you want to get more information (eg light, temperature, fuel level, etc. etc.) What should I do? Thank you for your work.

    ReplyDelete
    Replies
    1. Hi Antonio, I've uploaded a new version of the code that I hadn't yet made public. It's the v3 file linked to in the post. This new version provides much more information through to the Arduino board.

      You will need modify the arduino_controller.ino file to use more servos or LEDs, there is a new function in the code (read_serial_byte_set_servo) to make it easy to control more servos, see line 148 for an example.

      You may also need change and rebuild the plugin, which can be done by editing and running the build.bat file from the Visual Studio 2010 command line.

      Hope this helps.

      Delete
    2. How would i make more warning lights like if lights are on or off, or high beam on or off

      Delete
  6. thanks again, now I'm changing my project with the version of the three. Later, if you want to send the video of my project.

    ReplyDelete
  7. Dear Silas Parker v3 plug-in I can not get it to work. The computer does not send telemetry to Arduino. I also tried to build the plugin as your advice but nothing. Thank you.

    ReplyDelete
    Replies
    1. Have you also installed the options file ? I've posted the code on Github now with some instructions and a troubleshooting guide here: https://github.com/skyhisi/ets2_dashboard

      Delete
  8. Dear Silas Parker, i had not actually copied the files in the folder, now it works perfectly. Thank you again.

    ReplyDelete
  9. First of all, thanks for your work!

    English is not my main language.

    I have 2 questions.

    I have a real bus's dashboard and i've tested the speedmeter and rpm meter.

    Rpm meter works fine, but speedmeter that i have, the maximum speed is 165km/h.

    So the range of speed is different and it did not match up.

    I tried modify your arduino script, but i have no idea.

    Can you tell me the modifying point of script?

    the second question , I wanna make every gauges (like a voltage, temp, air pressure and etc) move.

    Can you make another version that all data moves with servo?

    Thanks again

    ReplyDelete
    Replies
    1. In version 3 of the code, most of the dashboard dials and lights are sent to the arduino, including battery voltage, air pressure, temperature.
      Version 3 of the plugin also has an options file "dash_plugin.txt" that allows you to easily scale the values sent to the board to adjust the servo range.

      Delete
    2. thanks to your reply

      i've studied your script and made my dashboard!

      http://www.youtube.com/watch?v=94zAlCzbNE8

      thanks again!

      Delete
    3. Nice video, your dashboard looks great :)

      Delete
  10. Hello!

    I would like to ask you, what type of servo can I use for dashboard?

    Thanks

    ReplyDelete
    Replies
    1. You can use any standard model servo (http://en.wikipedia.org/wiki/Servo_%28radio_control%29) that can be controlled by the Arduino Servo library. I used micro servos like the one here: http://www.hobbytronics.co.uk/hd1800a-micro-servo

      Delete
  11. Hi
    How connect LCD to arduino? How do I hook up the LCD pins for Arduino (12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2)
    for example LCD pin D4 connect to pin 12 in arduino

    Thanks

    ReplyDelete
    Replies
    1. This is using the standard LiquidCrystal library, just connect it up as described here: http://arduino.cc/en/Reference/LiquidCrystalConstructor

      You can use any of the variations if you want to connect up fewer pins.

      Delete
    2. Is there any advantages or disadvantages in using less pins?

      Delete
    3. If you only use 4 data pins (rather than 8) it will take twice as long to write to the LCD screen. This probably won't be a problem, as the refresh rate in the plugin is only 20 FPS, but if you notice any screen errors or slow response you might need to use 8 data pins.

      Delete
    4. I have got two servo motors but when i plug them on my arduino they start spinning around. Maybe you could point me to what may be wrong?

      Delete
    5. They are probably continuous rotation servos, you will need to use 'standard' or positioning servos.

      Delete
  12. Excellent plugins, how fabulous it is
    Thanks for it :D

    ReplyDelete
  13. Do I need any special module to communicate with the game? My arduino board is Arduino Duemilanove w/ ATmega168, and how to find where is COM3 of my computer?

    ReplyDelete
    Replies
    1. You need to install the DLL for the game into the plugins folder and load the software on the Arduino. The COM port is the one that you select within the Arduino IDE for programming. If the COM port is different on your computer, you can change it in the dash_plugin.txt options file.

      Delete
    2. Thanks! Finally it works, thank you so much!!!

      Delete
  14. Good afternoon. Tell me, in your project may be used instead of the servo PWM?

    ReplyDelete
  15. I have a couple of questions about this.

    1) How did you make it talk with the game and is it possible to use with other games?
    2) How much power did it use?
    3) Can you use multiple LEDs for different things? (Like low fuel warning, air pressure etc)
    4) Is the LCD necessary?

    This seems like an amazing project which I'm going to end up making after I make my H shifter.

    ReplyDelete
    Replies
    1. This uses a plugin for ETS, so it might be able to work with other games but you would need to create a plugin or mod for the game.
      I don't think it used much power, it was running off the USB port which is limited to 500mw, the servos probably use the most power, but they aren't loaded so the current draw won't be too high.
      You could add more LEDs, the plugin and Arduino program have been extended to support the warning lights.
      The LCD isn't necessary, but I wanted something to give a precise readout so I could drive exactly on the limit and not trigger the speed cameras :)

      Delete
  16. My servos sweep backwards from right to left instead of left to right. Any idea how to get them to go the other way? Im speaking about the speedometer and tachometer. Thanks

    ReplyDelete
    Replies
    1. In the read_serial_byte_set_servo calls, change SERVO_DIR_INVERT to SERVO_DIR_NORMAL

      Delete
  17. Welcome Sorry for the language but I write with google translator. I have a few questions about your project dashboard to ETS2. Is this project works on 1.16? Overall, for me it does not work. I will explain to you what I did

    I plugged one servo to arduino Mega, to the port A0. Uploader script to the arduino. I changed the build.bat, because I have Steam on another drive. I copied it to the plugins folder and it does not work.

    If you have time please help me

    ReplyDelete
  18. tank you for this plug-in ^^
    i have a question
    how can i increase the refresh rate ? for exemple 50 FPS instead of 20 actually?

    ReplyDelete
    Replies
    1. You could increase the refresh rate by editing the plugin, but it isn't a great idea as it will slow the game down as the serial transfer will take too long. To support higher rates the plugin needs rewriting with a separate thread for the serial communication.

      Delete
    2. does not run on ETS2 mp 64 bit. and in the single player works ok

      Delete
    3. does not run on ETS2 mp 64 bit. and in the single player works ok

      Delete
    4. is there any chance you can make a 64 bit version?

      Delete
  19. Good afternoon.
    Can you see your project, but instead was a servo PWM? Then you can connect devices a real car.

    ReplyDelete
  20. Servo turning the wrong way!
    can i change the code to edit the direction the servo turns?

    can i use steppers on aitpressure, turbo, oil etc? i have the dash of an VOLVO FH truck

    thanks!

    ReplyDelete
  21. Is there any way to send the code to arduino without close ETS2? If I try do it with the game running, it just don't work. Close it every time really sucks..

    ReplyDelete
  22. hello, i have problem: ets doesn't detect arduino leonardo on port COM10. here is part of log 00:00:10.296 : loading 'dash_plugin' 'E:/SteamLibrary/steamapps/common/Euro Truck Simulator 2/bin/win_x86/plugins/dash_plugin.dll'
    00:00:14.641 : Plugin initialising
    00:00:14.641 : Plugin CWD: E:\SteamLibrary\steamapps\common\Euro Truck Simulator 2\bin\win_x86
    00:00:14.642 : Using serial port: COM10
    00:00:14.642 : Can not open COM port
    00:00:14.642 : 'dash_plugin' failed initialization with result 0xfffffff9

    ReplyDelete
  23. How to put three or more LEDs for RPM. it is very difficult ? I used the google translator :)

    ReplyDelete
  24. Good morning I'm basing myself in your project to set up a panel to me and I'm doubts about how I change the information that appears on the display and also wanted to make the gear indicator in two display 7 sec ! Thank you for taking the project and help us to ride Thank you !

    ReplyDelete
  25. I have looked into your code, but i can't figure out how the rpm and speed servo get the data from?
    - And if i wan't the fuel ratio, should i just type "read_serial_byte_set_servo(FUEL, SERVO_DIR_INVERT); " Or wouldn't that work??

    ReplyDelete
  26. How can i see which bit is from the game, like the long_beam, engine_enable and so on?
    I know the blink_indicators, but how to figure it out?
    And if i wan't to add a third servo, ex the fuel_ratio will i then just use this line?
    "read_serial_byte_set_servo(fuel, SERVO_DIR_INVERT);"
    I can't seem to figure out, where the servos get the data from.
    Sorry im a novice to arduino.

    ReplyDelete
  27. This is an awesome project! Well done!
    It inspired me to control a real dashboard which is controlled via CAN Bus.
    See here: https://hackaday.io/project/6288-volkswagen-can-bus-gaming

    ReplyDelete
  28. Hi! I've just downloaded your plugin and it seems not to work properly. When I choose my profile, the loading takes so much time and after it the only thing I can see is a cursor. Whole game freezes. If I disconnect Arduino then, everything starts working. I've already checked log file, all looks fine, plugin is loaded. Could you help me with it? :)

    ReplyDelete
  29. Hi I have been following with the theme box ETS2
    And I would make a couple of questions
    I use Arduino Mega to add more LEDs and servos
    1 might add switches! the same program and badge?
    2 And though can you give me an example
    Thank you

    ReplyDelete
  30. Hi Mate,
    Could you please help me with some code ? i have been making a replica of the default MAN ETS 2 truck dash ,Now the TFT LCD sheild i have i want it to display the same info as the in game LCD is this possible .any help would be greatly appreciated

    ReplyDelete
  31. Dear Silas, would it be possible to use your plugin to sync my flip switch positions with Arduino and ETS2? I'm building a home cockpit with Toggle switches and I'd would like to sync the in game switches (like light switches and ignition etc) with my hardware at startup.

    Thanks in advance for sharing

    ReplyDelete
  32. Dear Silas, would I be able to use your plugin to sync Hardware switch-positions with the ETS2 game upon start?

    ReplyDelete
  33. error please help me.
    00:00:23.427 : Error reading settings file: C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2\bin\win_x86\plugins\dash_plugin.txt
    00:00:23.427 : 'dash_plugin' failed initialization with result 0xfffffff9

    ReplyDelete
  34. How to addapt the plugin to display four lines of text on a 20x4 LCD?

    ReplyDelete
  35. now I have a new Mercedes, and there is control of lifting / lowering axis. if there is the possibility of adding to the program the Arduino. please help.

    ReplyDelete
  36. Please post the electronic schemematic of connection of the Components Arduino board

    ReplyDelete
  37. How i can add lights for like high beam and other warning lights

    ReplyDelete
  38. Hi! Im planing building a dashboard like this. I Just need to buy the leds, the adruino and the servos. But I want to know if it is possible to have one servo for rev burner, one for speedo and another one for fuel?
    I will use it in a real dashboard! Its possible to mach the servo with the dashboard paper?
    Thank you in avance!

    ReplyDelete
  39. tanks you ! here is what i did with your plugin :D https://www.youtube.com/watch?v=D1OmAtDfw7A great tanks to you ^^ is possible to convert the plugin to work with 64bits version of ets2 ? if yes how ? ^^

    ReplyDelete
  40. Hi, I can not make it work in 64-bit, you can help me?

    ReplyDelete
  41. Hello I have downloaded all the files and instructions to install but I have a problem to me the .dll file . It will receive data on the Arduino from the game. In the game.log.txt I have an error
    (00:00:02.413 :loading 'dash_plugin' 'E:/Spiele/Steam/steamapps/common/
    Euro Truck Simulator 2/bin/win_x64/plugins/dash_plugin.dll'

    00:00:02.422 : unable to load: 000000C1 )

    My ETS2 version is 22.2.8

    is the dll not compatible ?
    where can I get a current dll ? with virtual studio I know my way not to create a you. hope it can be helped .

    ReplyDelete
  42. Hello,
    the plugin is very good, but I have two questions.

    I wanted to put an LED for parking lights
    in the lcd wanted to change the MPH in RPM
    how can I do it?

    ReplyDelete
  43. Hello a question there is the dll even for 64 bit versin of ETS2?

    ReplyDelete
  44. Hi, I made my own dashboard few years ago and everything was perfect that time.
    After that I played a bus simulator called OMSI2 for several years.
    Nowadays, I come back to ETS2 and upload sketch as you introduced to test dashboard with ETS2.
    And I got a problem. I recorded a video.
    https://youtu.be/vAtZ_n8wJP0
    the servo moves correct value but it vibrate. I googled this phenomenon it called buzzing or shaking.
    Do you know how to solve this problem?

    ReplyDelete
  45. Hello Silas, I use the very time their api for ETS2 and I find incredible the work that you did with it, I wonder if you would like to upgrade it to 64-bit, because when I play multiplayer ETS2 its api It does not work, because now the multiplayer is only on 64-bit

    ReplyDelete
  46. hey there bud giving this ago with a arduino mega and when i upload the INO i get an error saying 'A8' was not declared in this scope the first part of it looks like this in the one i have modified


    #include
    #include

    const int SPEEDO_PIN = A1;
    const int RPM_PIN = A0;
    const int LEFT_INDICATOR = A5;
    const int RIGHT_INDICATOR = A8;
    const int PARKING_BREAK = A6;
    const int HIGH_BEAM = A9;
    const int ENGINE_BREAK = A7;
    const int LOW_AIR = A4;

    ReplyDelete
  47. hi there i made a cluster using a vr/vs commodore cluster. works fine with an arduino mega r3, just wondering if it is possible to knock up a 64bit version for ATS, if so would you either be able to create one or send me in the right direction in making a plugin and DLL.
    Cheerz

    ReplyDelete
  48. Hi

    Firstly thanks for all the info you have given and all the work you have done.

    Quick question if I may. I bought two Etronix servos when I have them attached and power on the adruino it spins the servos then power cycle. I initially thought it may have been drawing too much power from the USB but I have since used a Powered USB port and its still doing the same. Any ideas?

    ReplyDelete
  49. Hi is it possible to changt the KPH to RPM on the LCD display

    ReplyDelete
  50. hello
    I'm trying this out but I'm having trouble with the Telemetry plugin, I made sure the arduino was on COM3 and that I have the 32-bit version running. Copied the files exactly as you explained but still not working, no communication between the plugin and the Arduino.
    Should I already have something pre-installed for the plugin to work or what am I doing wrong, I followed every step and watched multiple YouTube videos but nothing worked.

    Kind regards

    ReplyDelete
  51. Hi Silas, thank you for creating this amazing plugin. I have a single question. I saw that you explained to someone how to add more gauges such as the fuel gauge, but I didn't really understand it. I understand that there is the line "read_serial_byte_set_servo", and underneath that there is one that says "skip_serial_byte" What line do I put in to add a fuel gauge. Also, is this all I have to add or do I have to edit more of the code? Thanks!

    ReplyDelete
  52. Hi Silas, thank you for creating this code for everyone to use. I have one question that I'm confused about. I don't know much about coding, so how do I add in your program to control a servo as a fuel gauge? Thanks!

    ReplyDelete
  53. Hey Silas. This is just great Work you have done. About the Visual Studio 2010 Re-distributable is for win 7 as i can see. how dos it Work for win 8.1 ? i see that the file not suportet for the Windows 8.

    ReplyDelete
  54. thanks for this..

    but i have a problem. in game.log.txt there is an error : "can read com13"
    I have changed COM3 to COM13, because to Arduino used COM13 on my PC.

    any solution?

    ReplyDelete
  55. hi,
    tank you for this plug-in/
    do you have plug-in for ats(american truck simulator)?

    ReplyDelete
  56. Hello English is not my forte.
    Congratulations on your very beautiful work.
    I'm using V3 http://downloads.silasparker.co.uk/ets2_dashboard_v3.zip (New version of code).
    When I call read_serial_byte_set_servo (brake_air, SERVO_DIR_INVERT); // brake air the led flashes left to stop. Could you give us a hint?

    ReplyDelete
  57. Hello,
    nice plugin so far.
    But how do i change something.
    For example: in the Arduino file there is the HighBeam, i want to shoe LowBeam also. How can i do this.
    Thanks for your help.

    ReplyDelete
  58. Hello,
    I have problem with plugin. When I start the game and load my profile, the game freezes and i have to restet my arduino to unfreeze it. When i turn my indicator arduino desn't turn led on.

    ReplyDelete
  59. Hello, How can I add more dash lights to the code and how can i use the actual dash indicatos instead of servos?
    Thank You.

    ReplyDelete
  60. Someone has the assembly scheme, I'm having difficulty getting the lcd to work

    ReplyDelete
  61. Hi Silas,

    I hope you see the message...
    First of all, congratulations for this awesome project and thank you for providing it for free.
    I've been assembling it and there's something I'm not sure about.
    How could I add the fuel and others gauges?

    Thank you in advance!

    ReplyDelete
  62. Hello, I just noticed this, in ur rig u have a turn signal lever. Did u get that from a specific seller or is it just from the dashboard?

    ReplyDelete