1. 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 Download Package Now!
  2. 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
  3. We have a few rules which we would ask you to comply with. Following these rules will keep the support forum clean and your stay here pleasant. Read the forum rules.

DIY Pedals & Buttons Controller

Discussion in 'DIY peripherals' started by TOPMO3, Jul 30, 2016.

Share This Page

  1. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    Hi all!

    Just want to share my new project - pedals & buttons controller.
    It can be used for DIY buttons boxes, button rim plates, pedals, hand brakes, gear shifters, etc, etc — everywhere you need joystick/gamepad interface with PC.

    Device capabilities:
    • 6x 12-bit (4096 steps) axises
    • up to 11 rotary encoders
    • up to 36 buttons
    • 1kHz exchange rate with PC, which meens 1ms maximum latency for axises
    TBH, specs not so bad ;)
    For example, 4096 steps for axises if better then Logitech G27 (256 step) and Fanatec Elites (1024 steps).
    And 1kHz rate is also very good, it means 1ms latency for axises (G27 has 2ms latency, Fanatec Elites has 16ms and DSD 12 bit controller with integrated load cell has 20ms)


    For the project I choose little STM32F103C8T6 minimum development board. Its more powerfull and cheeper then Arduino. For example, here is brief comparison with Arduino Leonardo board
    post-1259-0-08612400-1469266220.png
    One big drawback is that you need additional external programmer. But its not expensive also, total price for mini board + programmer is still comparable with Arduino clones.

    Pics of these little things

    post-1259-0-24702500-1469262296.jpg post-1259-0-49304600-1469262304.jpg


    I bought both items on aliexpress.com, search for «STM32F103C8T6 Minimum System Development Board» and «ST-Link v2 mini», for example this and this.

    Schematics of the board

    Pinout is fixed (currenly):


    post-1259-0-00689100-1469266347.png


    Buttons should be wired in matrix, its columns have to be connected to COL1 — COL6 pins (C13,C14,C15,B12,B3,A7), rows — to ROW1 — ROW6 pins (B3-B9).

    Encoders’ outside «bit» pins have be wired together — left pins of all encoders together and right pins of all encoders together. Then connect lefts to ROTA (B10) and rights to ROTB(B11). Middle pins of encoders have to be wired to ROT1-ROT11 pins.

    Analog pins ADC0 — ADC6 used to connect potentiometers. You can notice there are 7 pins but only 6 axises — its because ADC5 and ADC6 have combined output (maximum one). If you doesn’t need it, just connect only one of them.

    Please note — unused analog input should be grounded!

    For better (hopefully) understanding I made a picture:

    PBC.jpg

    You can find pictures in better resolution, code and firmware itself in the github project.

    Direct link to firmware

    If you wonder, how to flash frimware to the the board, you can refer to the my post
    • Like Like x 6
    • Useful Useful x 2
    • Informative Informative x 1
    • Creative Creative x 1
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. PiaMan

    PiaMan Active Member

    Joined:
    Aug 2, 2015
    Messages:
    129
    Location:
    Saskatchewan, CANADA
    Balance:
    120Coins
    Ratings:
    +61 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, SCN5, Arduino
    awesome project. I think i may order a board and programmer and try it out. I want to get rid of my hacked up site joystick i am currently using for my pedals to clean up aesthetics.

    thanks!
  4. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    @PiaMan, yes components are cheep enough just for try it out.

    Testing the controller with DXTweak and G27 pedals (better to watch in full screen and HD):



    forgot to leave TODO list:
    - make PC based configure app which allows to choose different number of encoders/buttons/axises
    - make PCB including integrated load-cell amplifier
    - add support of another controls like rotary switches, on/off toggles. etc
    • Like Like x 2
  5. EduardoMoreira

    EduardoMoreira New Member Gold Contributor

    Joined:
    Jul 5, 2016
    Messages:
    4
    Balance:
    - 13Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino
    Great project man...thx for sharing...
    it would be possible to create a firmware that accept a pov switch?
  6. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
  7. zigzag49

    zigzag49 Active Member

    Joined:
    May 27, 2014
    Messages:
    251
    Balance:
    258Coins
    Ratings:
    +213 / 2 / -0
    My Motion Simulator:
    2DOF, Arduino
    Thank you for your project.
    I can not find the Arduino code in github project, if you could tell me.
    :blush
    Thank you
  8. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    Hi @zigzag49 ,

    the firmare is not for Arduino, but for stm32f103 mini dev board. Its binary file (ready to upload), but if you would like to take a look on a the source code, you can find it github project
  9. zigzag49

    zigzag49 Active Member

    Joined:
    May 27, 2014
    Messages:
    251
    Balance:
    258Coins
    Ratings:
    +213 / 2 / -0
    My Motion Simulator:
    2DOF, Arduino
    Ok thank you I confused .
    I'll look in more detail ;)
  10. cazsan

    cazsan Member

    Joined:
    Oct 1, 2015
    Messages:
    30
    Occupation:
    Programmer
    Location:
    France
    Balance:
    244Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    Arduino
    This project look interesting, I'm following closely
  11. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    1,917
    Location:
    Marseille - FRANCE
    Balance:
    17,052Coins
    Ratings:
    +1,795 / 16 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    That's new around her!
    Congrats! and thanks for sharing
  12. WowaDriver

    WowaDriver Waldemar Jost

    Joined:
    Mar 4, 2014
    Messages:
    59
    Occupation:
    Bachelor of Science and Engineering
    Location:
    Hannover
    Balance:
    1,000Coins
    Ratings:
    +40 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, JRK
    Awsome news! Thanks for sharing!! I will try it out thanks a lot!
  13. razzor13bt

    razzor13bt New Member

    Joined:
    Jan 10, 2017
    Messages:
    24
    Occupation:
    automotive technician, sales manager.
    Location:
    Durban, South Africa
    Balance:
    150Coins
    Ratings:
    +4 / 0 / -0
    thanks for this project. works a charm. have some buttons to replace that are not working but it was a lot easier to get working compared to the Arduino version :)
  14. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    Glad to hear it works :cheers
    Currently I'm writing app that will allow to configure a type of pins on the fly, so hopefully it will easer to use it (soon :))
    • Like Like x 1
  15. obobo

    obobo Active Member

    Joined:
    Nov 8, 2016
    Messages:
    249
    Location:
    France
    Balance:
    1,185Coins
    Ratings:
    +75 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    fancy 2000 don't post in every thread with "nice build" to get coins !!
    • Agree Agree x 1
  16. razzor13bt

    razzor13bt New Member

    Joined:
    Jan 10, 2017
    Messages:
    24
    Occupation:
    automotive technician, sales manager.
    Location:
    Durban, South Africa
    Balance:
    150Coins
    Ratings:
    +4 / 0 / -0
    TOPMO3 i have a problem.
    I had to reassemble the button box as some buttons where not working and my supplier also mixed up a few n/c buttons in my order.
    sorted out the buttons to be all n/open and all working.
    Now my issue is none of the buttons will work :(
    The encoders work fine.
    The 2 shifter buttons are working but show the same button number in the game controller properties.
    Hope you can advise and possibly show me where i have gone wrong.
    my layout attached. Wiring_Schemeshiraz.jpg
  17. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    Hi @razzor13bt
    You know, your layout seems correct to me. Can the problem lie on a hardware side - i.e bad connection/soldering etc?
  18. razzor13bt

    razzor13bt New Member

    Joined:
    Jan 10, 2017
    Messages:
    24
    Occupation:
    automotive technician, sales manager.
    Location:
    Durban, South Africa
    Balance:
    150Coins
    Ratings:
    +4 / 0 / -0
    sat late this afternoon with it.
    Resoldered with new thicker wire, not the wire breadboard jumpers the electronics shop supplied.
    also used a multimeter and checked continuity and also put it on ampmeter to use to bridge terminals on the board.
    noticed occassionally a light lit up on the game controller display, was when i bridged col6 with row1 or row2.
    Turns out its the same light that lights up when i touched the row 1 or 2 terminals. cant recall properly but it was number 27 or 29 in the game controller display.
    Will try again tomorrow evening after work.
  19. razzor13bt

    razzor13bt New Member

    Joined:
    Jan 10, 2017
    Messages:
    24
    Occupation:
    automotive technician, sales manager.
    Location:
    Durban, South Africa
    Balance:
    150Coins
    Ratings:
    +4 / 0 / -0
    The ARM is being powered by a usb cable connected to a usb hub with a 2amp 5v supply.
  20. razzor13bt

    razzor13bt New Member

    Joined:
    Jan 10, 2017
    Messages:
    24
    Occupation:
    automotive technician, sales manager.
    Location:
    Durban, South Africa
    Balance:
    150Coins
    Ratings:
    +4 / 0 / -0
    I had a chance today to work on it. spent last 3 hours checking everything.
    I only get the following buttons to work as per pinout pic in the 1st post.
    As mentioned before all 4 encoders work.
    I get b4-row1 working with col1-c13, col2-c14, col3-c15, col5-b3, col6-a7.
    col4-b12 does not work.
    row2, row3, row4, row5, row6 all do not work with any of the columns.

    Have to try and get off work to go and buy another board in case it is the faulty part.
  21. TOPMO3

    TOPMO3 Member

    Joined:
    May 12, 2015
    Messages:
    95
    Location:
    Russia
    Balance:
    1,305Coins
    Ratings:
    +152 / 0 / -0
    well, its really strange. If you don't use analog inputs (A0-A6), I can make firmware which will utilize them for row1 - row6 for you.

Share This Page