Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: Is it possible to connect a 2 axis hall sensor from an old joystick to the teensy?

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    3

    Is it possible to connect a 2 axis hall sensor from an old joystick to the teensy?

    Hello,

    I just registered and received my first teensy (3.2)

    I tested a few potentimeters and sliders which are working fine with the teensy but my project would require a 2 axis hall sensor that I took from a joystick thrustmaster T16000.

    Here is the sensor in question : http://zupimages.net/viewer.php?id=19/18/sknj.jpg

    I tried to understand how this component works and found this link : https://www.sensorsmag.com/component...-axis-hall-ics
    I guess the figure 3.A from this link could match my component since there is 5 branches on that schematic and I have 5 wires but that's about where my knowledge of electronic ends...

    I am really not sure how to connect to the teensy and if I could damage something ... Sensor<Teensy<usb Hub<Computer

    From this picture, could you say what color is Ground, Sin,Ref volt(what is this??),Cos and common?
    If not, is it possible to get those informations with a voltmeter and how?

    The schematic is referring to +5V, is it sure the component I want to use will require 5V? Can this voltage be send by a teensy 3.2 I see 3.3V everywhere except for Vin (3.6 to 6.0 volts, not sure what that is)

    The fact is that I have no idea how to connect this to the teensy neither do I know how to code it..
    If someone can help me on this, it would be great...
    FYI, I only need to receive 1 axis, the second won't be used but I guess I will still have to connect it.

    Thanks a lot for your help.
    Mike

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,385
    Basically, these ICs deliver analog voltages corresponding to the sine and cosine values of the detected angle. So, direct interfacing with a uProcessor will not be easy. The Teensy eases that task, though, since it has so-called analog inputs which can be used together with the internal ADCs. But before all, you need to analyze and to understand the behavior of your hall IC. For that, you should (without connecting it to the Teensy yet) power it with the required voltage (default 5V) and play around with the joystick magnet while observing the voltages on its sine and cosine output with a Voltmeter or an oscilloscope. Depending on the angle, these voltages will vary between 0 and 5V. Now, since the Teensy (like most modern hardware) is a 3.3V device, you have several options: First is checking the data sheet provided by the manufacturer of the hall IC if it can be operated at 3.3V. If yes, go for it and check if the output signals vary now between 0 and 3.3V in a similar way as before. Second is (again with the manufacturer‘s documentation) checking if, although operated at 5V, providing an external reference voltage of 3.3V to that IC will adapt its output voltage swing. Third, if all these options fail, you‘d need external voltage dividers to adapt the sin and cos levels before feeding them into the Teensy.
    Now is the moment where you can start writing code to read these signal levels into numeric values and to do some elementary math in your code to process these sin and cos signals into the azimuth angle value needed for joystick operation.
    It comes out to classic scientific systematic proceeding: Gathering information, analyzing it, and developing a solution strategy, advancing step by step. That’s called „engineering“

  3. #3
    Junior Member
    Join Date
    May 2019
    Posts
    3
    Hello,

    Thank you for your input, I reconnected the old joystick to take data from it and it looks like it's indeed using 5V.
    I will keep trying to understand its behaviour but it's difficult since the manufacturer won't release the documentation about the inner part of its joystick and I can't even read the name of the sensor so it's gonna be a tough task

    Once I gather all the data I will try to operate it under 3.3v and see what kind of output I get.

    Thanks for your help.
    Mike

  4. #4
    Junior Member
    Join Date
    May 2019
    Posts
    3
    Hello,
    I'd like some guidance for the measurement... I guess I found the 5 v input (4.94) and ground... yes I am that far
    Now for the rest, I am completely lost with my voltmeter...

    I don't understand how to measure the X and Y voltage. Should I mesure from x to ground? or 5v input to x? or ref voltage to X?
    What about the ref voltage from the schematic, I don't understand it's role and what I should be getting from it on the voltmeter..

    I have too pins that give me a voltage that doesn't vary no matter what I do with the joystick. One is the positive input 4.94V (I guessed since it's the highest value I get) and what about the other 4.94v?
    I know those are a lot of noob question... but yeah.. I am a noob..
    thanks for the help.
    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •