MLX90640 scale function


I’m using a MLX90640 and wondering if there is a way to use it like a FLIR lepton with AGC off and setting min and max temperature?

I have tried using the scale function but when setting a scale of [35, 40] in a cool room every pixel has a value of 130, not 0 as expected, and as what happens with the FLIR. Is this the correct way to do this and this is just an error or what would be the best way to mimic the FLIR lepton behavior with the MLX90640 sensor?

Thanks so much!

Sounds like an error. Can you provide an example script?

Yep, here’s what I’m running:

import sensor, image, time, fir

drawing_hint = image.BICUBIC

fir.init(type = fir.FIR_MLX90640) #P4 to SCL and P5 to SDA

w = fir.width() * 10
h = fir.height() * 10

clock = time.clock()


    img = fir.snapshot(x_size = w, y_size = h, color_palette = sensor.PALETTE_IRONBOW, hint = drawing_hint, copy_to_fb = True, hmirror = False, vflip  = True, scale = [35, 40], pixformat=fir.GRAYSCALE)
    img.compress(quality = 70)

except OSError:


Hi, can you make a bug on github? I’ve got a higher priority project to get cameras in stock right now and I won’t be able to debug this just yet.

I have created an issue on Github. Thanks for your help and I look forward to your solution!

Do you have a rough estimate for when you will have a chance to look at this?

I can probably do it later this month.

I am focused right now on getting the next version of the OpenMV Cam out to prototype production so we can have stock again of cameras. Done with the schematic more or less, BoM, and now about to start board routing.

1 Like