Measuring Magnetic Fields With A Robotic Arm

MagneticArm

Learning how magnets and magnetic fields work is one thing, but actually being able to measure and see a magnetic field is another thing entirely! [Stanley’s] latest project uses a magnetometer attached to a robotic arm with 3 degrees of freedom to measure magnetic fields.

Using servos and aluminium mounting hardware purchased from eBay, [Stanley] build a simple robot arm. He then hooked an HMC5883L magnetometer to the robotic arm. [Stanley] used an Atmega32u4 and the LUFA USB library to interface with this sensor since it has a high data rate. For those of you unfamiliar with LUFA, it is a Lightweight USB Framework for AVRs (formerly known as MyUSB). The results were plotted in MATLAB (Octave is free MATLAB alternative), a very powerful mathematical based scripting language. The plots almost perfectly match the field patterns learned in introductory classes on magnetism. Be sure to watching the robot arm take the measurements in the video after the break, it is very cool!

[Stanley] has graciously provided both the AVR code and the MATLAB script for his project at the end of his write-up. It would be very cool to see what other sensors could be used in this fashion! What other natural phenomena would be interesting to map in three dimensions?

Continue reading “Measuring Magnetic Fields With A Robotic Arm”

Modeling An Object With Internal IMUs

[Joseph Malloch] sent in a really cool video of him modeling a piece of foam twisting and turning in 3D space.

To translate the twists, bends, and turns of his piece of foam, [Joseph] used several inertial measurement units (IMUs) to track the shape of a deformable object. These IMUs consist of a 3-axis accelerometer, 3-axis gyroscope, and a 3-axis magnetometer to track their movement in 3D space. When these IMUs are placed along a deformable object, the data can be downloaded from a computer and the object can be reconstructed in virtual space.

This project comes from the fruitful minds at the Input Devices and Music Interaction Lab at McGill University in Montreal. While we’re not quite sure how modeled deformable objects could be used in a user interface, what use is a newborn baby? If you’ve got an idea of what this could be used for, drop a note in the comments. Maybe the Power Glove needs an update – an IMU-enabled jumpsuit that would put the Kinect to shame.

Continue reading “Modeling An Object With Internal IMUs”

Advanced Compass/accelerometer Library For Arduino

We don’t have much personal experience with DOF hardware, but this Arduino library which reads and compensates for three-axis magnetometer and accelerometer data looks very impressive. It should work for existing hardware, but there’s also a demo design using a Honeywell HMC5883L compass and a Freescale MMA8453Q accelerometer which you can build yourself. Unfortunately these come in QFN packages (like most cheap accelerometers these days) so you may need to be creative when soldering.

What’s so special about this library? Watch the video after the break (use 720p in fullscreen to get the full effect) and you’ll see three different scatter plots of the output data. The image above is a capture of the third example, which is using the hard iron offset and accelerometer compensation. That is to say, metal on and around the board is accounted for, as well as the physical orientation of the device. Even if you have no prior experience with this type of hardware it’s easy to see the usefulness of this kind of software compensation.

Continue reading “Advanced Compass/accelerometer Library For Arduino”

PVC Magnetometer To Measure Magnetic Storms

In the hopes of getting a heads up on when the aurora borealis will be visible from his back yard, [Alex] built a magnetometer to measure disruptions in Earth’s magnetic field. The build is extremely simple, too. It’s amazing what you can build with a few components and a trip to the dollar store.

The design or [Alex]’s project is called a torsion magnetometers. In this setup, two mirrors are affixed to a permanent magnet connected to a string. A laser is shone onto the mirror and is reflected back to an array of sensors. In [Alex]’s case he used a simple laser pointer and a pair of photoresistors encased in a PVC tube.

[Alex] has been running his magnetometer in his back yard for over a month now and has the data to prove it. Luckily for [Alex], those graphs he has been generating may get a little more interesting. A coronal mass ejection is coming our way and is expected to hit today around 22:30 UTC. We’ll go outside to look for an aurora, but we’re sure [Alex] will be glued to his laptop tonight.

Check out the CGI visualization of [Alex]’s magnetometer after the break

Continue reading “PVC Magnetometer To Measure Magnetic Storms”

Tilt Compensation When Reading A Digital Compass

If you’re familiar with using a compass (the tool that points to magnetic north, not the one that makes circles) the concept of holding the device level makes sense. It must be level for the needle to balance and rotate freely. You just use your eyes to make sure you’re holding the thing right. Now think of a digital compass. They work by measuring the pull of a magnetic field, and have no visual method of showing whether they’re level or not. To ensure accurate readings you might use an accelerometer to compensate for a tilted magnetometer.

The process involves taking measurements from both an accelerometer and a magnetometer, then performing calculations with that data to get a true reading. Luckily the equations have been figured out for us and we don’t need to get too deep into trigonometry. You will, however, need to use sine, cosine, and arctangent in your calculations. These should be available in your programming language of choice. Arduino (used here) makes use of the avr-libc math library to perform the calculations.

A Beginner’s Guide To Magnetometers

magnetometers_for_beginners

The folks over at LoveElectronics recently published an article that explains some of the ins and outs of magnetometers for those who are interested in trying one out, but might not understand how to use them.

A good part of the article focuses specifically on how to manipulate the HMC5883L magnetometer from Honeywell, but a lot of the information can be applied to other makes/brands of compass sensors. They start out discussing in very basic terms how the compass works, then delve into some specifics on how to interface the chip with an Arduino, courtesy of a breakout board that they sell. The breakout board is actually quite simple, so any number of custom iterations could be built for your own testing purposes.

They walk through the use of an HMC5883L-specific Arduino sketch they produced, making it easy for beginners to start getting useful data from the compass units. While a pre-made sketch might seem like a bit of a cop out, it at least gives the curious/motivated beginner a chance to look at some completed code in order to see how things work.

If you are interested in cutting your teeth on some additional beginner concepts, check out these other how-to articles and tutorials.

3D Magnetometer Mouse In Processing

FFB4SV5G0SD7J7G_MEDIUM

[etgalim] works in Solidworks extensively and wanted a more intuitive way of rotating objects onscreen. To do this, he created a mouse that responds to rotation. He put a 3D compass module inside an old mouse and wired it up to an Arduino. The Arduino then relays the I2C sensor data to the computer. So far, he has a Processing script that uses the mouse to rotate a cube, but eventually he wants to write a Solidworks plugin. It’s a bit shaky, and we think it would be a bit smoother (and cheaper) if he used gyros like the jedipad. Video after the jump.

Continue reading “3D Magnetometer Mouse In Processing”