# Binary analog stick input?

Discussion in 'Sensors and Actuators' started by Xephlon, Aug 1, 2018.

1. ### Xephlon

6
0
Aug 1, 2018
First of all I apologise if I'm posting in the wrong category.

I'm working on a project where I use switches to change the values of an xBox analog stick. So one switch would turn on x, another y, -x and -y. I'm not 100% sure how to do this so if I could get some outside inspiration that would be great. Thanks

2. ### kellys_eye

4,276
1,146
Jun 25, 2010
The analog stick will have some form of resistance (value) for the extremes of the axes which will have to be replicated at the switches of your 'digital' joystick.

i.e. the values of x and y need to be measured for the relevant stick positions and the mechanical switch you use has to 'put' those resistances into circuit when they are operated.

But since the resistances are usually only used to generate a voltage, you might find that the extremes of (analog) joystick movement are represented by simple +5V and 0V values - in which case just wire the switches to the relevant supplies.

3. ### Xephlon

6
0
Aug 1, 2018
Thanks for that. So I need to replicate the power flow of each analog stick position by emulating the same amount of resistance?

4. ### kellys_eye

4,276
1,146
Jun 25, 2010
Not specifically resistance. It may be easier with resistors IF the actual X-Y position voltages are 'weird' i.e. 4.3V and 3.7V (two random figures chosen as an example) but they may equally be 0V and 5V which can be derived quite readily from most logic interfaces.

5. ### Xephlon

6
0
Aug 1, 2018
Ok, but could I just use the raw 5v output from the controller's pcb?

6. ### kellys_eye

4,276
1,146
Jun 25, 2010
Yes, but you really need to discover what the actual voltages are at the extremes of each axis movement of the analog controller to be sure.

7. ### Xephlon

6
0
Aug 1, 2018
Ok, so just with a multimeter i guess. Also, how would you emulate the -x and -y axis?

8. ### kellys_eye

4,276
1,146
Jun 25, 2010
The axis go from -x (bottom?) to 0 (joystick middle position) to + (top?).

If the span is set by the logic supply voltage (i.e. 5V) the -x will be 0V midpoint will be 2.5V and +x will be 5V.

So..... -x will be 0V (ground) and +x will be +5V. There is no way to simulate any intermediate position without having a varying voltage but since you aren't calling for anything other than the extremes then 0V and +5V would be the answer (IF 0V and 5V represent the extremes - measure them and find out!)

Each axis has its own voltage span - they are usually both 0V to 5V. It's only the way the wiring is done that differentiates between the two i.e. the X axis goes to one input, the Y axis to another.

9. ### Xephlon

6
0
Aug 1, 2018
Thanks so much for the help. One last thing though; would I need to run power through the circuit to emulate the 2.5v (or equivalent) that is the midpoint so the axis is centred?

10. ### kellys_eye

4,276
1,146
Jun 25, 2010
If you want to have a 'centred' signal then yes, you will need the mid-point voltage from some source - have you established what the actual voltage span is yet?

11. ### Xephlon

6
0
Aug 1, 2018
Not yet, but I plan to. Thank you so much for the help