thermopile shield code

Discussion related to "under the hood" OpenMV topics.
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

thermopile shield code

Postby tedmeyers » Sat Jul 02, 2016 4:38 pm

I've had great success with the example code in the IDE, but have not been able to get the thermopile shield to work (it runs, but does not work). I found this page:
https://openmv.io/docs/openmv/tutorial/thermopile.html

That page suggests that the IDE example code does not work, and that the new code it gives does work, but that code does not seem to compile, it complains about the MLX library not being present.

Any ideas?

Thanks,

Ted
User avatar
kwagyeman
Posts: 4430
Joined: Sun May 24, 2015 2:10 pm

Re: thermopile shield code

Postby kwagyeman » Sat Jul 02, 2016 5:12 pm

That page is outdated. Sorry, it seems when I uploaded new documentation the old stuff wasn't deleted.

As for the thermopile shield. It should work right out of the box.

What firmware version are you using? v1.4 I know it works. Ibrahim fixed... the code for v1.5. Never tested if what he did worked.

What kind of behavior are you getting? Just a blue bar? Did you try holding a flame in front of the device? Or an ice cube?
Nyamekye,
User avatar
kwagyeman
Posts: 4430
Joined: Sun May 24, 2015 2:10 pm

Re: thermopile shield code

Postby kwagyeman » Sat Jul 02, 2016 5:17 pm

Just deleted the old docs. Too many questions about that.
Nyamekye,
User avatar
iabdalkader
Posts: 1214
Joined: Sun May 24, 2015 3:53 pm

Re: thermopile shield code

Postby iabdalkader » Sat Jul 02, 2016 7:05 pm

The example script in the IDE works I just tested it, can confirm it works.
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

Re: thermopile shield code

Postby tedmeyers » Sun Jul 03, 2016 1:47 am

Okay, thanks for testing it. I'm using the V3 Camera that I just got from the kickstarter (IDE says OpenMV2). I just get the blue bar with flame or ice cube). Everything else that I've tried with the camera (LCD, several of the demo scripts) all seem to work. I plugged the thermopile in, just like in the pictures and ran the script and got the blue bar, but nothing but blue.
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

Re: thermopile shield code

Postby tedmeyers » Sun Jul 03, 2016 1:54 am

Also, it says that the ta, to_min, and to_max are all NaN.
User avatar
kwagyeman
Posts: 4430
Joined: Sun May 24, 2015 2:10 pm

Re: thermopile shield code

Postby kwagyeman » Sun Jul 03, 2016 2:26 pm

Mmm, okay, so, do you have a USB protocol analyzer? Or, do you have an I2C device that you can attach to the I2C bus on the camera? I'd like to know if there's valid I2C data on the link.

If the data is valid and the thermopile shield isn't responding then I can send a replacement.
Nyamekye,
User avatar
iabdalkader
Posts: 1214
Joined: Sun May 24, 2015 3:53 pm

Re: thermopile shield code

Postby iabdalkader » Sun Jul 03, 2016 2:28 pm

Seems like a bad shield, if so we'll send you a replacement. Do you have a multimeter ? can you test for continuity between the I2C lines on the shield and/or on the camera ?
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

Re: thermopile shield code

Postby tedmeyers » Mon Jul 04, 2016 10:48 pm

okay, I'm out of town for a few days, I'll test it some more when I get back.
charliegolf
Posts: 1
Joined: Sat Jul 09, 2016 3:59 pm

Re: thermopile shield code

Postby charliegolf » Sat Jul 09, 2016 4:07 pm

I believe I've got the same condition. Static blue bar while using the thermo shield (with or w/o using lcd). Roughly 26 Megohms between I2C lines on camera.
User avatar
kwagyeman
Posts: 4430
Joined: Sun May 24, 2015 2:10 pm

Re: thermopile shield code

Postby kwagyeman » Sat Jul 09, 2016 4:58 pm

Hi, do you see any data moving on the wires? Do you have a protocol analyzer?

Do you have another I2C device? can you test out with that to verify the I2C bus works for another device? please remember at add plug up resistors.
Nyamekye,
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

Re: thermopile shield code

Postby tedmeyers » Sun Jul 10, 2016 10:49 pm

Okay, I was able to test the sensor by hooking it up to an arduino. From the datasheet I see that the sensor contains two chips, the eeprom and the actual sensor chip; each with their own i2c address. The eeprom appears to work correctly, but when I send a read request to the sensor address I get no response, (I did find some arduino code for the sensor, and that code did not work any better than mine,) So, it appears that the PCB is good, it is just the sensor chip that is bad -- I did test all the connections and traces on the board, and the board does seem to be okay, other than the sensor.
User avatar
kwagyeman
Posts: 4430
Joined: Sun May 24, 2015 2:10 pm

Re: thermopile shield code

Postby kwagyeman » Mon Jul 11, 2016 10:04 am

Sigh... alright, we don't have QC on these modules since they are so simple. So, I guess something like this can happen.

Please email [email protected] for what you'd like to do.

I'm sorry the module is not working. We've tested our code out on 10 of them and haven't had any problems. Well, anyway, just one more reason not to sell these things. Random failures are not my kinda product. Maybe the storage temp or something was violated.
Nyamekye,
User avatar
iabdalkader
Posts: 1214
Joined: Sun May 24, 2015 3:53 pm

Re: thermopile shield code

Postby iabdalkader » Mon Jul 11, 2016 2:56 pm

You can scan the i2c bus using this script:

Code: Select all

from pyb import I2C

i2c = I2C(2, I2C.MASTER) # The i2c bus must always be 2.
print("")
for i in i2c.scan():
    print("%x"%(i))
When I run this with the MLX shield connected, it prints addresses from 0x50 to 0x60
tedmeyers
Posts: 12
Joined: Sat Jul 02, 2016 4:32 pm

Re: thermopile shield code

Postby tedmeyers » Tue Jul 12, 2016 12:15 am

Well, this is our lucky day! I ran the I2c scanner script and it returned addresses from 50 to 60 as expected (not the case when I had it hooked up to my arduino running similar code), so I ran the fir example script and it now works, Go figure?! Anyway, I'm happy now; thanks for all the help!

Ted
User avatar
iabdalkader
Posts: 1214
Joined: Sun May 24, 2015 3:53 pm

Re: thermopile shield code

Postby iabdalkader » Tue Jul 12, 2016 1:09 am

tedmeyers wrote:Well, this is our lucky day! I ran the I2c scanner script and it returned addresses from 50 to 60 as expected (not the case when I had it hooked up to my arduino running similar code), so I ran the fir example script and it now works, Go figure?! Anyway, I'm happy now; thanks for all the help!

Ted
I think some pins were not connected, it happened to me a few times before, a pin would just bend to one side of the header.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests