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

Tutorial Driving DIY cluster gauges with GameDash

Discussion in 'DIY peripherals' started by RacingMat, Oct 9, 2014.

  1. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hello,

    After the giant LED gear indicator, I intend to build a big DIY cluster :)

    - Arduino
    - stepper motors : switec x27.168
    - lighted needles
    - GameDash

    61POa0iKjlL__SL500_AA300_.jpg switec x27.png $_57.JPG

    Here is a first trial video!



    It's really fine for a first test with a balsa needle, without optimization.

    To gain more speed, I'll supply the motors with 10V instead of arduino's 5V

    Why choose switec x27?
    - Because they draw really few amps: less than 20 mA so it can be driven directly from Arduino pins! :cool:
    - Because there are successfull DIY examples!
    http://guy.carpenter.id.au/gaugette/blog/2012/01/28/build-number-one/

    Some links I like to share

    an example of DIY gauges http://www.locostusa.com/forums/viewtopic.php?f=22&t=16236
    file.jpeg

    DIY instrument air-core motor www.mikesflightdeck.com/instruments
    aircore2C.jpg

    printing gauge faces www.revlimiter.net
    DSC_7329.jpg

    very nice, detailed and sophisticated project http://rksimracinghardware.blogspot.fr/
    rksimracinghardware.jpg

    from Tombo: Here i found a little Photoshop tutorial how to start with making your own cluster foil. Very easy!
    http://www.photoshop-plus.co.uk/speedometer-design-from-scratch/
    http://www.projekt-mx5.de/eigene-tachoscheiben-leicht-gemacht/

    from Tombo:

    yours
    Mat
    • Like Like x 6
    • Informative Informative x 1
    • Useful Useful x 1
    Last edited: Jun 23, 2015
  2. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Shopping List :

    • Switec X27.168
    these stepper motors are used in real cluster instrument

    a buyer guide

    the cheapest I found are on Aliexpress @2€ each
    http://www.aliexpress.com/item/5pcs...GMC-Cars-And-Trucks-2003-2006/1456148765.html

    but many can be found on eBay
    switec X27 search
    • some CMS LEDs to light the base of the transparent needle
    led spec.jpg led.jpg white 1206 smd led
    I got 50 leds for 1€60
    http://www.ebay.fr/itm/50-x-1206-White-Super-Bright-LED-SMD-SMT-Bulb-Lamp-Light-High-Brightness

    or 100x for 3$ on ebay.com

    LED Type : SMD 1206 LED
    Lens Colour : Water Clear
    Emitted Colour : White
    Peak Wave Length (nm) : 6000-7000K
    Forward Voltage (V) : 2.7 ~ 3.7
    Reverse Current (IR) VR=5V 50μA
    Viewing Angle : 130 Degree
    RoHS: YES
    Material:AlGaInP​
    Those leds are used in automotive cluster: so it will be perfect for my needs​
    • Arduino
    GameDash can only output to 1 USB ComPort. So I have to check how I'll drive my 4 or 5 motors with only one Arduino.
    - 1 Mega?
    - or 1 Uno with shifters or quad drivers?...
    • Downloading Arduino Library from Guy Carpenter
    https://github.com/clearwater/SwitecX25
    zip file

    This library is simple but elaborated as you can even tweak the acceleration depending of your needle inertia
    http://guy.carpenter.id.au/gaugette/2012/01/26/simplified-acceleration-model/
    • Power Supply
    Power supply concerns:
    - 12V is fine for LED supply and Arduino as well

    http://arduino.cc/en/Main/arduinoBoardUno
    - 1 Arduino 50 mA
    - 5 gauges lighting LED array will draw 5 x 10mA
    - 5 motors will draw 5 x 20mA

    This small PWU 12V 1A would be fine
    PSU.jpg @5$ on DX.com
    https://www.dx.com/p/12v-1a-regulated-switching-power-supply-110-220v-94519#.VEvmjBbYncl
    • Like Like x 2
    Last edited: Oct 30, 2014
  3. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Building instructions:

    backlight LED assembly

    CMS LED are really small and can be useful for this use
    CMS led.jpeg

    very good tutorial Cluster Tuning here
    http://www.dsmtuners.com/threads/how-to-light-gauge-cluster-with-leds.274519/

    Here a tutorial on How to drive LED (WS2801, WS2811 and WS2812) with Arduino
    http://www.tweaking4all.com/hardware/arduino/arduino-ws2812-led/

    Some nice resistor calculator online:
    http://led.linear1.org/led.wiz which deals with serial LEDs and write the results with a nice layout.
    -> R = 270 ohm

    LED Calculator.png

    and a good instructables about this subject
    http://www.instructables.com/id/Choosing-The-Resistor-To-Use-With-LEDs/?ALLSTEPS

    the LED are VERY small!
    I had to keep the previous LED under a wet tissu to prevent desoldering... when I soldered the next one... :mad:
    soudureLEDSMD(3).JPG

    and it's fragile, i will need a round support:
    for the first one, I glued it! with bi-components glue
    soudureLEDSMD(2).JPG

    Motors wiring
    Switec pinout.png mkp-sktsa-2051.png
    If I want to drive 5 gauges, I'll need to extend the number of digital pins...
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Nov 2, 2014
  4. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Arduino code and GameDash settings:

    Here is a great arduino library dedicated to driving switec stepper motors
    http://guy.carpenter.id.au/gaugette/2012/02/16/using-the-switecx25-library/

    Here a first code which is functional with GameDash
    Code:
    /*
    Analogic Dashboard using Gamedash and Simtools
    and Switec X27.168 stepper motor
    and Arduino with Guy Carpenter's library "SwitecX25"
    by RacingMat 10-2014
    */
    
    #include "SwitecX25.h"
    
    // void stepUp();
    // void stepDown();
    // void zero();
    // void update();
    // void updateBlocking();
    // void setPosition(unsigned int pos);
    
    int TotalSteps = 315*3;  // for example 315 degrees of range = 315x3 steps = 945 steps
    byte Rpm;
    
    
      // declare MotorRPM with total steps and related pins (4-7)
      SwitecX25 MotorRPM(TotalSteps, 4,5,6,7); // the pins are set up to Output by the library
    void setup() {
       
      // run both motors against stops to re-zero
      MotorRPM.zero();  // this is a slow, blocking operation
      //MotorRPM.setPosition(427);
      Serial.begin(115200);
     }
    
    void loop() {
    // compiler l'arduino avec le tweak sur la longueur du buffer Serial pour comparer
    
    /*  // update motors frequently to allow them to step
      MotorRPM.update(); */
    
      // do stuff, call motorX.setPosition(step) to
      // direct needle to new position.
    if (Serial.available() > 0)  {
    //GameDash send RPM as values between 0 and 254
      Rpm = Serial.read();
      Serial.flush();
      }
     //call motorX.setPosition(step) to direct needle to new position.
     MotorRPM.setPosition(map(Rpm, 0, 255, 0, TotalSteps));
      // update motors frequently to allow them to step
      MotorRPM.update();
    
    }
    
    • Like Like x 1
    Last edited: Jan 15, 2015
  5. 741852cp

    741852cp Member

    Joined:
    Nov 21, 2010
    Messages:
    62
    Location:
    china
    Balance:
    106Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor
    Start a new project:thumbs:thumbs:thumbs
  6. Scratch

    Scratch Active Member

    Joined:
    Apr 23, 2014
    Messages:
    170
    Balance:
    281Coins
    Ratings:
    +181 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    This looks interesting and affordable.
  7. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    • Like Like x 1
    Last edited: Oct 24, 2014
  8. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Switec wiring: the arduino drives the 2 poles with 4 digital pins.

    1.png 2.png

    If I want to drive 5 gauges, I'll need to extend the number of digital pins...
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Oct 17, 2014
  9. Matth.Gyver

    Matth.Gyver New Member

    Joined:
    Oct 8, 2014
    Messages:
    13
    Balance:
    208Coins
    Ratings:
    +6 / 0 / -0
    Nice project ;-)
    I follow it with enthusiasm.
  10. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    • Like Like x 3
  11. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,429Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Nice concept built a couple of theses now and retro fitted a few dashboards with steppers.
    A little hint, you can try and use stepper lib to run them from code, I found very poor movements , very bad lag.
    Good luck,
    • Informative Informative x 1
  12. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    bad news...
    did you try this specific library? or Arduino stepper library?
    • Like Like x 2
  13. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,429Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Yes I tried them all ages ago, actually had built one with the old software.

    The issue is if you have read the library's a little closer is that there call creates a blocking affect as in all code stops until that stepper has reached its desired location then the code moves on, when trying to drive more than one this causes the other to pause while it completes its move, with dials you need nice smooth control, the simplest and most effective way is with servos.
    Stepper motors require a tricky little bit of code to work correctly.
  14. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Ok!
    I'll start by trying the Carpenter's library and share what I get at first trial with 5 gauges...
    :popcorna video to come... after I would have waited for their shipping :eek:

    If the code need some tuning, I'll share my concern and maybe need some help from you! :)
    • Like Like x 2
  15. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    -> here is what I finally bought: "white 1206 smd led"
    LED Type : SMD 1206 LED
    Lens Colour : Water Clear
    Emitted Colour : White
    Peak Wave Length (nm) : 6000-7000K
    Forward Voltage (V) : 2.7 ~ 3.7
    Reverse Current (IR) VR=5V 50μA
    Viewing Angle : 130 Degree
    RoHS: YES
    Material:AlGaInP​

    Those leds are used in automotive cluster: so it will be perfect for my needs

    1206white.jpg 1206smd.jpg

    I got 50 leds for 1€60 : cheap isn't it?
    http://www.ebay.fr/itm/50-x-1206-Wh...=AU_Car_Parts_Accessories&hash=item27e6a6ae1c

    or 100x for 3$ on ebay.com


    First time, I'll solder smd components!
    • Like Like x 1
    Last edited: Oct 17, 2014
  16. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    perhaps use a bigger hammer?
    • Funny Funny x 1
  17. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    • Funny Funny x 2
  18. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
  19. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,960Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Power supply concerns:
    - 12V is fine for LED supply and Arduino as well

    http://arduino.cc/en/Main/arduinoBoardUno
    - 1 Arduino 50 mA
    - 5 gauges lighting LED array will draw 5 x 10mA
    - 5 motors will draw 5 x 20mA
    total = 2 Amp
    Last edited: Oct 30, 2014
  20. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    380
    Location:
    Dubna, Russia
    Balance:
    9,634Coins
    Ratings:
    +512 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 4DOF
    Where 2 Amp? 50+50+100 = 200 mA... ;)
    • Winner Winner x 1