Joystick recommendations?

I'm working on a project that needs a joystick, more or less like an RC car remote. Although it's rather simple, my experiences with cheap joysticks found on AliExpress or Amazon haven't been great. They work to some extent but are generally quite noisy and inaccurate. This is the one I've used in the past. I think all those that popped up when searching for "Arduino joystick" are the same one.

So I wonder if anyone has a good recommendation. I don't need high accuracy by any means. I just need it good enough to control a toy RC car. 8 bit resolution is more than enough. But I want it to be consistent. I.e. it doesn't report different values when I'm not even touching it.

A two-axis one will do. But if anyone knows a good single-axis one, I can use two of them. Actually, that's probably even better since the vehicle I'm controlling has 2 treads.

Thanks.

You are a moving target. Accurately describe your needs.

Can you show us what joysticks you have tried already, this will help in finding ones you haven't tried yet.

Thanks. Updated the post.

Ok so those are as basic as they get other than the flatter PSP style ones. And like most (if not all) resistive style joysticks, they are prone to have stick drift and not properly center.

You could go with hall effect joysticks however they are more expensive.

If you want something robust, check this link here

1 Like

Hi @delingren ,

I think it's more a question of mechanical reliabilty than electrical values.

There is e.g. one by Adafruit

https://www.adafruit.com/product/3102#technical-details

where Adafruit claims

Mechanical Lifecycle: 500,000 cycle

Just an example!

The easiest (and cheapest!) way to reduce/remove jitter is averaging over a certain amount of measurements and then reducing the resolution. This shows the principle (just a snippet! Not compiling!):

void readxAxis(int count){
   unsigned long xAxis = 0;
   int i = count;
    while (i > 0){
        xAxis= xAxis+ analogRead(A0);
         delayMicroseconds(10);
         i--;
     }
    xAxis = xAxis/count;
    xAxis = constrain(xAxis ,minRight, maxLeft);
    xAxis = map(xAxis, minRight, maxLeft,  0, 255);
  // ...

where minRIght and maxLeft are constants for the minimum and maximum value that you expect for the joystick axis. Those values are usually derived by calibration of the specific joystick to cover tolerances. count tells the function how many data have to be sampled for averaging.

Since an Arduino usually has a 10-bit ADC resolution, mapping the average value to (0..255) is like dividing by four. This is another means of smoothing the data.

Good luck!

P.S.: It takes about 100 µsec to read a value with analogRead()

On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.

Source: https://www.arduino.cc/reference/tr/language/functions/analog-io/analogread/

Depending on your timing requirements you may be able to average a sufficient number of samples or you may have to adopt one of the principles explained here
https://gammon.com.au/adc

2 Likes

Thanks. That's a good point. Since this is a toy RC vehicle, I probably don't even need 8-bit resolution. So I can smooth out the data by averaging even more measurements. I'll play with it a little bit.

One idea is to find a mid-quality gaming controller and replace its guts with an arduino (leaving the joysticks/etc.)
(poor-quality game controllers may have poor-quality joysticks, and top-quality gaming controllers are expensive.)

Maybe you can find someone who has a partially broken game controller ("I played xxx till the direct pad and right joystick were toast, but the left joystick hardly ever got used!")

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.