A quick update with a new sensor I've been working on, a magnetic imager tile (something like a "magnetic camera"). It's definitely very cool to see magnetic fields live!
Magnetic Imager Tile
I've always been interested in visualizing things that are challenging to visualize, particularly those that are pervasively around us. Magnetic fields certainly qualify for this -- I think it's absolutely fascinating that they're everywhere, but that we (generally) don't make more than point measurements of the fields, and only very rarely are images taken.
The most intuitive way to make an imager for something is to get a whole bunch of single sensors for that something, and place them in an array. Alternatively, you can take a single sensor, and physically translate it through space, as in Ted Yapo's magnetic field scanner ( https://hackaday.io/project/11865-3d-magnetic-field-scanner ). A few years ago I worked to build an imager by putting together an 8x8 array of the popular HMC5883L magnetometers, spaced about 1cm apart ( https://hackaday.io/project/5030-low-field-mri/log/15914-concept ). This has plenty of positives -- each sensor is a 3-axis magnetometer, and the whole array could be read using a simple I2C interface. Some of the difficulties are that such a large board with very tight-pitched components is a bit challenging to assemble -- I was only able to successfully assemble a 4x4 version, with the 8x8 (and it's 64 magnetometers) unfortunately only working as an object d'art. One of the other challenges with the HMC5883 array was the packing density -- the number of external components meant the maximum density I could achieve were pixels (magnetometers) spaced 10mm (1cm) apart.
It's been a few years since I had a go at this, and so I decided to put together another attempt:
- Simpler sensors: Large-pitch analog hall-effect sensors instead of I2C sensors.
- Higher density: a 4mm density using SOT-23 sensors requiring no external components
- Addressable array: Analog addressing through a large array of analog multiplexers on the back of the board
- Tileable: Able to create larger arrays by putting multiple boards adjacent to each other
- Easy to solder: Only large pitched components, so it would be quick and easy to solder in a toaster reflow oven (for the array side) and with a hand iron (for the analog multiplexer side)
- 12x12: The size of the array (12x12) makes it big enough to see interesting things, and small enough to (I hope) fit on the back of the eventual Iteration 8.
I learned from my earlier attempt with the HMC5883L array that this would be a bit of a routing nightmare, and so I decided to try switching from EagleCAD to the open source KiCAD, to make use of it's push-and-shove router. It took a bit of getting used to -- KiCAD still has significant usability issues, in my opinion -- but with some work the board artwork came together, with exactly enough room for everything. The Hall Effect sensors and power traces are on the top side of the board, with the array of analog multiplexers to route the analog signals from the sensors placed on the bottom. The bottom also contains an I2C I/O expander (U110) so that the array can be addressed using only 2 I2C pins instead of over a dozen address lines, as well as an external 14-bit SPI ADC (U111). The raw analog signal is also broken out on the connector (J1), so that the board can be connected to an external ADC (like the internal ADC on an Arduino) very easily.
The board itself had very small 6 mil traces, which lead to some manufacturing issues. I was able to cut around the bridged traces and wire-wrap fixes, and populated about half the array for testing:
The bottom of the array, with the analog multiplexers:
I ideally would like an imager with a high (~1000fps) framerate, to be able to visualize interesting high-speed fields, like the fields oscillating in a transformer. While the 14-bit SPI ADC on this board can achieve about 100KSps (or about 700fps maximum), the I2C multiplexer is much slower, and would likely need to be replaced to achieve high framerates. With the Arduino Uno sample code streaming to the Processing visualization (in the youtube video), it's able to sustain about 10fps, and the Raspberry Pi python example achieves about 30fps after increasing the I2C bus from 400KHz to 800KHz. This could likely be increased a bit with some streamlining of the code.
In terms of slow/static fields, it seems pretty easy to find the speakers/vibration motors in cell phones with the current iteration. The neatest picture that it's rendered so far is of someone's open air pod charger -- lots of magnetic fields of different directions to hold in the ear bud headphones while they're charging, I suspect!
Schematics, Design files, Example Code
Available on Github: https://github.com/opensensinglab/magneticimager
Bill of Materials, Approximate Cost
- After looking through the datasheets for nearly every inexpensive hall effect sensor I could find, I settled on the DRV5053VA, which seems to be a good balance of sensitivity and cost. It's range is only +/-9 milliTesla (on the order of about fridge magnet strength), where are most other sensors are +/-100mT, which means they would be much less sensitive to the smaller everyday fields that are more interesting. For larger fields (like those serious neodymium magnets in the video) you can always hold them further from the imager, but if the sensor isn't sensitive enough in the first place, there's no easy way to detect the smaller fields. The DRV5053VA only outputs from 0-2V (1V center = 0mT), but it has a wide input voltage range, and seems very tolerant to mishandling (it's made for automotive applications). Octopart shows that the DRV5053VA tends to get to about ~0.34 in QTY>1000, or about $49 just in hall sensors.
- Analog MUX ( CD74HC4067M ) is $0.60 in QTY100, so about $6 per board.
- I2C I/O Expander ( MCP23017T-E/SO ) is about $1 in any quantity (but, replace this for faster operation)
- The onboard 14-bit 100KSPS ADC (AD7940BRJZ) is expensive, at about $10 in QTY100.
This puts the BOM at around $70 for the 12x12 imager in modest quantities. Making a single board costs about $200.
Thanks for reading -- and apologies to be slow on updates, Iteration 8 is going much less quickly than I expected. This is my first year as a tenure-track professor, and it's largely an all-day every-day job (which I do gladly, it's very rewarding -- it just means there's less time for other projects, which move a little slower than I'd like).