Arduino MLX90393 Library

A project log for 3D Magnetic Field Scanner

Capture interactive models of magnetic fields with your 3D printer

Ted YapoTed Yapo 07/23/2016 at 22:192 Comments

I'm probably not going to use an arduino as the controller for this project, but I realize a lot of people do use them, so I wrote what I think is a pretty comprehensive arduino library for interfacing with the MLX90393 over I2C. The code is here on GitHub. If you use it with a 5V arduino board, remember to include level translators to avoid damaging the MLX90393, which doesn't have 5V-tolerant I/Os. You have the option of connecting the DRDY line to one of the arduino inputs for the end-of-conversion signal or using a timed-conversion mode based on the timings in the datasheet.

So far the code has just a little mileage on it, so watch for anything funny. The basic functions all seem to work.

After having to deal with the way the arduino build system handles includes, I feel like I need a shower. Ick.


yakun wrote 12/08/2017 at 09:37 point

Hi Ted, i've read about your Arduino code. It's really helpful. but i found that the magnetic value was calculated with a gain_factor multiplied. I am wondering if the gain_factor was from datasheet or empirical experience? Thank you for your great work!

  Are you sure? yes | no

Ted Yapo wrote 01/11/2018 at 05:22 point

I don't know why I'm not getting email notifications for these messages.  The gain_factors in the code were from the datasheet.

I have just learned that there is a new version of the datasheet with different gain factors.  Those are not incorporated into the code yet.  I am working on it now.

  Are you sure? yes | no