Few weeks ago Dexter Industries sent me a prototype of the dCompass. I was really pleased with the sensor as this compass proved to be a really good one. It was a nice addition to my IMU.
But a compass sensor can be used for other things than using it as a compass. With a little imagination you can make very cool robots with it. In this post I’ll give a few suggestions. Also, you have the chance to win one.
Using the dCompass as a compass is the obvious thing to do. Still I want to give you some hints regarding this.
The compass measures the magnetic field over three axes. The direction of the sensor is calculated from the strength of the magnetic field over the X and Y axis using the atan2 function. Luckily, most drivers will do this for you. When using the dCompass as a compass you’ll have to make sure it is level and kept away from magnetic disturbances. Keep it 10 to 15 cm from the NXT brick and (heart of) the motors for best results.
The fact that the dCompass detects all magnetic fields and not just the earth magnetic field is the basis for many other uses of this sensor. But before I dive into this some more about the earth magnetic field. One thing that might surprise you is that the magnetic north is not somewhere on the ground. If you live on the northern hemisphere it is somewhere underground. If you live on the southern hemisphere it is somewhere in the sky! The earth magnetic field does not change. It always points at the same direction and it always is of the same strength. Only when you go to another place it’s direction and strength changes. Just as you can calculate the direction of the magnetic field you can calculate its strength (emf). Pythagoras tells us how. emf=sqrt(x^2 + y^2 + z^2)
Once you know the strength of the earth magnetic field you can use this to calculate the strength of other magnetic fields (omf) near the compass. This of course is the difference between the measured field strength and the earth magnetic field.
omf=sqrt(x^2 + y^2 + z^2) - emf
The resulting value is the gateway to other uses of the dCompass. If omf equals zero there are no disturbances around. Any other value is an indication of something magnetic in the vicinity.
So what exactly can you do with this information? Here are some ideas:
- make a traffic counter that counts the number of vehicles that pass by. You might even be able to deduce the kind of vehicle from the field strength as well as its direction.
- make an magnetic key with a motorized lock that only opens when the right field strength is measured.
- make a rotation counter that counts the number of revolutions of something turning.
- you can expand the previous idea to make something that shows you how fast your bike is going.
- make a device that tells you where in the wall the electric wires run.
Well, these are just a few ideas to trigger your imagination.
If you have a good idea you can find more info in the compass or buy one at Dexter Industries. Or, if you are really lucky, you can win one here. All you have to do is to subscribe to my blog. I will randomly draw a winner from all my subscribers on 15 march 2012.
[...] dCompass Ideas, Giveaway Guy NXT door has just announced a dCompass giveaway on his website. Learn about it here. [...]
Looks like a neat adapter. I would love to win one.
I’m subscribed to your RSS feed, does that count?
Why did you chose to go for a random subscriber, and no, for example, the best idea?
As long as I get a notification it counts. So you’re in.
I didn’t go for the best idea this time as I wanted to make it easy for my readers to participate in this giveaway. But if you do have a nice idea you’re invited to share it with the world by submitting it on my site. I would love to see what people come up with.
I wonder if it can somehow detect metal objects, to make a trash sorter.
Here are some links to literature describing various applications of digital compasses.
position sensing and rotation sensing: http://www51.honeywell.com/aero/common/documents/Applications-of-Magnetic-Position-Sensors.pdf
http://www51.honeywell.com/aero/common/documents/Linear_Position_Sensing_Using_Magnetoresistive_Sensors.pdf
Vehicle detection: http://www51.honeywell.com/aero/common/documents/myaerospacecatalog-documents/Defense_Brochures-documents/Magnetic__Literature_Application_notes-documents/AN218_Vehicle_Detection_Using_AMR_Sensors.pdf
http://www51.honeywell.com/aero/common/documents/myaerospacecatalog-documents/Defense_Brochures-documents/Magnetic__Literature_Technical_Article-documents/Vehicle_Detection_and_Compass_Applications_using_AMR_Magnetic_Sensors.pdf
You could attach the dCompass to an NXT that plays a R2-D2 sound when crossing a certain magnetic angle. Tell people it detects undetectable Earth rays and advice them to reposition their furniture for better health
I like the idea. R2D2 as Feng Shui advisor.
What if I already subscribed? Will I be included in the drawing?
Yes you will.
Put a robot in a metal box, and watch it spaz out. On a more serious note, maybe make a metal detector or supermarket alarm system.
could it follow a magnet source such as a monorail . so the robot can goo from on road to off road bring its wheels up and use it to detect a magnetic force under the model and when it reaches the end drop the wheels down and return to normal function
I live outside U.S.A may qualify for the draw?
Of course you do. I live outside the USA myself.
So, who won?
I just drew a winner and try to contact him. When I get a reaction I will publish the winner, if not I’ll draw another one.
Aw, no email…You ruined my life! haha Although… it could still be that the winer made a typo in his address…