Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 1 of 5 1 2 3 4 5
#3225807 - 03/06/11 12:52 AM DIY hall sensor ...  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
I've been pretty lax in getting this particular project done. smile I wanted to replace the ultra-noisy cheap pots I used in the '109 with hall effect devices. The video below shows the prototype of the replacement.

I'll post detailed build pics later. The design is based on the work of folks like Sokol1(sp?). The whole thing can be built for about $5 each.



(and yes, the volt meter is very, very old. smile )

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
Inline advert (2nd and 3rd post)

#3225983 - 03/06/11 07:21 AM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
Here's the parts you need:



The parts shown are a 22MM bearing (just a little shy of 7/8" diameter), two 1/4 x 1/4 neodymium magnets, an Allegro A1302 hall effect sensor and a Bic pen body.

Using a vice, carefully press in a short segment of pen body into the bearing - do NOT hammer it! The pen body plastic is very brittle. Steady force using a vice will "drift" in the pen body quite easily.

Next, glue the two neodymium magnets to opposite sides of the pen body - the magnets should be oriented N-S (they'd come together if the pen wasn't in the way). The way I did mine was to rest the magnet on the inner race of the bearing with a business card keeping it from physically touching the race. I then used "thick" CA (cyanoacrylate) to glue the magnets in place - have some kicker handy to speed up the cure process.

You should end up with something that looks like this:



Now you need to build the board that will hold the sensor in place. I used a small slice of copper clad perf-board. This holds the 3 pin connector and the A1302 very well.



Next, you want to get some 1/2" or 3/8" plywood and bore a 7/8" diameter hole in it using a forstner bit. Dont' bore the hole completely through - leave about 1/8" of material. Then drill a 1/4" hole using the same center as the 7/8" hole. I use a set-screw to hold the bearing in, but you could easily hot-glue it in if you're careful to keep the glue out of the bearing races. Tape the bearing in for now so you can align the hall sensor properly. A properly aligned sensor will fit in the center of the pen body with the magnets on either side of it.

You should end up having something that looks like this:



Assembled, it should look like this:





You can connect any kind of pushrod arm, gear, or whatever to the pen body - just don't apply too much side force to it. Too much side stress will crack the plastic. This setup gives 180 degrees of usable travel and works very well! The bearing size that you get should have an inner diameter just a tiny bit less than the widest point on the hexagonal Bic pen body. This allows for a very tight friction fit that doesn't require any adhesive to hold it in place.

You can easily custom design your own bracket for this - this was a simple prototype that proved out the technique and a refined version will end up in my '109 as well as a replacement for the pitch axis sensor I screwed up in my BRFS gimbal build. smile

Enjoy!

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3226256 - 03/06/11 05:13 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
Thanks Troll. The A1302 is .164" wide, so anything with an inside diameter of say .170" or larger would be fine.

I built this thing to replace some really cheap and noisy pots that I used in the '109 build. It will replace any three wire pot.

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3226385 - 03/06/11 07:40 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: May 2009
Posts: 122
Redhornet Offline
Member
Redhornet  Offline
Member

Joined: May 2009
Posts: 122
Instead of a Bic pen, could a solid piece of plastic rod be used or even a metal rod (say aluminum so it's not magnetic)?

#3226405 - 03/06/11 08:15 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Dec 2008
Posts: 1,065
aRareKindOfMonster Offline
Member
aRareKindOfMonster  Offline
Member

Joined: Dec 2008
Posts: 1,065
The advantage of the Bic pen is that it has an hex shape, so it makes it easier to glue 2 magnets to any two opposite flat surface. But you could just grind flat surfaces on a round tube and get the same results, but the flat surfaces must be perfectly parallel or I assume it might warp the magnetic field.
Even though Al is non-magnetic, I wonder if it does not interfere with a magnetic field.

#3226406 - 03/06/11 08:15 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Dec 2008
Posts: 1,065
aRareKindOfMonster Offline
Member
aRareKindOfMonster  Offline
Member

Joined: Dec 2008
Posts: 1,065
Allegros A1302 are hard to come by. If I'm not mistaking that part has been discontinued.

#3226407 - 03/06/11 08:17 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Dec 2008
Posts: 1,065
aRareKindOfMonster Offline
Member
aRareKindOfMonster  Offline
Member

Joined: Dec 2008
Posts: 1,065
(But what was I thinking?? I forgot to congratulate Gene for this nifty mod!!)

Gene, the idea with the bearing... brilliant! thumbsup

#3226408 - 03/06/11 08:19 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
The bic pen body provides not only a flat surface to mount the magnets to, but it's hollow as well so the A1302 can fit inside it. You could use pretty much any non-ferrous material for the input shaft as long as it's hollow or has a pocket of some kind bored in the center for the sensor to fit.

You can buy the Allegro A1302 in the US from Jameco:
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_1718743_-1

They're $1.29 in single quantities.

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3226409 - 03/06/11 08:22 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
Where did you hear that the A1302 had been discontinued? Jameco seems to have stock.

Thanks for the kudos aRareKindOfMonster, but I just took ideas from others to their logical conclusion. smile

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3226427 - 03/06/11 08:46 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Dec 2008
Posts: 1,065
aRareKindOfMonster Offline
Member
aRareKindOfMonster  Offline
Member

Joined: Dec 2008
Posts: 1,065
Jameco? I will buy some then.

I tried digikey a while back and they were out (and still are).
Mouser doesn't sell them.
There were none to be had on ebay, so I assume - wrongly - that they were discontinued.
Glad to know I was wrong on this.

Thanks for the info.

#3226550 - 03/06/11 11:02 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: May 2010
Posts: 108
julian265 Offline
Member
julian265  Offline
Member

Joined: May 2010
Posts: 108
That's a good way to put it all together. I always struggle with mounting bearings!

The Allegro A1321 was discontinued, which may be the one that the 1302 is being confused with here. NA85 on the ubi forums mentioned that he had contacted Allegro, and said that they were expecting to have a replacement for the 1321 out at some point. The reason that the 1321 was desirable was its sensitivity, which is 5mV/G.

This leads me to another point. In the video the shaft is rotated almost 180 degrees to get from minimum to maximum voltage. I'm not sure what your application is Gene, but this sensitivity probably isn't the most suitable for a joystick, for two reasons. Firstly, the amount of rotation required (the average stick rotates between 20 and 45 degrees I think), and secondly the output will be sinusoidal (half of a sine wave anyway), rather than linear. Even if you use levers or gears to amplify the rotation of a stick's axis, you'll still have sinusoidal output.

This might suit your particular application, but for people looking to put the sensor in a joystick (Troll) I can suggest a few things.

A linear output is desirable for a joystick, as it outputs just like a potentiometer equipped stick, and you can then apply whatever sensitivity curve you need in-game. To get this, you need to get the sensor to read from minimum to maximum voltage over an angle of 40 degrees or less. Doing this ensures that the sensor is operating only in the linear section of the sine wave (well, pretty close to linear).

There are two ways of doing this - use a higher sensitivity sensor, and increase the sensor's magnetic flux. To increase the sensor's magnetic flux, you can use stronger magnets (higher N number), use larger magnets (thicker rather than wider I think), and place the magnets closer to the sensor.

When you're trying for a linear response, it's better to initially have too much sensitivity, because you can then decrease it by making some adjustments to the geometry of the sensor (eg space the magnets wider, or change the position of the sensor so it's not directly between the magnets), or even use only one magnet.

Anyone looking to replace an existing joystick's pot would need to measure the angle that each axis of the stick rotates over, and optimise the sensor for this angle. Doing this ensures that you get the full resolution of whatever analog to digital converter that you're using, rather than needing to 'zoom in' on the output curve, or put up with sinusoidal output, for something which is typically linear. Typically in flight sims people will either leave the sensitivity curve alone (linear) or decrease the sensitivity around the center of stick movement - which is exactly the opposite of what happens when your stick has part sinusoidal sensitivity.

#3226614 - 03/07/11 12:33 AM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
Julian265, the setup I'm using doesn't use off the shelf joystick parts. It's all scratch built. I'm using a BI Plasma MM2 as the interface and the input curves can easily be adjusted. Keep in mind that standard pots have a 270 degree travel and most of that is wasted in joysticks that are using them.

The primary benefit here is a noise-less (electrically) system that doesn't cost an arm and a leg. A good quality pot can run well over $10 each.

I don't understand the linear vs sinusoidal thing though. If you've got a stop at 0 and a stop at 180, you're going to get a linear response line. Yes, if you go beyond the 0 and 180 points, it's going to go odd on you, but that should never happen with the kind of mechanical systems we're talking about. I suspect you may know something I don't however, so educate me! smile

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3226659 - 03/07/11 01:53 AM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jun 2007
Posts: 630
Ltfransky Offline
Sith Lord
Ltfransky  Offline
Sith Lord
Member

Joined: Jun 2007
Posts: 630
Peterborough, ON, Canada
The 1302s are linear output.


Please Heatware Me!

Ours is not to reason why. Ours is to do or die.
Tennyson

I have slipped the surly bonds of earth
And danced the skies on laughter-silvered wings..
Gillespie Magee, RCAF
#3226774 - 03/07/11 05:42 AM Re: DIY hall sensor ... [Re: f15sim]  
Joined: May 2010
Posts: 108
julian265 Offline
Member
julian265  Offline
Member

Joined: May 2010
Posts: 108
Originally Posted By: Ltfransky
The 1302s are linear output.


Absolutely - the sensor's output voltage is linearly proportional to the magnetic flux (within it's operating zone anyway). However:

Originally Posted By: Gene Buckle
Julian265, the setup I'm using doesn't use off the shelf joystick parts. It's all scratch built. I'm using a BI Plasma MM2 as the interface and the input curves can easily be adjusted. Keep in mind that standard pots have a 270 degree travel and most of that is wasted in joysticks that are using them.

The primary benefit here is a noise-less (electrically) system that doesn't cost an arm and a leg. A good quality pot can run well over $10 each.

I don't understand the linear vs sinusoidal thing though. If you've got a stop at 0 and a stop at 180, you're going to get a linear response line. Yes, if you go beyond the 0 and 180 points, it's going to go odd on you, but that should never happen with the kind of mechanical systems we're talking about. I suspect you may know something I don't however, so educate me! smile

g.


If you rotate the magnets through 180 degrees around the sensor, the sensor's magnetic flux will vary according to a sine wave:



Of course you're only using the region between 90 and 270 degrees on the above graph, however you can see the slope of the line drops off as it approaches 90 and 270 degrees - in other words, you will have reduced sensitivity at the extents of stick travel. But you don't have to take my word for it: Get a protractor or other angle measurement device, start at minimum voltage and move the input shaft by 10 degrees or so, each time writing down the angle and voltage that you're getting. Then type the values into excel or other graphing program, and look at the curve you get. In the graph in my PDF, you can just see the sinusoidal influence, but my measurements were only taken over about 45 degrees of travel, or 22.5 degrees either side of neutral.

I'm not familiar with the BI Plasma MM2, and if it allows something like a lookup-table adjustment (or a curve to "linearise" a sine wave), then you'll be set. Maybe some windows/mac software already does this also? But for myself and others using the BU0836 or similar units, it's probably easiest just to get a linear response from the stick, and then apply your game-specific adjustments if needed. If for some reason (like for a throttle or knob) you need more than 45 degrees of travel, and linear response to angle, then the only way to achieve it is by using a look-up-table or carefully tuned sensitivity curve to eliminate the sine curve.

#3226824 - 03/07/11 09:49 AM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2011
Posts: 658
Bluedeath Offline
BS 62 "Pegasus" CAG
Bluedeath  Offline
BS 62 "Pegasus" CAG
Member

Joined: Jan 2011
Posts: 658
I ordered some A1302 from EBAY it turned out that they were china manufactured clones (i checked from the markings and thay are similar to allegro by spec sheet) ,but they work really well the only strange thing is that i can't get full travel in other words by using a 12 bit A/D i only get around 690 to 3700 (wich is anyhow fairly good by being more than 3000 discrete positions) instead of ideal 0 to 4096, the sensor is placed right in the middle of the "BIC assembly" and i used 5x5x5 neodimium magnets I tested by spinning the magnet assembly freely 360° several times and i never exceed thoose values. I laso tried to increase flux by adding magnets but the result not change. Im already satisfied with this setup but i was wondering if this is normal.


"When you plan revenge best dig two graves" Confucius
"They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety" Benjamin Franklin
#3226846 - 03/07/11 10:57 AM Re: DIY hall sensor ... [Re: ]  
Joined: May 2010
Posts: 108
julian265 Offline
Member
julian265  Offline
Member

Joined: May 2010
Posts: 108
Originally Posted By: Troll
Hi Julian!
Really informative guide you made!

Still, I'm no electrics wizzard. Here is a product details leaflet of the hall sensors available to me.
https://www1.elfa.se/data1/wwwroot/assets/datasheets/mnSS400.pdf

Could you, or anyone, help me to find out if any of the sensors listed there are useable For this purpose?
The sensors you listed are switches - they turn on at a certain flux, and turn off at a different flux, and unfortunately unsuitable for our purposes! You need to look for *linear* hall effect sensors.

Originally Posted By: Troll

Edit:
OMG!!
I searched the site of the onlinestore with the best selection around here. Turns out they have the Allegro brand hallsensors, but they spelled Hall wrong, thus hiding them from a search for Hallsensors..!

Could the A1321 be used instead of the 1301?

https://www1.elfa.se/data1/wwwroot/assets/datasheets/07333925.pdf



Get the A1321 if you can as they're the most sensitive that I've seen available - I'm not saying that you can't make a good stick with less sensitive ones (many people do), but I am saying that higher sensitivity gives you more options regarding magnets, placement, distances, and more opportunity to be able to reduce the sensitivity to get the desired response, rather than having to possibly work around less than desired sensitivity. However, the A1321 has been out of production for a while, and I've heard of a number of people who haven't been able to get them. By the way, in the PDF you linked, the sensitivity is on page 5 up the top of the table. The options for the A1321/2/3 are 5, 3.125 and 2.5 mV/G in the "typical" column.

Last edited by julian265; 03/07/11 11:01 AM.
#3226854 - 03/07/11 11:15 AM Re: DIY hall sensor ... [Re: Bluedeath]  
Joined: May 2010
Posts: 108
julian265 Offline
Member
julian265  Offline
Member

Joined: May 2010
Posts: 108
Originally Posted By: Bluedeath
I ordered some A1302 from EBAY it turned out that they were china manufactured clones (i checked from the markings and thay are similar to allegro by spec sheet) ,but they work really well the only strange thing is that i can't get full travel in other words by using a 12 bit A/D i only get around 690 to 3700 (wich is anyhow fairly good by being more than 3000 discrete positions) instead of ideal 0 to 4096, the sensor is placed right in the middle of the "BIC assembly" and i used 5x5x5 neodimium magnets I tested by spinning the magnet assembly freely 360° several times and i never exceed thoose values. I laso tried to increase flux by adding magnets but the result not change. Im already satisfied with this setup but i was wondering if this is normal.


Clones that perform to a certain spec are pretty common with electronic components.

By the sounds of it, your setup has less sensitivity than it needs to 'saturate' the sensor. If you have calibrated it so that the stick can reach 0 and 100% in games (really important!), and you're happy with the center position then you're all good - 3000 steps is plenty. The 1302 has a sensitivity of 1.3mV/G, compared to 2.5 for the 1301 - so if you did want to increase it, you have the option to, if 1301s are available. The linearity of the setup is purely set by the angle range that the stick moves through. Much more than 45 degrees (total) and you'll start to see variable sensitivity.

According to the spec sheet, the 1301/2 (like the 1321) output can be between 0.2 and 4.7V - which means you can't get the A/D converter to read less than 160 or more than 3850, even when you have plenty of magnetic flux. This just needs to be calibrated out in the operating system, unless you want to use a signal amplifier to get a true 0 to 5 V output.

#3226892 - 03/07/11 12:52 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2011
Posts: 658
Bluedeath Offline
BS 62 "Pegasus" CAG
Bluedeath  Offline
BS 62 "Pegasus" CAG
Member

Joined: Jan 2011
Posts: 658
since these sensors are able to accept 6v power would this increase range? (linearity is already OK and centering is also, but I'm kinda curious)


"When you plan revenge best dig two graves" Confucius
"They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety" Benjamin Franklin
#3227023 - 03/07/11 03:06 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Jan 2004
Posts: 1,221
f15sim Offline
More projects than sense!
f15sim  Offline
More projects than sense!
Member

Joined: Jan 2004
Posts: 1,221
Graham, WA
If memory serves, I was getting a range of about .13 to 4.93 volts out of the one I used in the video.

julian265, considering that most will use the "middle" 90 degrees of travel on something like this, is the fall off at the ends of the travel _really_ going to matter that much? Considering what the typical setup will lose just in mechanical slop, I suspect the difference would get lost in the noise. smile

The Plasma MM2 is an _awesome_ device. Unfortunately Beta Innovations is no longer in business. Something bent him sideways and he closed his doors - I've never gotten an explanation. The software will allow adjustment of the response curve though. Eventually I'm going to get the Arduino firmware written to allow you to use an Arduino Uno (or similar) as a control input device. That will also have the ability to tweak the response curves.

g.


Proud owner of 80-0007
http://www.f15sim.com - The only one of its kind.
http://geneb.simpits.org - the Me-109F/X Project
#3227161 - 03/07/11 05:29 PM Re: DIY hall sensor ... [Re: f15sim]  
Joined: Aug 2007
Posts: 293
Brandano Offline
Member
Brandano  Offline
Member

Joined: Aug 2007
Posts: 293
Caput Mundi (well, it used to ...
Even in an ideal situation you won't really get the full range without some conditioning circuitry. The Allegro sensors can only give you an output in a range from slightly above the 0V rail to slightly below the 5V rail. I believe that 0.5 to 4.5 Volts is the common output range. Usually the joystick's internal self calibration takes care of this, so on modern joystick you won't really notice it and the number of discrete steps will be really limited by the software. I suspect that modern joysticks sample the signal at a higher resolution than that of the values returned to the PC, in order to condition the signal and apply noise filtering.
Btw, very clean job Gene, looks very good. You might try to add a mild steel flux ring (a few wraps of steel wire on a wooden dowel?) on the outside of the magnets to provide some shielding and possibly increase the magnetic field between them. Since it would turn along with the magnets histeresys would not be an issue, though I realize it would make things a bit bulkier and complex.

Last edited by Brandano; 03/07/11 05:29 PM.
Page 1 of 5 1 2 3 4 5

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
CD WOFF
by Britisheh. 03/28/24 08:05 PM
Carnival Cruise Ship Fire....... Again
by F4UDash4. 03/26/24 05:58 PM
Baltimore Bridge Collapse
by F4UDash4. 03/26/24 05:51 PM
The Oldest WWII Veterans
by F4UDash4. 03/24/24 09:21 PM
They got fired after this.
by Wigean. 03/20/24 08:19 PM
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0