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

wanting to build a shift light and control

Discussion in 'SimTools compatible interfaces' started by bsft, Jul 28, 2013.

  1. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hello all, I would like to build a single shift light with a pot to adjust its rev setting to go on my existing motion simulator.
    I think I need an arduino, obviously a BIG led, a pot as well....
    What else is there?
    Could someone please advise me of a simple build?
    Thanks, David.
  2. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    16,111Coins
    Ratings:
    +1,016 / 10 / -1
    Hi David, I would be willing to give you some support in the electronics and Arduino code, but lacking some knowledge as to how to get the current rpm from the game - does the new sim tools even support that?
  3. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I think the existing code that Eaorobbie and Aaronndc have put together will work.
    But what do I need? Which ard? do I need any other bits?
  4. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    16,111Coins
    Ratings:
    +1,016 / 10 / -1
    Can you point me to their post? I have had a quick look and couldn't find anything?

    As for what you need... assuming I understand your requirement... not much really, a basic Arduino uno would do it (probably overkill in fact). One way would be to connect the center pin of the pot to one of the Analogue inputs and the other two pins to +V and GND. Connect the LED to one of the Arduino output pins with a 470ohm resistor (value dependent on LED) in series to +5V. The rest would be done in software assuming that the RPM is sent via the Arduino uno over the USB Serial.

    (Note if the BIG LED needs too much current it might need a transistor in between the Arduino output and the LED so as not to damage the Arduino.
  5. aarondc

    aarondc Member

    Joined:
    Jun 12, 2013
    Messages:
    133
    Location:
    Melbourne, Australia
    Balance:
    193Coins
    Ratings:
    +7 / 0 / -0
    Are you getting rev info from the game, Dave?
  6. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Apparently I can, I dont know much more.
    I am hoping someone can advise me.
  7. aarondc

    aarondc Member

    Joined:
    Jun 12, 2013
    Messages:
    133
    Location:
    Melbourne, Australia
    Balance:
    193Coins
    Ratings:
    +7 / 0 / -0
    You will have a rev range, 0 -- say 12,000 rpm.
    const int kMaxRevs 12000;

    Your pot, attached to an analog input gives you (depending on Arduino) a range of 0..1023.
    const int shiftControlPin A0;
    const int shiftLEDPin D7; // LED attached to this pin
    Read the pot and when it changes, store the new value in a variable (int shiftValue;).

    newShiftValue = analogRead(shiftControlPin);
    if (newShiftValue != shiftValue) {
    shiftValue = newShiftValue;
    shiftRevs = map(0, 1023, 0, kMaxRevs)
    }

    When you receive rev info, compare it to your shiftRevs and set a digital pin, connected to your LED via a resistor HIGH:

    if (gameRevs >= shiftRevs) digitalWrite(shiftLEDPin, HIGH); // turn on the LED
    else digitalWrite(shiftLEDPin, LOW); // or turn it off

    You might be able to do this in one line like this instead:
    digitalWrite(shiftLEDPin, (gameRevs >= shiftRevs));


    The sketch Rob and I wrote only handles axes, not any other data, so it would need to be modified to handle that scenario. If someone can tell me how this non-axis data is transmitted I can update the sketch.
  8. 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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    A new update is on its way fella's with (cross me fingers) dashboard support hopefully complete with variables like flag support, speed , gears , rpm , etc from memory 20 odd variables that can be configure the way you need. I had working code to do this in the old software, here we just needed bits added to our plugins to export such data. Not sure exactly how the new update will work, we will have to wait and see.

    In the old software we could set non force variables like rpm, speed and gear as axis and send this via uso , very simular to the way we now capture the axis for motion. Thinking we are going to be able to this in a simular way.

    So please give this some time Yobuddy is hard at work coding the new version to be released soon we hope.

    Yes you are correct on the way to handle this but we are hoping to capture the shift light variable from the game itself, make it a lot more real when a shift light turns on in the graphics the same thing happens on the dash or mod, but with games that wont support this variable doing it via the rpm map and using the pot to adjust the rpm for shifting will be the only choice.

    Once we have the update the initial code wont take long to produce a demo model, and I am sure it will be improved on and expanded by all.
    This hold a strong interest for me too. I have a dash just awaiting a recode to run in sim tools.

    http://www.youtube.com/watch?v=J1pOGK2x2S0
  9. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Thanks Fellas, but I only got half the answer.
    What parts do I need?
    Its all fine and dandy saying I need an ard, but which one?
    Please remember that the person writing this is a NNNOOOOOOOOOOBBB. And I need more specific info on parts.
  10. 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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Ok what is needed to build what you want,

    Me I would use:

    1x Freetronics Eleven or an Arduino Uno R3 - Jaycar - http://www.jaycar.com.au/productView.asp?ID=XC4210
    1x 10k single turn pot.
    1x Freetronics N-MOSFET Driver & Output Module - Jaycar - http://www.jaycar.com.au/productView.asp?ID=XC4244
    1x patching wire to connect everything.
    1x Cars Taco shift light , or a light to be driven, 20amps at 12v max.

    Basically the circuit that is needed to be created will have the pot connecting to a 5v,gnd,analog input , this will control at what rpm the shift light will engage on. Secondly the N - Mosfet will driven high from the Arduino and be connected to a 12v source up to 20amps and have its output connect to a std shift light stick from a taco. If wiring diagram is needed just ask, will post and as soon as this becomes an option in the new software, I can generate some basic code.
    No worries.
  11. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Thanks Rob, if you get time to post a wiring diagram and basic code I would appreciate it.
  12. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,657
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    23,875Coins
    Ratings:
    +2,037 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Rob, i love your shift light and want a baby from you lol:)
    I am looking forward to see more of it when the next big thing is out there.
  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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Heres a basic diagram just need to actual wire and test myself but awaiting for the new update to complete, and test my theory.

    Untitled Sketch 4_bb.png

    Note Draft untested, at your own risk. Until I can test or someone confirms. Thanks.

    In turn I feel a better option would be to use 15nb pvc pipe as a shift light tub and place 3 leds in the nose to the desired colour and a simple end cap on the other end, with resistors wired in series with the leds this should not require the n drive to run it.
    And thinking out of the square, RGB Leds could be used and driven with a pwm pin we can then have 3 separate stage lights like green for start of shift, blue for the exact rpm to shift on and red ya gone to far shift or blow the motor.

    Mmmmm , yes need to add this to my dashboard.
  14. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    ok i got the bits for normal led use, so what do i wire up please?
    3 leds, green, yellow and red.
  15. 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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Give me a hour,
    Will pot wiring and demo sketch as a pure test of pot control of leds.
  16. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Thanks man, love ya work!
    I will wire the bugger up tomorrow then.
    Now to figure out how to actually program the thing.
    I am a complete noob at this.
  17. 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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Shift Light.png

    Ok so from what you see above , I propose using 3 leds to control the point you wish to shift at, feel free to change colours.

    A pot is used on an Analog pin to control the rev amount that you want to trigger the leds.

    Aim is to use the green as a get ready and have yellow change with another 100 rpm then red when its 250 rpm past.
    And have the pot be able to change the magic number for an adjustable shift change.

    If you or anyone require something else, just post away.
  18. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Woohoo!
    Thanks for that, I will start putting him together tomorrow.

    As for something else, yes please.
    A code. How do I get that in place.
  19. Nath Older

    Nath Older Member

    Joined:
    Mar 17, 2014
    Messages:
    95
    Occupation:
    Laboratory Supervisor
    Location:
    United Kingdom
    Balance:
    271Coins
    Ratings:
    +29 / 1 / -0
    My Motion Simulator:
    2DOF
    Just bringing this up, would it be possible to put say 12 LED's in there say 8 green and 4 red, and have them light up in a line, like an F1 steering wheel Rev counter ?
  20. 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,464Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Yep can be done, you can string them together with a couple of shift registors and then from a 3 wire connection control the leds, with Revs from GameDash.
    So yea possible.
    For example a DIY Dash that I built ages ago and now have running under GameDash.

    2012-09-17 21.54.59.png