16 bit JoyStick general help getting started

Hello. I am new to the Arduino life. I have looked at them for years and finally got an Elegoo R3 for a starter.

One thing I would like to do is build a set of controls for a helicopter sim. I have a set of real life controls for a Huey that I will build gimbals for and put to use.

I have some experience with the electronics end of things and basic programming.

So with this project I plan on using hall sensors on the axis. The first hurdle is the fact that this stick only moves around 30 degrees. So I'm assuming that it will benefit from as much resolution as I can give it. As a comparison the commercial controls I have are 16 bit on the x and y axis.
I know I will need a different board, maybe the Leonardo? These boards or only 10 bit so I am again assuming I will be needing a 16 bit ADC.
Once I get squared away with some guidance as far as what is needed to achieve this goal I can make plans how to move forward.

Thanks
Menessis

A resource:
https://flightsimdiy.com/

After much "googling" later I came across this.....MLX90393 Wide-Range 3-Axis Magnetometer. 16 bit!

Has anyone tried this one out?

Thanks
Menessis

There are many examle sites. Adafruit has a lot of cautions.

Anyone know where I can order a diametric ring magnet in Canada. All the US places want to charge me 40 something bucks for delivery!

I just got an ADC 1115 up and running. Tied into an UNO 3. Some thing doesn't seem right though.
I'm using the basic Singleeded.ino example file.

I have an A1324 hall sensor input in slot 3 and the full 5 volts on slot 2.
This is a sample of the output:
AIN3: 13046 2.45V
AIN2: 26403 4.95V

So it's not getting the full 5 volts but more importantly why am I not seeing an output closer to 16384? I suspect it's because it would require the 6.144 vcc to see the full range?

Will the map function fix this?

I'm using 2 magnets, one on either side of the sensor that rotate on the end of a shaft. Once I get this part working correctly I will move on to trying out some different configurations for the magnet/hall sensor.

Thanks for any and all help!

No. If you want maximum resolution then set the gain to 1 and use a voltage divider on the input to scale the 5V to 4.096V.

Thanks Jim. Didn't think of that.
I do need max resolution. The cyclic only moves 30 or 40 degrees.

So I dug out a pot to use. Dialed in 4.08 v. on a separate board. Moved it over to the project board and gave it a go without changing the gain yet. Nothing coming out of the ADC? So I put a meter on and it shows .922 v. What the hell?

I don't get it! :frowning_face:
Here's a pic....maybe some one can spot it. I have pulled the Red vdd lead off the ADC before I turned it back on with the meter to take the pic. And removed the lead from the + rail to analog 2 imput.

So 5v from Uno goes to the trim pot and the output from the trim pot feeds the + rail on my bread board. Unused inputs on the ADC are grounded ( white wires) with the exception of the ALRT.
The pot has the red feed, orange ground and another red to feed the + rail.
The red, blue and yellow are the hall sensor...yellow is signal.
The yellow lead from the pot goes to the meter and the ground is the blue (top right).

That will never work.
Unless the device you are trying to power only draws a very small amount of current, using a pot almost always never works.

The voltage drop across the pot will vary depending on the current draw of the ADC and hall device. These currents are not constant so the voltage to the devices will also change.

Besides, both the hall and adc need a regulated 5V.

Hi Jim.
So should I use the pot to feed the 4.08 to just the hall sensor?

No, ADC and hall are powered with 5V
Set the ADC gain to 1
Use a voltage divider on the hall output to scale the 5V output to 4.096V.

A 3K and 12K resistor will scale the 5V to 4V and makes the calculations easy

12K/15K = 0.8
0.8 x 5V = 4V.

16 bit ADC with 4.096 reference with 4V input should be around 32000.

Thanks again Jim.....again it didn't occur to me to divide just the output! Kinda obvious though...lol

I will get on that tonight.

Not really. The way way you had it originally would be the obvious way.

Hey Jim

WoW....through a lot of tinkering. I dug up a 15k res for the R 1 side and 10k, a 3k and a 330 ohm res. for the R1 side of the divider.
So now it's showing the high as 3.95 v out of the sensor and 31606 and the low is 0.01v - 113. And this is about 90deg turn on the shaft.
I read somewhere that a small cap across the hall sensor would help smooth out the noise.


This is what the electronics will be for.

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