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

Speedcontrolled Fans integrated in TM1638 Dash

Discussion in 'DIY peripherals' started by Schluzu, Jun 4, 2014.

  1. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    Hello Fellas,

    i´m using this simple Dashboard and im realy happy with it.:thumbs
    i want 2 use 1 or 2 rc-impellas with a brushless ESC.
    why impellas?
    the response characteristic of PC-Fans is to low, and all parts are there. ;)


    so i try since 2 days to get the speed data to the Servo-Operations.:(
    either the dash or the servo works, together it won´t work.:mad:
    is anybody here who can help me with the ard-code based on sora´s code?:roll



    thx and have a nice day



  2. 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,401Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    We have this already written. ? You need to add a control to take the speed and turn it into a PWM value. And drive the pin required. Which code have you tempted to use, I can fix easily. A little more details and I can provide a working code for you.
    Are these driven like a servo a pulse(PWM) from one pin, if so easy add on.

    P.s I wrote my own as converting to hex and back causes errors in value as shown in his pic, speed is out by a bit.
    Last edited: Jun 4, 2014
  3. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    thx earobbie for the fast answer,

    yes the ESC works like a Servo.
    it is allready written, ohh ok, where can i find it?
    Sora´s code is no must for me. i found and use it :oops:


    cu
  4. 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,401Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
  5. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    THX

    and how could i include the servo operations?

    Code:
    //
    int Speed;
    int Gear;
    int Rpm;
    int RpmLeds;
    int RpmMax = 000;
    
    int buttonCheck = 1;
    int bufferArray[12];
    ////////////////////////////////////////////////////
    #include <Servo.h>
    Servo windservo;
    int valwsv = 0;
    ////////////////////////////////////////////////////
    
    #include <TM1638.h>
    
    TM1638 module(5, 4, 3);
    
    void setup(){
    
      Serial.begin(57600);
    // initialize the screen:
        module.clearDisplay();              //clears the display
        String name = "DASH";           //sets a custom Label
        module.setDisplayToString(name);    //prints the Label
        delay(3000);                        //small delay 3 sec
        ////////////////////////////////////////////////////
       windservo.attach(9);
       ////////////////////////////////////////////////////
    }
    

    is this the correct beginning/way?
    now i see i`m a absolute flake in programming ardu :sos
  6. 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,401Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    As promised.
    Tm Board set to pins as above, esc pin set to D9 on the Ard, instructions in code to change it.
    Ok the RpmMax is set at the start but can be adjusted when in game on the fly by holding max rpm and pressing button 3 on the TM.
    And maxSpeed is set to 300 in code but if car goes past 300 it will increase that till the Ard is reset. This is used to map speed from 0 to 300 - 0 to 255 meaning at 0 , fan should not spin and at 300+ it will be flat out. This is all changeable in code, ignore all the value "//" (rem out) this are other values I use so the dashboard can have many pages of information at a touch of a button.

    Attached Files:

  7. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    Many THX earobbie


    i test the code and sometimes the dash works and then not, the servo* ALWAYS twitches arround???
    *test with a servo 2 see optical what happens
    The dash, if it works, only works with these output rules:
    IRACING:
    Dash1 - Speed
    PAD 3 0

    Dash2 - RPM
    PAD 5 0

    Dash3 - Gear
    PAD 1 0

    strangely, in reverse gear (the "r" is not shown on dash, it`s blank) the kmh/rpm and the LED´s working nearly perfekt, and with luck, in 1 from 10 cases, then in forward direktion as well.

    when it works the Speedo shows around 3-5 km/h less speed then iracing.

    I tried baut rates from 9600 - 115200 - doesn`t change anythink



    so, now its time to go to bed

    cu
  8. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    hello,

    Update: i test the dash and servo in office,
    servo and dash works now, but only in reverse driving :eek:

    i think i get t to handle on.

    thx again to earobbie
  9. 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,401Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    No worries , you need to investigate what iracing is sending the to the GameDash.
    Most games send a -1 or 255 for reverse so to use my code you need to include " replace -1 9" or "replace 255 9"
    Basiclly it will as says replace the incoming figure with the figure you have choosen and outputs that only.
    Code is written for 57600.

    With the different speed that actually coming from the plugin, I cant fix that as I font have the source for the plugin, still waiting for that to be updated. One day.

    I will load Iracing later tonight and check what values it uses and produces, lol I haven't tested the dash on IRacing. Mainly use it for Race07 and AC.
  10. Schluzu

    Schluzu New Member

    Joined:
    Mar 5, 2014
    Messages:
    27
    Balance:
    37Coins
    Ratings:
    +23 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    Robbie you are my Hero

    now i works............. with the following Output-Rules

    IRACING:
    Dash1 - Speed
    PAD 3 0

    Dash2 - RPM
    replace -1 0
    Pad 5 0

    Dash3 - Gear
    replace -1 9
    Pad 1 0

    many THX

    ok now i see it works great if i programmed the ardu before.
    if i unpplug & plug the ardu only the label comes up & nothing.........
    but that doesn´t matter, i will programm the ardu bevore every iracing-session

    Attached Files:

  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,401Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    You have found the bug that's was bothering me too, a quick fix you can enter in the shutdown for the Game Dash
    R00000G0S000 at 20ms this should reset the gauges back to 0. But as I have found certain games on exit spit out some random figures , something I need to investigate more, looks like Iracing is now on the growing list, Assetto also sends a big random rpm value when it exist, a small catch was added to code for the ard, but still testing it and need to check that it is the same case for Iracing.

    For now if the Ard looks like it has hung, you can close the gamedash, and close the game manager and then reset the Ard.
    Restart the GameDash first then restart the GameManager , sorry for this inconvenience as the GameDash is still really a beta app avail to everybody to play with, I feel the outputs from some of the games that we have set dash out for need some more refining so it doesn't spit out these random large figures.

    Maybe a slight change of code in the Ard will sort the issue too. Im currently working on a add on card for analog dash building.
    The Porsche dash was a success and a Ford dash is nearly completed and it and code is nearly ready for show.
    More to come.
    • Like Like x 1