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
Problems with the Parallax 2-axis joystick
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Problems with the Parallax 2-axis joystick
- Attachments
-
- 27800a.png (577.04 KiB) Viewed 839 times
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Problems with the Parallax 2-axis joystick
Please post a photo showing how you have it wired. to the Arduino.
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Re: Problems with the Parallax 2-axis joystick
Just like on the Parallax website- DuaneDegn
- Posts: 141
- Joined: Thu Aug 02, 2012 1:39 pm
Re: Problems with the Parallax 2-axis joystick
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.
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.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Problems with the Parallax 2-axis joystick
The GND and I/O connections are correct. But you need to use the 3.3v for the positive voltage on the Due.
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Re: Problems with the Parallax 2-axis joystick
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?
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 (607.46 KiB) Viewed 747 times
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Problems with the Parallax 2-axis joystick
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.
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Re: Problems with the Parallax 2-axis joystick
I tired the next set of pins but I got the same results, where do I go from here?
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Problems with the Parallax 2-axis joystick
Is it just the left/right values that are maxing out, or is it the up/down too?However it is giving me max values for right (1023) for about 45° while the min values are more accurate,
- DuaneDegn
- Posts: 141
- Joined: Thu Aug 02, 2012 1:39 pm
Re: Problems with the Parallax 2-axis joystick
How do the side to side numbers look if you keep the joystick centered up and down as you move side to side?
I see Adafruit carries an alternative to the one you're using.
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?
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.
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.
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.where do I go from here?
I see Adafruit carries an alternative to the one you're using.
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?
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.
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.
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Re: Problems with the Parallax 2-axis joystick
adafruit_support_bill wrote:Is it just the left/right values that are maxing out, or is it the up/down too?However it is giving me max values for right (1023) for about 45° while the min values are more accurate,
Actually they're slightly right heavy, the left values are more accurate.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?
- isaactc
- Posts: 6
- Joined: Fri Aug 28, 2015 12:17 pm
Re: Problems with the Parallax 2-axis joystick
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.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: Problems with the Parallax 2-axis joystick
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.
Please be positive and constructive with your questions and comments.