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.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
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
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