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 DIY load cell brake pedal (short tuto)

Discussion in 'DIY peripherals' started by RacingMat, Nov 26, 2014.

  1. JayZ83

    JayZ83 New Member

    Joined:
    May 25, 2020
    Messages:
    23
    Balance:
    152Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    Arduino
    Hi Tony.
    I had experiencing the same things.
    first order of INA122P worked perfectly.
    Second order of INA122PA . Never work. In 5V could only lower to 1.6 max. And won’t work under 3V .

    Seems is nothing about whether is a PA or P.
    The seller send me a so called “imported “ chips. INA122PA . Which works perfectly as INA122P as my first order.

    Maybe someone could soled this problem with this funny chips.

    My suggest will be change to an imported one.
    Saving lots and lots of problem.
  2. I9k[toro]

    I9k[toro] New Member

    Joined:
    Aug 6, 2020
    Messages:
    6
    Occupation:
    engenharia mecanica
    Balance:
    - 23Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, SimforceGT
    Trigen
    hi, which of the files do you
    I made it available for use for the pedals I must use
    i will use on arduino leonardo
    if I had something written wrong it was the google translator
  3. Trigen

    Trigen Active Member

    Joined:
    Nov 25, 2018
    Messages:
    472
    Balance:
    2,826Coins
    Ratings:
    +176 / 1 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    Copy this code.


    Ive been having and issue with the pedals waking up the computer and after some support we figured out it was the setAXIS calls. I have updated the code to include an if statement so that the call to set Axis only happens when its not equal to resting pedal. Its important that you use the println to check what your pot numbers are and input the correct ones in the
    Code:
    int lastBrakeValue = 0; 
    and so on

    https://github.com/MHeironimus/ArduinoJoystickLibrary
    https://github.com/bogde/HX711

    Code:
    #include <HX711.h>
    #include <Joystick.h>
    #define calibration_factor -2300 // Do your calibration first. default 2300
    #define DOUT  3
    #define CLK  2
    HX711 scale;
    /*
    For the true false flags, use this list. Its all in  Joystick.h
        bool includeXAxis = true,
        bool includeYAxis = true,
        bool includeZAxis = true,
        bool includeRxAxis = true,
        bool includeRyAxis = true,
        bool includeRzAxis = true,
        bool includeRudder = true,
        bool includeThrottle = true,
        bool includeAccelerator = true,
        bool includeBrake = true,
        bool includeSteering = true);
      */
    Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
      JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
      false, false, true, false, false, false,
      false, true, true, true, false);
     
     
    // Variable
    int throttle = A0;
    // int brake = 2; / no need for this as we read directly from scale
    int clutch = A1;
    
    // **** INPUT YOUR VALUES HERE **********
    int brake = 0;
    int lastBrakeValue = 0;
    
    int throttleValue = 0;
    int lastThrottleValue = 270;
    
    int clutchValue = 0;
    int lastClutchvalue = 180;
    
    // init joystick libary
    void setup() {
      // Ranges are 1023 by default
       Joystick.setBrakeRange(0, 1023);
      Joystick.setThrottleRange(0, 1023);
      //Joystick.setZAxisRange(0, 1023);
     
      Joystick.begin();
      Serial.begin(38400);
     
      scale.begin(DOUT, CLK);
      scale.set_scale(calibration_factor);
      scale.tare();
    }
    void loop() {
    
    // ***** USE THESE TO CHECK YOUR POT VALUES IN SERIAL MONITOR ****
    
        //Serial.println (brake);
        //Serial.println (throttleValue);
        //Serial.println (clutchValue);
    
    
    // For the if else if statements below. Set these to match your numbers as instructed.
    // If the value starts below 0 set it to 0. Or if its above 10 set it to 0
    
    
    // ******** THROTTLE ***************
    
      throttleValue = analogRead(throttle);
     
         if (throttleValue > 666) {
        throttleValue = 670;
      }
        else if (throttleValue < 273) {
        throttleValue = 270;
      }
        if (lastThrottleValue != throttleValue) {
         Joystick.setThrottle(throttleValue);
         lastThrottleValue = throttleValue;
      }
       delay(1);
     
    // *********  BRAKE **************
    
    brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
     
       if (brake < 0 or brake < 8) {
        brake = 0;
      }
     
       if (lastBrakeValue != brake) {
         Joystick.setBrake(brake);
         lastBrakeValue = brake;
      }
      delay(1);
     
    // ********** CLUTCH *************
    
       clutchValue = analogRead(clutch);
     
         if (clutchValue < 185) {
        clutchValue = 180;
      }
        if (lastClutchvalue != clutchValue) {
         Joystick.setZAxis(clutchValue);
         lastClutchvalue = clutchValue;
      }
      delay(1);
    }
    
    • Like Like x 2
    • Informative Informative x 1
  4. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    Good day! Can someone help me with troubleshooting my ina122pa board? Cant seem to get input from the loadcells. Here is my board, could someone please tell if it's correctly built thanks...

    129016241_1321363711544360_4497748221821059847_n.jpg

    now, i dont have access to a multimeter, but ive tried all configurations of the wires from the load cell. still nothing. this is for the logitech driving force pro. any advice?
  5. Erik Middeldorp

    Erik Middeldorp Member

    Joined:
    Sep 15, 2018
    Messages:
    50
    Occupation:
    sheet metal worker
    Location:
    Auckland, New Zealand
    Balance:
    606Coins
    Ratings:
    +45 / 0 / -0
    It looks correct to me. I'd suggest you get yourself a cheap multimeter to help troubleshoot.
    • Like Like x 1
  6. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    Thanks for responding. Yes ive decided to order a multimeter online.
    Also a couple of things that i noticed, i had the logitech window open while testing it, once i connect the 3 wires from the pedal to the circuit, brake goes 100% no response from load cell. if i re arrange the wires of the load cell, sometimes what happens is the throttle only goes half way when fully pressed. i wonder what that means. anyhow, ill just wait for my multimeter and see if i can manage to troubleshoot (very basic knowledge in electronics, just learning from google as i go)
    thanks again ill post my progress soon
  7. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    hi all, i still cant figure out whats wrong with my amp. i did some measuring with a multimeter:
    first the pots on my logitech dfp- when everything is connected each pot shows 3.8v. i measured the throttle pot and it goes 3.8v to 0.5v (0-100%) the brake goes the other way 0.5v to3.8v (0-100%)
    is this why my ina122pa board doesnt work? does it only work with 0v-5v pots?

    other thing is when i replace the pot with the ina122pa board, then i measure the voltages it goes down half 1.9v for each. and the brake is stuck at 100% so im guessing what ever voltage comes in the ina122pa board, same voltage goes out on the output pin??? no response from load cell which i already confirmed the correct pairing of wires. does this have something to do with both pedals sharing same 5v and ground?

    any advice on how i should troubleshoot is greatly appreciated

    btw my components: ina122pa, capacitor cbb22 104j630v, trim pot 3296
  8. Erik Middeldorp

    Erik Middeldorp Member

    Joined:
    Sep 15, 2018
    Messages:
    50
    Occupation:
    sheet metal worker
    Location:
    Auckland, New Zealand
    Balance:
    606Coins
    Ratings:
    +45 / 0 / -0
    It looks like your circuit is configured to output in the correct direction for the brake if the brake requires low voltage at 0% and high at full brake. I haven't tried the dfp, but with the g27, it calibrates each time you plug the wheel in, you have to push the pedals all the way down for it to set the limits. If the dfp is the same, I'd guess it should be ok with the ina122 output. Assuming you're on pc, you can test this by opening the game controllers window ( search for "Set up USB game controllers" in windows 10), plugging the wheel in and opening the controller properties and don't push any pedals. Then push either pedal slowly until the output shows. If it's self calibrating each time, it should show full output when the pedal gets to about half way if you've only pushed it half way.
    What voltages go down to 1.9V? I'd double check you're connecting the wires correctly to the ina122 circuit. Maybe try just connecting the +ve and -ve, leave the signal disconnected, connect the load cell outputs but not the power to the load cell, then measure signal to ground/-ve and I think it should be zero.
    You could also try measuring the voltage across the load cell outputs with the power and ground connected to load cell. With no load, it should be zero. With the full load if your multimeter is sensitive enough, it should read some small voltage. On mine it was around 8mV.
    I've only got quite limited electronics knowledge myself so it's hard to know what exactly might be wrong. It's possible the chip itself might be faulty.
    • Informative Informative x 1
  9. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    Thanks for a quick reply heres a picture of my board
    ina122pa board.jpg
    the voltage on the pedals is 3.8v on the positive and ground, but when i remove the connections from the brake pot, then connect it to my board, voltage goes down 1.9v. I cant figure out why. this happens whether the load cell wires (two 3-wire load cells) are connected to the board or not. if i measure the output signal wire in the middle it shows around the same also 1.9v.

    also i tried connecting the board to a usb 5v power, i get around 4.7v on the output signal wire. also same whether the load cells are connected or not. it seems like whatever voltage comes in the ina122pa, same voltage comes out on the signal pin
  10. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    my load cells are configured like this:
    red + black= 1k ohm
    red+white=1k ohm
    black+white=2k ohm

    black 1 + white 2= to power
    black 2 + white 1= ground
    red wires on the signal pins

    when they are connected to the board and i measure the voltage on a 5v power supply, both red wires of the load cells give 2.5v each.
  11. Erik Middeldorp

    Erik Middeldorp Member

    Joined:
    Sep 15, 2018
    Messages:
    50
    Occupation:
    sheet metal worker
    Location:
    Auckland, New Zealand
    Balance:
    606Coins
    Ratings:
    +45 / 0 / -0
    Sorry, I can't think of what else to try. I guess you've already tried that second chip and adjusting the trim pot?
  12. bebop

    bebop New Member

    Joined:
    Dec 1, 2020
    Messages:
    6
    Balance:
    83Coins
    Ratings:
    +0 / 0 / -0
    yes i tried both chips. my guess is their not quality chips. maybe ill try to find a way to troubleshoot the chip itself and check if it works right. very frustrating but i want to see if i can make it work, as a challenge maybe. if not i can always just use the hx711 and an arduino. anyway thanks for responding i appreciate it cheers!
  13. I9k[toro]

    I9k[toro] New Member

    Joined:
    Aug 6, 2020
    Messages:
    6
    Occupation:
    engenharia mecanica
    Balance:
    - 23Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, SimforceGT


    hello did not want to disturb you, the code when I do the verification appears error ,, HX711.h: No such file or directory
    could be what I'm using only a cellulam load of 50kg and arduino uno ATmega328
  14. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,876Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
  15. PUBWIE

    PUBWIE New Member

    Joined:
    Jan 11, 2021
    Messages:
    11
    Balance:
    78Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    Arduino
    Hi guys

    I'm completely new to this cicuitry and wiring thing,
    Second time to ever solder anything and now a little lost after building the INA122 amp.

    * How do I wire the thing to the arduino?
    * Which pins on INA122 go where on Arduino?

    Thanks in advance!

    I'm using this circuit layout which was provided by cteters
    See attached file DIY INA122pa amp wire.png

    Mine
    DIY INA122 - mine 3.jpg

    Here is what I have in front of me:
    [​IMG]



    Pro Micro reference

    Attached Files:

    Last edited: Jan 27, 2021
  16. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,876Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    S is the Signal from the load cell that you need to connect to the arduino pin that will convert the Analog Tension to Digital values (DAC)

    5V is taken from the arduino 5V pin to power the INA
    Ground to Arduino Grond Pin: mandatory
    [​IMG]
    yours
    Mat
    • Informative Informative x 1
  17. PUBWIE

    PUBWIE New Member

    Joined:
    Jan 11, 2021
    Messages:
    11
    Balance:
    78Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    Arduino
    Thanks for the quick reply Mat.

    I'm extremely unknowledgeable with electronic terms.
    To give you an idea of how I see this stuff, would this be what you mean?

    4-cell
    RacingMat - 4 cell + amp + Arduino.png
    3-cell
    RacingMat - 3 cell + amp + Arduino.png
    Last edited: Jan 28, 2021
  18. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,876Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    • Informative Informative x 1
  19. I9k[toro]

    I9k[toro] New Member

    Joined:
    Aug 6, 2020
    Messages:
    6
    Occupation:
    engenharia mecanica
    Balance:
    - 23Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, SimforceGT
    @RacingMat
    good terde I used the hx711 and it didn't work I intend to use ina122pa according to your post
    * doubt in your post has two 1e2 scheme which one should I use?
    * in the first photo there are two cells to make the wheatstone bridge I have to press both to work or just one of them
    note: my cell load is so three wires
    red + black 1000
    red + white1000
    black + white is not normal?

    imagem 1
    2 load cells.jpg


    imagem 2
    26711-0dacb25cf49b17b590e570ffaabc772c.jpg
  20. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,876Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino