preload preload preload preload

DIY Shift Lights and Dashboard

Hey everyone!

Here I am again with another DIY project for racing sims. It’s very similiar to my previous “DIY Dashboard” project but far easier to get things done.

Dashboard display

Dashboard display

I’m using a piece of hardware that I found on DealExtreme that has 8 7-segment digits (2×4 display actually), 8 green and blue LEDs and 8 tactile buttons. You can check the display on the link below:

http://www.dealextreme.com/p/8x-digital-tube-8x-key-8x-double-color-led-module-81873?item=2

It’s only 7 bucks and you can do a lot of with it. It’s driven by the TM1638 IC. Luckily, a guy called Ricard Batista created a very nice Arduino library to communicate with such IC. Extrememly simple to use and works like a charm. You’ll need this library for the project, so download it from the link below and install to your Arduino library folder:

http://code.google.com/p/tm1638-library/

You can find more documentation about using the TM1638 and Arduino here:
http://tronixstuff.wordpress.com/2012/03/11/arduino-and-tm1638-led-display-modules/

The Arduino source code I’m providing at the end of the post requires you to connect the display to the Arduino like the following:

Arduino wiring

Arduino wiring

ERRATA: On the picture above, where it says “STB1″, it’s actually “STB0″

If you have to, you can change the wirings to suit your needs, but then don’t forget to change the TM1638 constructor in the Arduino code to mach the pins.

That’s pretty much it for the handwork. Quite easy, no soldering, no protoboards, few wires.
The next thing to do is to upload the sketch available in the RAR file at the end of the post to your Arduino board and run the C# client, also included in the package.

The C# client is responsible for getting the iRacing API data and send it through serial port to the Arduino. The Arduino firmware than reads the serial port and power the LEDs as needed. I’ve also added a “debug mode” to the C# software so you can test everything without having to launch iRacing. To connect with iRacing, it uses the iRSDKSharp.dll, created by fellow iRacer Scott Przybylski, which is included in the RAR (inside the “bin” folder).

C# Client running debug mode

C# Client running debug mode

Eveything is open source.

Here you can check a video of the piece working:

The contents of this project is distributed as “donationware”. If you find them useful, please consider doing a small donation.

DOWNLOAD: http://www.fergonez.net/files/shiftlights.rar

  • 22 responses to "DIY Shift Lights and Dashboard"

  • david
    10:13 on May 25th, 2014

    Hello Fergo,
    I’m just an arduino beginner and i Wonder if it is possible to read any other data from your api client, such as race time remaining, laps remaining, average and last lap time.
    My idea is to provide on a simple 16X2 lcd screen many data not easily reachable during race, these data sent to arduino board.
    Thanks for your feedback

  • aldo soeprayogi
    2:19 on July 21st, 2013

    can you make it for RBR and Live for speed?thank you

  • André Reese
    8:29 on April 30th, 2013

    Hello,

    first, thank you for this great tutorial and your code ! Ive modified the arduino-code a little bit. Now the shift info is calculated based on the rpm and the colors are now from green to red. Like that i can shift my gt exactly at 6500. Thanks again.

    Unfortunatley from time to time the c-client seems to have some trouble listening to the api. In that cases it sends no usable data to the arduino even if it is connected to the api. Could anybody modify the client to reconnect in these cases ?

  • jiroe
    18:11 on April 20th, 2013

    You inspired me to build one :P
    i got it running within half an hour.

    can you explain the codes for the functions that you have used?
    i would like to change around the rpm LED colors.

  • シャネル 財布
    0:20 on March 30th, 2013

    I am really impressed with your writing skills and also with the layout on your blog.
    Is this a paid theme or did you modify it yourself? Anyway
    keep up the nice quality writing, it is rare to see a great
    blog like this one today.

  • Fernando Oieno
    20:26 on February 13th, 2013

    vc e brasileiro cara? po me adiciona no facebook ai, estou comecando a mecher na parada de eletronica e estou a um passo pra fazer esse projeto…so que eu nao tenho conhecimento nenhum em ARDUINO nem em programacao nada de nada hahaha
    uma ajudinha ai?

  • juanchiooo
    12:43 on December 2nd, 2012

    please can get this for rfactor? thanks

  • Zach Frazer
    0:59 on October 2nd, 2012

    Hey if someone could help me on how make this please send me an email, i have an arduino nano and have all the stuff to make it just need help on what do to do. email threw Iracing. Thanks

    Zach Frazer

  • Nikos
    6:12 on September 18th, 2012

    Have you ever think of shrinkify your project??? Have you seen that video?
    http://www.youtube.com/watch?v=30rPt802n1k
    Do you think something like that is possible?
    I just ordered my hardware & will start building mine in a few days. Thanx for sharing your code btw!

  • ludo
    23:54 on August 9th, 2012

    Hello,
    thank you for your job.

    Please can you say me how a obtain a KMH speed instead MPH ?

    thank you again.

    • pinetree
      15:58 on August 22nd, 2012

      Have a look in the iracing forums:

      A guy names Matthew K Johnson posted some new code
      http://members.iracing.com/jforum/posts/list/125/1847021.page

      if you want to do it on you own, just edit the arduino code, in the section where the speed is read out from serial communication just add:

      spd = floor(spd*1,609);

      You need to change spd variable from byte to integer since it now can get larger the 255,

      you also might need to include math.h for the floor function

      • Eduardo
        18:09 on May 3rd, 2014

        Hey
        Thanks for the code and debug, it was really helpful.

        To change from MPH to KPH

        just add this,

        spd = (spd / 0.62137);

        it is easier than use the floor function

        need to change de spd from BYTE to INT

        Cheers

  • pinetree
    18:50 on August 6th, 2012

    Hi Fergo,

    thanks so much for you tipps, waited 6 weeks for the delivery from dealextreme, and now it only took me about 15minutes to get it running.

    Would you please include the newer version of the iRSDKSharp.dll because the one in your package doesn’t not work anymore (it says connected but no data.)

    I believe this one worked with the current release (s3/2012)
    http://members.iracing.com/jforum/posts/list/1474031.page

    • Eduardo
      18:09 on May 3rd, 2014

      Hey
      Thanks for the code and debug, it was really helpful.

      To change from MPH to KPH

      just add this,

      spd = (spd / 0.62137);

      it is easier than use the floor function

      need to change de spd from BYTE to INT

      Cheers

  • Fernando
    2:13 on July 25th, 2012

    hello I got my arduino nano v3 and my TM1638, but i don’t know much about this things… i think the hardware is working fine at least, i manage to work in the iRacing “debug mode”… can you please help me out put it working in game?

  • Daniel
    2:33 on June 21st, 2012

    Great article! I don’t have an arduino myself yet, which board do you recommend to get?

  • Richard Goodwin
    16:42 on June 8th, 2012

    I have just ordered the parts for this. Going to give it a go. I hope I can get it to work! :)

    • fergo
      17:38 on June 8th, 2012

      I’m sure you will =)
      If you ran into problems, just post here or in the iRacing topic that I’ll be glad to help.

      • Richard Goodwin
        15:44 on June 21st, 2012

        Hi mate. Got my stuff. I downloaded your C# client and plugged the boards in as directed. Nothing happens though. Do I still need to code?

        • Alfred Köhn
          15:14 on November 8th, 2012

          Hallo kann mir einer helfen ich bekomme das Display wie oben im Bild sehen einfach nicht zum laufen brauche bitte hilfe oder gibt es eine genau anleitung danke

          • Alfred Köhn
            10:40 on December 25th, 2012

            Hallo kann mir keiner helfen ich brauche eine genaue Anleitung wie ich die stecker belegen muss please help thanks..

      • Matt key
        22:14 on August 25th, 2013

        Hey whats up guys. i ran into a little problem when setting it up, my led’s seem to work but my LCD’s don’t. The left LCD displays an 8. that’s it. even when i load a different code onto it it still displays an 8. if you have any idea please help me.
        Thanks Matt

  • Leave a Reply

    * Required
    ** Your Email is never shared