Elixir library for MLX90640 Far Infrared Thermal Camera

Hello,
I am playing a bit with the MLX90640 far infrared thermal sensor array, and I wrote an Elixir library to interface with it. It is published on Hex as elixir_mlx90640, and it is designed to work on Linux platforms, such as Nerves. So far, I tested it on a Raspberry Pi Zero W.

The MLX90640 is an inexpensive thermal camera. It has a low resolution (36 x 24 pixels), but it is quite precise, and a nice sensor for the price. I found that interfacing it with micro-controllers or with Linux using the provided C++ libraries is a bit tricky and error prone (lots of gotchas), so I hope I made it easier to use it with this Elixir library.

Let me know what you think :slight_smile:

9 Likes

That is a really cool library. Great work :+1: That sensor might be low resolution, but I can think of many real-world applications for it!

2 Likes

I made a few fixes for Nerves, and created this example project for the Raspberry Pi (demo image on the repo page): https://github.com/lucaong/nerves_thermal_camera

I have to say, it’s a really fun sensor to work with :slight_smile:

4 Likes

That’s super awesome! I want one of these sensors now! Would be really neat to display onto a small LCD and have a hand-held thermal camera. :rocket:

1 Like

I am waiting for a M5Stack device to make a small, battery powered thermal camera. Unfortunately on the ESP32 it’s going to be C, not Elixir, but it’s a convenient package. Alternatively, I am thinking to get a small screen and try out Scenic.

The fun part of doing it in Elixir is also that, once you get the pixel temperatures, there is so much you can do with the data: people presence detection is much easier than with normal cameras, and does not have many privacy concerns (you can easily detect people, but definitely cannot do face recognition), and the temperature measurements are actually very precise. Heat-seeking robots would also be another fun project!

One thing that would be great in the current Raspberry Pi setup, is to open a WiFi access point on the Pi instead of using an existing WiFi network. That way, one could just connect to the Pi access point and see the thermal imaging via browser, removing the current need to create a custom firmware image that contains the user’s WiFi credentials. I know a few people did something around Nerves and hostapd, but I did not try yet. Anybody has advices?

1 Like

Here are instructions for setting up the raspi as a wifi access point: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md
Best to do this using wired access!
If you want the raspi to auto-detect your home wifi network and use that if available, and become a wifi access point only if your home wifi network is unavailable, the instructions here work: http://www.raspberryconnect.com/network/item/315-rpi3-auto-wifi-hotspot-if-no-internet
Caveat: I did this on a raspi 3, and using Raspian, not the Nerves-installed OS.

2 Likes