What all will I need to purchase?

I am trying to get an analog joystick input for any generic joystick converted into a PWM signal and I want to do this with an Arduino. I’m new to Arduinos, however, and I would like to know everything I need to buy in between the joystick and speed controller.


I'm just curious why you would want an anlog input into a pwm output? I thought the only use for pwm outputs was that it simulated an analog output.

You only need an arduino to do this if the analog input's range is from 0 to 5 v. Connect analog input to arduino analog pin and echo out the pwm output through an arduino pwm pin.

Trying to get a joystick (single joystick, two axis) to control two bi-directional DC motors.

Also, I'm not really an electronics, wiring or programming guy (I'm more of a mechanical guy).

What little electronics I am familiar with in this 'field' use PWM input (the speed controllers I'm used to, Victor 884s), and joystick input is always fed through a microcontroller before being output as a PWM signal.

I was thinking standard Arduino board and a Motorshield v3?

Mike, the Vector884 specs calls the signal PWM but they refer to Standard Radio controlled signal, which as actually PPM You can't use the Arduino PWM output but you can use one of the Servo libraries to and connect a digital output to the speed controller without any other components See these threads: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232572239 http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226292633

The motor control is not the problem; the joystick input is. Unmodified PC analog joysticks use potentiometers set up as variable resistance instead of voltage dividers. This means you need to measure resistance; if you use the joystick as half of a divider, it will be nonlinear and you'll need to do math. If you charge a capacitor through the joystick resistor....it'll be nonlinear and you'll need to do math. You also need to handle calibration

On the other hand, a lot of PC joysticks are easy to convert to voltage dividers with a little simple rewiring of the potentiometers. I've done this a few times with good results.

I would also recommend re-wiring the PC joystick into a potential divider. It's normally a 100k Ohm variable resistor, and reading it in any linear manner will be tricky. A constant-current circuit that puts a few micro-Amps through it would work, but would be more complicated than re-wiring.

If you really must use an un-modified PC-compatible joystick, let me know and we'll see if we can come up with a circuit!

I actually just completed this same task for my robotics team at school. Links coming in next post.

The joysticks I am using are basically potentiometers for each axis. I just used a female joystick connector hooked up power (+5v) to the power joystick pins and then hooked the signal pins into the analog inputs. The potentiometers give me between 0-5v depending on their position and therefore give me 0-1023 for analog inputs using analogRead(). You may have to check if the joysticks you are using are standard game port pinouts using a volt-ohm meter.

I ended up having to use a TLC5940 chip to provide extra pwm outputs. Using the TLC5940 arduino library from http://code.google.com/p/tlc5940arduino/ and the forum listing here http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1218174457 I was able to easily output up to 16 pwms. The TLC5940 can be ordered from TI directly as a sample just to try then buy more if needed. I hooked the PWM outputs from the TLC5940 into h-bridges to then control the dc motors.