• Home of the RD Le Mans Series by Vesaro
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wiring a potentiometer to a PC???

Discussion in 'Sim Racing Hardware' started by KingNyan, Apr 14, 2015.

  1. So I was looking for a driver for my Universal Rumble Wheel but upon further testing I found that my ps2 to usb adapter is dead. So I decided to tear into this wheel and see what im dealing with. All thats their is a small board and a single potentiometer along with two more potentiometers in the pedals. I want to see if I can somehow wire this directly into my PC. I also have a Raspberry pi (along with the breadboard and stuff) if I could somehow use it at a controller for the wheel (analog to digital?) sorry I dont really have any idea what im doing here, I usually only do software. Is there any way to hook this up directly, and if I can then what program should I use to map it? http://postimg.org/image/l0qmlam31/ http://postimg.org/image/8wbd4b971/ http://postimg.org/image/c4fuhcvgt/ Sorry for the bad quality, I had to take these with my phone.
  2. Sorry but with that picture quality is absolutely impossible to see anything useful.

    Even if the board turns out to just have cables, somewhere between there and the end connector there must be an ADC that converts the voltage drop on the potentiometer to digital values.

    If by PS2 to USB you mean the old keyboard connector to usb (not the game console to usb) those adapters are dirt cheap, just buy a new one.
  3. Depending on your electronic and programming skills you could consider using the teensy3.1 microcontroller.

    It has a certain feature that allows it to be detected by the computer as a joystick, exactly what you need. Instead of a joystick, you'll just map the potentiometers to the analog inputs and convert it into readings via the teensy.

    Just google "teensy joystick" and go from there.

    If you have any additional questions please feel free to ask me and I'll try to answer them as best I can.
  4. Sorry. I forgot to add. The raspberry pi would probably not be a good solution for this "project" of yours. Since it is a microprocessor, any code you use for your potentiometers run on top of the operating system. Since the operating system has many functions to accomplish, it is often busy with other hidden processes.

    You thus cannot be sure of the response time of your system if it is running based on the raspberry pi. Needless to say this is going to be a big problem for a steering wheel system because you can't really have any delays.

    One more thing you can think about with the teensy is that it gives you the flexibility to add more data outputs like lights and all that. With your background in software, you could probably come up with your own homemade rev lights indicator or even a numeric display.
  5. True, and not true.

    With microprocessors you cannot be sure in general of responsiveness, but unless you are using the Rpi in parallel to play videos (or some other stupid thing of that caliber) its computing power should be way more than enough to keep response times well below any human perceivable delay.

    And besides, ultimately the whole thing ends up running in a microprocessor (your PC), which is actually scraping for resources because you are running a 3D game, a heavy OS and god knows how many other background tasks. And still the values from the wheel are read nicely, mostly because the required processing power for that is minimal.

    So, running on a microprocessor does not have at all to be unresponsive or unreliable. With enough clock frequency and available resources you will never tell the difference to a micro-controller.

    See for example the Rpi making 1million database insertions per second http://planetcassandra.org/blog/cassandra-1000000-insertssec-on-raspberry-pi/ or, more relevant to this topic, the GPIO pins can be sample by default at 200.000 times/s http://elinux.org/RPi_Low-level_peripherals (up to 1 million, not that it makes any difference for a human).

    If I would be programming the Pi for this, I would actually put sleep times on purpose because anything over 100 Hz is simply a waste of resources. (And guess what, I am pretty sure the raw signal is low-passed by the wheel electronics introducing a comparable delay, and nobody cares/notices).
    Last edited: Apr 23, 2015
  6. I guess that's true. Haven't seen the database insertion project that you mentioned. Interesting!

    TBH I've never done much research into using the RPi as a controller. Do you happen to have any resources that I can read up on?

    Even then, personally I'd still go with the teensy. Better power consumption, faster boot up times and better form factor that allows it to be soldered into a blank pcb, making it slightly more sturdy.
  7. Nah, I have not much on Rpi, but just cleaning up "useless" services from the linux image and using python to handle the IO should get you easy into the thousand times/s sampling + processing, enough for anything involving human interaction (probably not for generating sounds and things like that).
  8. Yea. Seems quite difficult to find any information on converting the Pi into a HID.

    Would definitely recommend either the Teensy or the Arduino Micro to the OP.
  9. Dave Stephenson

    Dave Stephenson
    Technical Administrator Staff Premium

    You might be overcomplicating it buy involving the pi. Really a usb joystick controller will achieve what you need out of the box. Bodnar sells one but there are others on the market. Should just be able to hook up the pots, and plug it in.

  10. I'd agree with you Dave, I use one of those to connect my home made shifter and handbrake. The handbrake uses a pot and the shifter has switches for up and down gear shifts.
    • Like Like x 1