Homemade hall effect compass

I wish to make a cheap digital compass based on hall effect sensors (HES). Preferably the UGN3503UA because I can buy them fairly cheap in a local store.

A guy on another forum posted this circuit which unfortunately didn't seem to work when someone else tried it out:

The same guy also mentioned it could be done with a simpler setup using only 2 x HES instead of 4. Any ideas as to what this circuit would look like?

I never used a HES or an op amp before so I could use all the advice I can get. Which kind of op amp(s) to get/avoid? What resistor sizes? And is that a potmeter on the circuit where it says "zero adjust"? And what does that mean?

I'm subscribing for updates to this thread. I'm very interested in this concept. :slight_smile:

The earth's field is about 0.3 Gauss the sensor you posted measures up to 900 Gauss with a sensitivity of 1.3mV / Gauss. So the maximum you are going to get from this sensor is 0.23mV.
This is way way too small to work in that circuit.

OK?! That's bad news..

But I'm not sure what you mean though. Do you mean that it can't possibly work no matter how much I amplify the signal, or simply that it wont work with the current setup?

The guy who posted the circuit said it would work with that particular sensor (UGN3503UA) too with some experimentation and calibration. I've also come to understand that I need a more sensitive op amp and that an OP07 would be more ideal for the job.

So could it possibly work with an OP07 or an even stronger op amp? If not then what if I used a more sensitive HES like the A1321LUA-T?

Anyway thanks for the input..

It's not just a case of using an op amp with more gain. Yes that is what you need but with gain you also amplify the noise and it is the signal to noise ratio you need to improve. This involves using techniques other than brute force gain.

It is complex and I am not an expert in this field and there are several approaches you can take. However, consider the cost of a solid state compass and ask yourself if it were that simple would they cost that much.

My 1st thought too was that when you amplify the signal you also amplify the noise. Noise reduction will inevitably be a crucial part of this project. Perhaps a tiny Faraday cage would encapusulate the compass circuit...for starters.

And digital compasses are indeed expensive. In fact so expensive that I simply can't afford one between all the parts/tools I've been buying and still need to buy to get started with robotics. That is why I'm looking to other solutions.

I wouldn't have even thought of this if it hadn't been for someone else with way more experience in electronics mentioning the possibility. He said he got the idea bacause he's often struggeling with the opposite problem when using HES: to eliminate the effect of the earth's field.

Anyway thanks again for the input..

PS: Any suggestions regarding the noise reduction techniques and other approaches you mentioned?

Any suggestions regarding the noise reduction techniques and other approaches you mentioned?
Back to top

The noise that is being talked about is circuit noise, not external through-the-air noise. The sensor itself has a given S/N ratio that can't be improved, so amplifying it will not help the situation. There are very low noise op amps that will help not contribute to the S/N ratio much, but that doesn't improve the situation. The problem is the basic gauss range of the sensors, they are not sensitive enough to be measuring the earth's magnetic flux.


Depending on what your doing, couldn't you use one of the less expensive 8 point compass modules and use interpolation (i.e I must rotate the sensor x number of stepper steps/servo degrees before it changes the reported orientation) to approximate greater resolution? I mean sure if your not using this on a bot or something that could achieve a precisely aligned set of steps, that would preclude this tactic... but if you are, then you could recalibrate it on start up each time and not have to deal with the frustration of noise.


The noise that is being talked about is circuit noise, not external through-the-air noise.

Yes while googling "circuit noise" and "noise reduction" I also came to that understanding. Sorry for mentioning the Faraday cage in that context.

And as mentioned my 1st thought was also that the poor strength of the HES output vs. noise would make it (all but) impossible. Then a guy on the other forum said:

  • min sensitivity on the UGN3503UA is 0.75mV/G
  • minimum field strength is +/-0.3G
  • so 0.45mV minimum swing from north to south
  • as long as the signal is amplified enough such that the change is detectable, you can make a compass

However he also noted that:

*noise reduction will be very important for this project

So I've been looking into this "noise reduction" and it's definately a complicated issue. And given yours and Mike's comments I'm starting to think that it may not be possible at all in this case.

Haven't given up just yet though.

Thanks for your input...


The application is indeed a robot to be used for mapping and localization experiments.

I suppose the 8 point compass you mentioned would be the Dinsmore 1490 or did you have something else in mind?

Allthough these only cost 15$ that is a highly theoritical price to me. The last time I made an order I got charged 100% extra by the local customs and paid 20$ in shipping. So 50$ is more likely the REAL price, which isn't so cheap again. That's why I was hoping for a DIY solution based on parts I can buy in LOCAL stores. You may understand that I loath internet shopping.

However your idea of mounting it on a servo for greater resolution is great. I'll definately keep that in mind :wink:

Thanks for the input..

Those 8 point compass modules are used in some vehicular applications, so you may find one locally by pursuing that avenue rather than ordering them internationally. Perhaps they may even be available used (even more inexpensive) at a automotive scrap yard.


Another great tip! But do you know of any other similar devices besides the Dinsmore? That would be a great help.

Thanks again..

Honeywell HMC6352 -


Hitachi HM55B -

Are two additional examples.

Hmmm...not exactly what I meant. Those are all "real" higher resolution compasses. I've been looking at those for months and the cheapest ones are like 30$ theoretically (+shipping+customs => REAL price ~80$).

What I meant was other cheap (<15$) low resolution ones like the Dinsmore.

But thanks anyway :smiley:

Ok, did some more research, got some more advice and I still think that it could be possible.

1st off...

  • The earths magnetic field is MINIMUM 0.3 Gauss
  • The sensitivity of the UGN3503UA is typically 1.3mV/Gauss

That should give me atleast 0.39mV output variation from the UGN3503UA. NOT 0.23mV as Grumpy_Mike said. Correct me if I'm wrong?!

The typical (broadband output) noise of the UGN3503UA is 0.09mV, so the signal/noise ratio isn't great (0.39mV/0.09mV) but still gives me something to work with. Especially since the circuit above has 2 sensors mounted back to back connected to the same op amp, thus doubling the output variation.

And if can I get my hands on an a A1321LUA-T sensor instead of the UGN3503UA it could improve significantly since it has a sensitivity of 5.0mV/Gauss. Or perhaps an even better HES?!

So I can't help thinking that this may still work.

I'm off course aware that I also have to consider noise from the rest of the circuit, but I've been reading up a bit on noise reduction and it doesn't seem that far out either. As I understand it I'd need to isolate the frequencies of the sensor signal and the noise, and then use a passive analog filter to filter out the unwanted frequencies. It seems fairly complicated yes, but still doable.

So the idea is still alive and all input is still very much appreciated :slight_smile:

Perhaps the solution isn't to amplify the signal, but to increase the sensitivity. What if you used an external 12 bit i2c ADC? That would give you a @ 1mV sensitivity (5V/4096).

I'm still too much of a noob to this electronics mumbojumbo to determine whether that would help, but I actually don't think so.

The sensitivity that matters in this case is that of the sensor itself vs. the noise of the sensor and the circuit. In other words the signal/noise ratio. I don't see how this would be improved by using a 12 bit ADC. And even with a 1mV ADC sensitivity I would still need to amplify the signal significantly.

But thanks for the input :slight_smile: