mlx90640 thermal camera

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

mlx90640 thermal camera

Post by livwid »

Hi, I am trying to import mlx90640 sensor data over I2C with raspberry pi pico on thonny. Checked the pinout.
Have all the packages installed on pico (all most recent). using it as a circuitpython device. keep getting this error-
AttributeError: 'module' object has no attribute 'SCL'
Any advice- am missing some files?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: mlx90640 thermal camera

Post by mikeysklar »

The Pico pins definitions are slightly different than the example code would be using. The simpletest example code uses:

Code: Select all

i2c = busio.I2C(board.SCL, board.SDA, frequency=800000)
You shold change that for the pico to something like this:

Code: Select all

i2c = busio.I2C(scl=board.GP1, sda=board.GP0, frequency=800000)
https://learn.adafruit.com/getting-star ... es-3082902

User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Re: mlx90640 thermal camera

Post by livwid »

It works- I am able to import the data as serial numbers, but trying to get a heat map now. Most of the code uses numpy/matplot.lib, but when I try to install that package on my raspberry pi pico says there is not enough storage. Is there any other way I can graph the data? I would prefer to see the plotted data as it comes in, but if I need to save a still image and then create a heat map after the fact, that would be fine too.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: mlx90640 thermal camera

Post by mikeysklar »

On a pico running CircuitPython you would normally use ulab.numpy.

User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Re: mlx90640 thermal camera

Post by livwid »

Thanks, good to know! Do you know of an alternative for matplotlib?

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: mlx90640 thermal camera

Post by mikeysklar »

If the goal is to get real-time plots there is a guide for doing it with the Mu editor.

If you really want to use matplotlib there are two computer based CircuitPython guides (not microcontroller):
1. Sidekick + FT232h
2. Jupyter + MCP2221

User avatar
livwid
 
Posts: 7
Joined: Tue Feb 07, 2023 5:00 pm

Re: mlx90640 thermal camera

Post by livwid »

I will take a look at Mu! Thanks.

I do have the code and connection set up through Thonny already though- All the example code I have seen uses numpy and matplotlib; I was just wondering how else to make a heat map without these packages.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: mlx90640 thermal camera

Post by mikeysklar »

There are some specific heatmap examples here NOT using matplotlib.

1. Adafruit MLX90640 IR Thermal Camera

2. ulab: Crunch Numbers fast in CircuitPython

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”