Problems with the Parallax 2-axis joystick‏‏

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

Item code: 27800
Adafruit invoice #859404
I bought from Adafruit 2 joysticks and I ran a simple sketch from my arduino due that outputted their up/down/left/right positions on a scale from 0-1023.

int UD = 0;
int LR = 0;

void setup() {
Serial.begin(9600);
}

void loop() {
UD = analogRead(A0);
LR = analogRead(A1);
Serial.print("UD = ");
Serial.print(UD, DEC);
Serial.print(", LR = ");
Serial.println(LR, DEC);
delay(200);
}

What I found out is that the up/right values are pegged at 1023 from basically 5 degrees to about 60 degrees (see diagram not to scale). They both displayed this error and the action is rough like it's grinding through this arc. This won't work for my purposes.

I don't know what the issue is or if I need to return them. Please advise

Thanks
Attachments
27800a.png
27800a.png (577.04 KiB) Viewed 839 times

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with the Parallax 2-axis joystick‏‏

Post by adafruit_support_bill »

Please post a photo showing how you have it wired. to the Arduino.

User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

IMAG0273.jpg
IMAG0273.jpg (270.61 KiB) Viewed 804 times
Just like on the Parallax website
http://learn.parallax.com/KickStart/27800
Joystick-6.png
Joystick-6.png (86.88 KiB) Viewed 804 times

User avatar
DuaneDegn
 
Posts: 141
Joined: Thu Aug 02, 2012 1:39 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by DuaneDegn »

I bet you're powering the joysticks with 5V right?

The DUE is a 3.3V device and I assume this also means the ADC can receive 0 to 3.3V input.

Try powering the joysticks with 3.3V and if the ADC still work your results should be closer to what you expect.

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with the Parallax 2-axis joystick‏‏

Post by adafruit_support_bill »

The GND and I/O connections are correct. But you need to use the 3.3v for the positive voltage on the Due.

User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

I wondered that since it was an Arduino Due and I was powering it with the USB, that the joystick wasn't getting enough power so I plugged in the 12V wall charger but it was still giving me the wrong values. But it was the 3.3V pin that corrected the errors.

However it is giving me max values for right (1023) for about 45° while the min values are more accurate, is this just how these joysticks operate?
Attachments
27800b.png
27800b.png (607.46 KiB) Viewed 747 times

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with the Parallax 2-axis joystick‏‏

Post by adafruit_support_bill »

The joystick doesn't need a lot of power to operate. It is just a pair of variable voltage dividers. The voltage on the output will range from near zero to whatever voltage you power it with. The maximum voltage that a Due pin can handle is 3.3v. Anything over that will register as full-scale (1023) and could potentially damage the pin and/or the Due's ADC.

User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

I tired the next set of pins but I got the same results, where do I go from here?

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with the Parallax 2-axis joystick‏‏

Post by adafruit_support_bill »

However it is giving me max values for right (1023) for about 45° while the min values are more accurate,
Is it just the left/right values that are maxing out, or is it the up/down too?

User avatar
DuaneDegn
 
Posts: 141
Joined: Thu Aug 02, 2012 1:39 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by DuaneDegn »

How do the side to side numbers look if you keep the joystick centered up and down as you move side to side?
where do I go from here?
The most obvious direction is to get a higher quality joystick. These little joysticks can have really bad pots. It's not surprising since they're so inexpensive.

I see Adafruit carries an alternative to the one you're using.

Image

Maybe someone at Adafruit could provide information about the quality of the pots in the joystick pictured above.

If you're willing to spend more money, there's something like this?

Image

It's not cheap but it's really nice. I have a pair of these myself and if you'd like, I'll check out the quality of the pots.

Another joystick I like is described in this Let's Make Robots blog post.

Image

The above photo includes a base I added to the joystick. I like this one a lot and it's less expensive than the Parallax one mentioned above. Again, if you'd like, I'll check out the pots.

Some joysticks (including the last two I mentioned above) have pots which can easily be replaced. If you had one of these then you could substitute your own pots (of the appropriate size) if the pots which came with the joystick weren't good enough for your purposes. Replaceable pots would also reduce the issue caused by pots wearing out since they could be periodically replaced.

User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

adafruit_support_bill wrote:
However it is giving me max values for right (1023) for about 45° while the min values are more accurate,
Is it just the left/right values that are maxing out, or is it the up/down too?
Duane Degn wrote:How do the side to side numbers look if you keep the joystick centered up and down as you move side to side?
Actually they're slightly right heavy, the left values are more accurate.

User avatar
isaactc
 
Posts: 6
Joined: Fri Aug 28, 2015 12:17 pm

Re: Problems with the Parallax 2-axis joystick‏‏

Post by isaactc »

Thanks for the suggestions Duane Degn, I'd move up to the Gimbal Joystick with Adapter if I were pro level, but it's a bit much to spend for my current needs.

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Problems with the Parallax 2-axis joystick‏‏

Post by adafruit_support_bill »

If it is just the right/left values that are off, then it is probably a bad pot. Please contact [email protected] with a link to this thread for a replacement.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”