G27/G29 Hall Sensor Mod

Thought it might be an idea to share some ideas @Neilski and I have been bouncing around about replacing the stock pots in the G27 and G29 with Hall Sensors (probably also work on a G25). We found a few discontinued options (e.g. https://www.simulaje.com/productos/accesorios/sensor-hall.html) and a current one that seemed ok but required a USB adapter (https://tomyracing.com/index.php?language=en&module=products&content=pedhallv130), which made us suspect its range might not be great and/or it didn't invert the signal. (EDIT: I didn't read the description properly! the mod can be used without a USB adapter)

So, in the interests of science we decided to get some bits and have a play. We went for the A1324/5/6 (https://docs.rs-online.com/958c/0900766b813d193a.pdf) as it appeared to have decent range of close to 0-Vcc (many are just +/-1v) and @Neilski worked out a simple arrangement that theoretically would produce a near linear change based on angle over the 70 deg the G2X rotates the pot:

1600181340738.png


This was then a great excuse to get a 3D printer, so I ordered an Ender 3 Pro (https://www.creality3dofficial.com/products/creality-ender-3-pro-3d-printer) and knocked up a simple model to hold the magnet and sensor whilst still utilising the existing pot for simplicity. The result was the following:

g2x_mag1.jpg


IMG_20200913_155039.jpg

Assembled and connected up to an Arduino to measure against the pot
IMG_20200913_164101_2.jpg


It's got an interference fit that seems fine and allows adjustment of the sensor angle to get the range as centred on Vcc/2 as possible. We played with some different magnet sizes, but found the 8mm with the most sensitive device (A1324) gave a range just over that of the stock pot. BLUE line is the pot, RED is the hall sensor

hall-v-pot-8mm.png

We are still playing but this is looking really promising as a simple swap for the standard pots in the G27 and everything but brake in a G29, although a less sensitive device like the A1326 could probably get the range down to that expected (more testing required!)

EDIT: forgot the link to the 8mm model - https://a360.co/3mvHXkX
 
Last edited:
I thought the same as @Neilski because the signal looks like it's remaining high and the sensor should be at about 1/2 of Vcc with no magnetic field. I'll take a closer look at the datasheet when I finish work and see what the sensitivity is.

Would you be able to also share the code for the arduino? I was assuming you just reported the ADC value, but you only seem to be presenting one magnetic pole to the sensor in the video, so I'm curious as to why the signal appears to be the full range
 
Upvote 0
I thought the same as @Neilski because the signal looks like it's remaining high and the sensor should be at about 1/2 of Vcc with no magnetic field. I'll take a closer look at the datasheet when I finish work and see what the sensitivity is.
Yup, I was a bit puzzled about that too, but the code may contain clues...

@Trakatrukis - if you own a multimeter then you can save yourself some mucking about with the Arduino + software by just verifying that you get the expected behaviour of the raw voltage output from the sensor.
 
Upvote 0
@Neilski
Yes, I have one, just tell me which pins I should measure.

Another test I have done has been to connect it to the base of the steering wheel instead of connecting the pedals to the Arduino Leonardo and this time it does react to the magnet inside the piece both above and below, that is to say, there is something in the base of the steering wheel that Arduino fails to do.
Thanks :)
 
Upvote 0
@GeekyDeaks Of course here you have the github and source code of what I'm using:
Sim Racing Arduino --> https://github.com/dmadison/Sim-Racing-Arduino/releases/tag/v1.1.4
Joystick library --> https://github.com/MHeironimus/ArduinoJoystickLibrary/releases/tag/v2.1.1
Thanks!
Ah, I looked this morning and both of those are just libraries. Do you have the .ino files you are using? I want to see how you are handling min/max from the ADC, i.e. how you are doing the calibration.
 
Upvote 0
@Neilski
Yes, I have one, just tell me which pins I should measure.

Another test I have done has been to connect it to the base of the steering wheel instead of connecting the pedals to the Arduino Leonardo and this time it does react to the magnet inside the piece both above and below, that is to say, there is something in the base of the steering wheel that Arduino fails to do.
Thanks :)
Ok, that does sound like it's just a calibration issue. If you could share the .ino or give details about how you are doing the calibration we might be able to help.
 
Upvote 0
Yes, I have one, just tell me which pins I should measure.
Well, pin 3 and either of the other two would be fine but let's go with GND aka pin 2. You should see pin 3 sitting at roughly half the supply voltage (voltage between pins 1 and 2) when there no magnetic fields around, and it should swing most of the way to both rails as you bring strong north and south magnetic poles to the sensor face. If that's happening then indeed the Arduino is doing something funky, as suggested by your most recent post.
 
Upvote 0
I decided to try this, but I have a question, are the magnets inserted into the 3D model, each one pointing at the sensor with a different polarity?
Well, basically yes, depending on how you mean "different" :)

The magnets are aligned in the same direction as each other in an absolute sense (so that they'd stick together if the plastic mount didn't keep them apart), which means that one of them has its north pole nearest to the sensor and the other has its south pole nearest to the sensor. Hopefully that's unambiguous :D

(Did the github site leave that question open? It has been a while since I looked at it properly.)
 
Last edited:
Upvote 0
(Did the github site leave that question open? It has been a while since I looked at it properly.)
Yep, I never even hinted at orientation. It was just one of those things that seems blindly obvious once you grasp how hall sensors work, but I totally should have mentioned in the repo! I'll update the readme over the weekend.
 
Upvote 0
Improvised as hell because I had to get my throttle working ASAP with what I had on hand, but it works. I will make it nicer as time (and resources) allows. Thanks to everyone involved in the conversation here, it helped a lot. Tweaking the response linearity and range by adjusting the sensor and magnets position is the worst bit, really, and more like tedious than difficult.

1709444442137.png
 
Last edited:
Upvote 0
Tweaking the response linearity and range by adjusting the sensor and magnets position is the worst bit, really, and more like tedious than difficult.
I can imagine! That's the beauty of the very limited angular rotation range of the stock pot - it means that decent linearity comes for free with the sensor and magnets mounted along the pot axis.
 
Upvote 0
A bit more technical (please forgive the fact that 44 mm looks much shorter than 31 mm here, it was just a quick simple drawing) take on where I put the magnets and the sensor to get the maximum range and linearity. Though it obviously depends on the magnets (I've used 5 mm x 2 mm neodymium magnets). Also decided to do the mod even for the brake, despite the fact that I might be experimenting with proper load cell soon, and since my brake is already modded and is very stiff with very little pedal movement in the last bit, I ended up doing what you see in the second image to ramp up the sensitivity near the end of the pedal travel. So the two magnets at the end of the pedal travel have the same polarity (and obviously opposite compared to the first magnet).
1709657986835.png
1709658013915.png
 
Last edited:
Upvote 0
A bit more technical (please forgive the fact that 44 mm looks much shorter than 31 mm here, it was just a quick simple drawing) take on where I put the magnets and the sensor to get the maximum range and linearity. Though it obviously depends on the magnets (I've used 5 mm x 2 mm neodymium magnets). Also decided to do the mod even for the brake, despite the fact that I might be experimenting with proper load cell soon, and since my brake is already modded and is very stiff with very little pedal movement in the last bit, I ended up doing what you see in the second image to ramp up the sensitivity near the end of the pedal travel. So the two magnets at the end of the pedal travel have the same polarity (and obviously opposite compared to the first magnet).View attachment 735963View attachment 735964
Curious if youd be willing to discuss what you have done to your pedals, maybe in private messages so I dont clutter up this topic?
 
Upvote 0
Hello

I understand that this thread is old, but I need some guidance as I have followed everything, and it's not giving me any results of any kind. I know I must be missing something, but I don't know what the problem is.

I have my G29 pedals connected to an Arduino Leonardo so that I don't depend on the entire base. I bought the A1324LUA-T hall sensor on AliExpress, and unless I have it wrong for polarity, it does nothing in the Windows calibration options. I've also tried another hall sensor, the SS495A1, as I've already converted T16000M joysticks to hall sensor, but I don't see it doing anything either.

Now that you have some context, I have a few questions. Should I disconnect the other potentiometers as well, or does that not matter? I ask because I'm trying to test if the hall sensor reacts when I bring the magnets close, and I haven't disconnected them.

Well, for now, that's it, and I'm sorry if I've revived the thread, but I don't know who else to turn to, and for now, I don't have a functioning pedal set.

Thank you very much for your guidance.

Hello, sorry if someone replied you before. I think can be the voltaje. check where is positive and ground in the pedal entrance. i mean red + (this to pin 1) and black - (to pin 2) the rest of the colors "signal" (pin 3). 1, 2 3 from the left to right, if you see the logo in the hall.

Because G29 are inverted inputs, then if you swap to non-inverted inputs. You have ground on the red wire and + in black wire
 
Last edited:
Upvote 0
Hi!
First of all, thanks for your reply, yeah, you were right, the pin was swapped and now It's working but now I have another problem, so I made another video beacuse is very odd


Thanks for your help!
Seems you are blocking the magnetism with the plastic. In your configuration you need two magnets spinning around the hall sensor. one in the front and other in the back, with oposite polarities (if i'm right).

You can try what i did, you can check this treat in page 6. https://www.racedepartment.com/threads/g27-g29-hall-sensor-mod.190696/post-3717300
 
Last edited:
Upvote 0
Normal plastic basically won't do anything at all to magnetic fields. (Because it has pretty much identical magnetic permeability to a vacuum.)
But, it depends on the kind of plastic. Just imagine a plastic with metal particles. But i think only the gap produced by the plastic itself could affect. If you see the video, is very strange... i guess he tried same gap with plastic and without, then... The only thing between the sensor and the magnet it's the plastic.
 
Upvote 0
But, it depends on the kind of plastic. Just imagine a plastic with metal particles. But i think only the gap produced by the plastic itself could affect. If you see the video, is very strange... i guess he tried same gap with plastic and without, then... The only thing between the sensor and the magnet it's the plastic.
Did you see my reply to that video? I think it was simply a connection issue - perhaps the interior of the 3D print had some clearance issues.
I've not seen metal-loaded plastic available for 3D printers but it may well exist. However, that's a seriously exotic explanation for the observation, no? :D What's wrong with the the much simpler explanation that the connections were just playing up?
(If a magnet doesn't attract the plastic, then I think you can safely infer that the magnetic field is unaffected by the plastic.)
 
Upvote 0
Did you see my reply to that video? I think it was simply a connection issue - perhaps the interior of the 3D print had some clearance issues.
I've not seen metal-loaded plastic available for 3D printers but it may well exist. However, that's a seriously exotic explanation for the observation, no? :D What's wrong with the the much simpler explanation that the connections were just playing up?
(If a magnet doesn't attract the plastic, then I think you can safely infer that the magnetic field is unaffected by the plastic.)
Well i wanted to think the guy was doing well the test... i though the problem with the wires was another problem. Because the video was a test.

 
Last edited:
Upvote 0

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top