QUESTION ABOUT FIR(AMG8833) CONNECTION

Discussion related to "under the hood" OpenMV topics.
Scott
Posts: 4
Joined: Sun May 05, 2019 3:24 am

QUESTION ABOUT FIR(AMG8833) CONNECTION

Postby Scott » Wed Mar 18, 2020 10:58 pm

hi! engineers from Openmv.
I just bought a openmv and meet a problem when I connect it to a AMG8833 sensor.
when I tried to run the program it tells me it can read the data that it displayed "0".
By the way, openmv is really a good product. Thanks for your work!
Image
Image

Code: Select all

# AMG8833 Overlay Demo
#
# This example shows off how to overlay a heatmap onto your OpenMV Cam's
# live video output from the main camera.

import sensor, image, time, fir

ALT_OVERLAY = False # Set to True to allocate a second ir image.

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)

# Initialize the thermal sensor
fir.init(type=fir.FIR_AMG8833)

# Allocate another frame buffer for smoother video.
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565)

# FPS clock
clock = time.clock()

while (True):
    clock.tick()

    # Capture an image
    img = sensor.snapshot()

    # Capture FIR data
    #   ta: Ambient temperature
    #   ir: Object temperatures (IR array)
    #   to_min: Minimum object temperature
    #   to_max: Maximum object temperature
    ta, ir, to_min, to_max = fir.read_ir()

    if not ALT_OVERLAY:
        # Scale the image and belnd it with the framebuffer
        fir.draw_ir(img, ir)
    else:
        # Create a secondary image and then blend into the frame buffer.
        extra_fb.clear()
        fir.draw_ir(extra_fb, ir, alpha=256)
        img.blend(extra_fb, alpha=128)

    # Draw ambient, min and max temperatures.
    img.draw_string(8, 0, "Ta: %0.2f C" % ta, color = (255, 0, 0), mono_space = False)
    img.draw_string(8, 8, "To min: %0.2f C" % to_min, color = (255, 0, 0), mono_space = False)
    img.draw_string(8, 16, "To max: %0.2f C"% to_max, color = (255, 0, 0), mono_space = False)

    # Force high quality streaming...
    img.compress(quality=90)

    # Print FPS.
    print(clock.fps())
Attachments
微信图片_20200319105613.png
微信图片_20200319105613.png (43.7 KiB) Viewed 1505 times
微信图片_20200319104916.jpg
User avatar
iabdalkader
Posts: 1179
Joined: Sun May 24, 2015 3:53 pm

Re: QUESTION ABOUT FIR(AMG8833) CONNECTION

Postby iabdalkader » Thu Mar 19, 2020 10:59 am

Please double check the wiring, make sure gnd and 3.3v are connected, and SCL, SDA are not switched. The AMG was tested recently and the driver code is working.
Scott
Posts: 4
Joined: Sun May 05, 2019 3:24 am

Re: QUESTION ABOUT FIR(AMG8833) CONNECTION

Postby Scott » Thu Apr 09, 2020 9:44 pm

iabdalkader wrote:
Thu Mar 19, 2020 10:59 am
Please double check the wiring, make sure gnd and 3.3v are connected, and SCL, SDA are not switched. The AMG was tested recently and the driver code is working.
Hi, iabdalkader!
I am sure that the wiring is ok!
And the firmware version I downloaded is 3.6.2.
My amg8833 address is 0xD0,so I changed the AMG8833_ADDR of py_fir.c of firmware to 0xd0.
But the openmv read the data that it displayed "0".

Thank you again for your patience in answering my doubts!
User avatar
iabdalkader
Posts: 1179
Joined: Sun May 24, 2015 3:53 pm

Re: QUESTION ABOUT FIR(AMG8833) CONNECTION

Postby iabdalkader » Sat Apr 11, 2020 4:44 pm

Hi I tested the AMG sensor again today with OMV3 and OMV4, and it's working fine, if there's no driver bug there's not much else I can do for you. You can try to run an I2C scan and see if the sensor is detected, if it's not detected (code gets stuck) it's either the wiring or maybe the sensor is broken...if you're absolutely sure the wiring is okay then maybe you should try another sensor:

Code: Select all

from pyb import I2C

i2c = I2C(2, I2C.MASTER) # The i2c bus must always be 2.
for a in i2c.scan():
    print("0x%x"%(a<<1))
Note this prints 0xd2

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests