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?
mlx90640 thermal camera
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mikeysklar
- Posts: 14182
- Joined: Mon Aug 01, 2016 8:10 pm
Re: mlx90640 thermal camera
The Pico pins definitions are slightly different than the example code would be using. The simpletest example code uses:
You shold change that for the pico to something like this:
https://learn.adafruit.com/getting-star ... es-3082902
Code: Select all
i2c = busio.I2C(board.SCL, board.SDA, frequency=800000)
Code: Select all
i2c = busio.I2C(scl=board.GP1, sda=board.GP0, frequency=800000)
- livwid
- Posts: 7
- Joined: Tue Feb 07, 2023 5:00 pm
Re: mlx90640 thermal camera
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.
- mikeysklar
- Posts: 14182
- Joined: Mon Aug 01, 2016 8:10 pm
Re: mlx90640 thermal camera
On a pico running CircuitPython you would normally use ulab.numpy.
- livwid
- Posts: 7
- Joined: Tue Feb 07, 2023 5:00 pm
Re: mlx90640 thermal camera
Thanks, good to know! Do you know of an alternative for matplotlib?
- mikeysklar
- Posts: 14182
- Joined: Mon Aug 01, 2016 8:10 pm
Re: mlx90640 thermal camera
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
If you really want to use matplotlib there are two computer based CircuitPython guides (not microcontroller):
1. Sidekick + FT232h
2. Jupyter + MCP2221
- livwid
- Posts: 7
- Joined: Tue Feb 07, 2023 5:00 pm
Re: mlx90640 thermal camera
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.
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.
- mikeysklar
- Posts: 14182
- Joined: Mon Aug 01, 2016 8:10 pm
Re: mlx90640 thermal camera
There are some specific heatmap examples here NOT using matplotlib.
1. Adafruit MLX90640 IR Thermal Camera
2. ulab: Crunch Numbers fast in CircuitPython
1. Adafruit MLX90640 IR Thermal Camera
2. ulab: Crunch Numbers fast in CircuitPython
Please be positive and constructive with your questions and comments.