• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Joystick port and sensors

Status
Not open for further replies.

haydxn

New Member
Hi guys,

i'm working on a basic 'joystick' project, for connection to a joystick port.

The actual purpose is to create a 'theremin' type controller, which sends the computer 2 variable levels, which gets converted by a VST plugin into MIDI CC data. As the joystick port can handle analogue levels, i've decided it is by far the simplest approach.

Rather than do any kind of hetrodyning palava, i'm going to be using two Sharp GP2D12 infrared sensors. These operate from 5V and output from 0-5V. As the joystick port uses 5V this is ideal.

However, i'm a little unsure as to the best way to use them. I presume someone here has some kind of experience with PC joystick ports, and could shed some light on the situation.

i presume i'd need to put some kind of protection for the input of the sensors, would a resistor be sufficient?

and the output from the sensors, is it safe to connect that straight to the axis pin? i imagine it's probably safe to limit that a bit; perhaps with some kind of potential divider setup of resistors, or would it be necessary to have some kind of op-amp in there? (i imagine that would be way overkill)... or would a zener diode be a good idea?

i plan on having two of these sensors; one for each joystick axis. I'm sure it's possible to have this as a very simple circuit, with no microcontrollers or anything, what with all the ADC taking place on the computer's side of the port. how much do i need to worry about the current? i presume just using resistors is a bit of a weak idea, and has the potential to generate a bit of heat...

i'd really appreciate any suggestions from anyone here.

thanks for your time,

haydxn
 

Nigel Goodwin

Super Moderator
Most Helpful Member
The major flaw in your plan is that a PC joystick port isn't a 'real' A2D converter, and it can't read an input voltage. It uses a crude capacitor charging technique, and measures the resistance of the joystick.

In fact, the original PC joystick ports used a 555 timer to read the resistance of the joystick, with the PC measuring the width of the pulse created.
 

haydxn

New Member
that is a vital piece of information, thanks ;)

okay, so is there any way of reading this with the joystick port? for the level of the sensor output to control the resistance between the axis pin and the voltage rail?

i know that the joystick port is as crude as it gets, but this only requires a crude interpretation anyway - after all it is just waving hands about
 

haydxn

New Member
okay, i've been reading this

http://www.avtechpulse.com/papers/vres/ about making a voltage controlled current source to achieve the same thing, which seems to be what i'm looking for.

however, i'm not super excellent at interpreting the circuit diagram in order to figure out exactly what i'd need; how many components does that require, for example?

also, if anyone has experience of the joystick port, before i launch into this could someone suggest whether or not this is suitable? i'm not certain of the kind of figures required for the joystick axis pin; all i'm aware of is that it uses up to 100kOhm resistor. is that right?

i'm very sorry to seem so ignorant on the matter. i hope that someone is able to help out? thanks again
 

Nigel Goodwin

Super Moderator
Most Helpful Member
haydxn said:
okay, i've been reading this

http://www.avtechpulse.com/papers/vres/ about making a voltage controlled current source to achieve the same thing, which seems to be what i'm looking for.

however, i'm not super excellent at interpreting the circuit diagram in order to figure out exactly what i'd need; how many components does that require, for example?

also, if anyone has experience of the joystick port, before i launch into this could someone suggest whether or not this is suitable? i'm not certain of the kind of figures required for the joystick axis pin; all i'm aware of is that it uses up to 100kOhm resistor. is that right?

i'm very sorry to seem so ignorant on the matter. i hope that someone is able to help out? thanks again
You might like to have a look at my PIC joystick tutorial, the hardware I used is at http://www.winpicprog.co.uk/pic_tutorial_joy_board.htm, and it clearly states that the joystick connects between the input and 5V.

So the voltage controlled resistor in the article you posted would work fine, although it looks fairly complicated.

Do you already have the VST plugin that accepts joystick inputs?, or are you writing it? - if so you could always write it to use the serial or parallel ports instead. Or for that matter, use a PIC to create and send MIDI data directly from the sensors.
 

haydxn

New Member
i've been experimenting with pots so far on the joystick port, which have proved successful, but clearly i have misinterpreted the way it works inside (d'oh i do feel a bit silly there!)

the VST plugin will just be a simple affair reading the joystick axis positions (very easy to create) and creating the data from that. it seems to be the easiest method of turning outside-world changes into MIDI. how unfortunate that i need to get from voltage change to resistance change!

it would be great to be able to create the midi directly but i think that might be beyond me...

in the method described by the link i posted earlier, it shows the important part requiring +15v and -15v power rails... argh! is this even possible just from the power supplied by the joystick port?

it's all getting pretty complicated, isn't it.
of course i'd love to have a version that didn't require a gameport...
when i get bags of time i'd like to make a more 'intelligent' one. til then.. any more advice? :(
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top