Hi,
I'm new to Raspberry Pi and was trying to setup the AMG8833 thermal camera sensor with my board for a project. I read through the learn section but was confused when it comes to the coding. Is there any place where I can find a more descriptive tutorial? Also, how would I go about setting up the camera to transmit wirelessly to a computer?
Thanks in advance for your help.
AMG8833 Raspberry Pi Help
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: AMG8833 Raspberry Pi Help
You're following this guide?
https://learn.adafruit.com/adafruit-amg ... mal-camera
Can you be more specific about the part that you are having trouble with?
The camera itself doesn't transmit wirelessly, so you'd have to do that using the networking capabilities of the Pi.
https://learn.adafruit.com/adafruit-amg ... mal-camera
Can you be more specific about the part that you are having trouble with?
The camera itself doesn't transmit wirelessly, so you'd have to do that using the networking capabilities of the Pi.
- raghs10
- Posts: 5
- Joined: Mon Nov 27, 2017 3:45 pm
Re: AMG8833 Raspberry Pi Help
I think I was able to solve the problem with the camera but do you have any guides on how to transmit the image wirelessly using the Pi? I'm using a Raspberry Pi 3 Model B board which has the capabilities inbuilt, I'm just not sure how to access that.
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: AMG8833 Raspberry Pi Help
Sorry, no guides like that at this time. Let us know if you run into any more troubles with the camera though.
- raghs10
- Posts: 5
- Joined: Mon Nov 27, 2017 3:45 pm
Re: AMG8833 Raspberry Pi Help
Got it.
I did run into one issue, I'm getting a "17" instead of a "69" when I run the i2cdetect code. Does that relate to a specific error? I've checked my wiring and everything seems to be correct.
I did run into one issue, I'm getting a "17" instead of a "69" when I run the i2cdetect code. Does that relate to a specific error? I've checked my wiring and everything seems to be correct.
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: AMG8833 Raspberry Pi Help
That's weird. It's not an error code or anything, it's acting like it sees a device at that address. Can you post the full output you get when you run the command.
Code: Select all
sudo i2cdetect -y 1
- raghs10
- Posts: 5
- Joined: Mon Nov 27, 2017 3:45 pm
Re: AMG8833 Raspberry Pi Help
Sorry for the delay, here is the output:
pi@raspberrypi:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~ $
- raghs10
- Posts: 5
- Joined: Mon Nov 27, 2017 3:45 pm
Re: AMG8833 Raspberry Pi Help
This is the error I get when I try to run the thermal camera image example:
pi@raspberrypi:~/Adafruit_AMG88xx_python/examples $ sudo python thermal_cam.py
Traceback (most recent call last):
File "thermal_cam.py", line 25, in <module>
sensor = Adafruit_AMG88xx()
File "/usr/local/lib/python2.7/dist-packages/Adafruit_AMG88xx/Adafruit_AMG88xx.py", line 113, in __init__
self._device.write8(AMG88xx_PCTL, self._pctl.get())
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 115, in write8
File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 236, in write_byte_data
IOError: [Errno 121] Remote I/O error
hpi@raspberrypi:~/Adafruit_AMG88xx_python/examples $
pi@raspberrypi:~/Adafruit_AMG88xx_python/examples $ sudo python thermal_cam.py
Traceback (most recent call last):
File "thermal_cam.py", line 25, in <module>
sensor = Adafruit_AMG88xx()
File "/usr/local/lib/python2.7/dist-packages/Adafruit_AMG88xx/Adafruit_AMG88xx.py", line 113, in __init__
self._device.write8(AMG88xx_PCTL, self._pctl.get())
File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 115, in write8
File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 236, in write_byte_data
IOError: [Errno 121] Remote I/O error
hpi@raspberrypi:~/Adafruit_AMG88xx_python/examples $
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: AMG8833 Raspberry Pi Help
The error makes sense as the address is not as expected. But why is it returning 0x17? Really odd. Can you post a photo of your setup showing all connections.
- karlwachs
- Posts: 33
- Joined: Thu Jan 14, 2016 7:42 pm
Re: AMG8833 Raspberry Pi Help
the calculation for the pixel values is not correct.
the adafruit spec sheet from panasonic states: https://cdn-learn.adafruit.com/assets/a ... 1498680225
on page 14
""(11) Temperature Register
Register for reading only to indicate temperature data per 1 pixel.
Temperature Data of each pixel is 12 bit data and 2 byte data.
1 LSB has 12 bit resolution (11 bit + sign) which is equivalent to 0.25℃
and it is indicated as two's complement form.""
the correct conversion should be:
for the thermistor it is correct
Panasonic has apparently used 2 different forms to do negative numbers for the thermistor and the pixels.
This was tested with ice and in the freezer: the new formula seems to show the proper numbers, using the github posted python formulas one gets wrong numbers for negative C surfaces
Karl
the adafruit spec sheet from panasonic states: https://cdn-learn.adafruit.com/assets/a ... 1498680225
on page 14
""(11) Temperature Register
Register for reading only to indicate temperature data per 1 pixel.
Temperature Data of each pixel is 12 bit data and 2 byte data.
1 LSB has 12 bit resolution (11 bit + sign) which is equivalent to 0.25℃
and it is indicated as two's complement form.""
the correct conversion should be:
Code: Select all
def twoCompl12(self, val):
if 0x7FF & val == val:
return float(val)
else:
return float(val-4096 )
Code: Select all
def signedMag12ToFloat(self, val):
#take first 11 bits as absolute val
if 0x7FF & val == val:
return float(val)
else:
return - float(0x7FF & val)
This was tested with ice and in the freezer: the new formula seems to show the proper numbers, using the github posted python formulas one gets wrong numbers for negative C surfaces
Karl
- adafruit_support_carter
- Posts: 29150
- Joined: Tue Nov 29, 2016 2:45 pm
Re: AMG8833 Raspberry Pi Help
@karlwachs Thanks. Could you post this as an issue in the repo:
https://github.com/adafruit/Adafruit_AMG88xx_python
https://github.com/adafruit/Adafruit_AMG88xx_python
- greenchad
- Posts: 5
- Joined: Fri Jan 05, 2018 9:24 pm
Re: AMG8833 Raspberry Pi Help
If this code change fixes a problem with negative temperatures, can we get it merged into the master branch on github? I'd submit the pull request, but I haven't tested it myself.
- greenchad
- Posts: 5
- Joined: Fri Jan 05, 2018 9:24 pm
Re: AMG8833 Raspberry Pi Help
Has anyone tried setting the MINTEMP and MAXTEMP dynamically based on the thermistor reading? I've been experimenting with that. With fixed thresholds, the demo on the learn page detects two fingers just fine in a warm room, but can't detect anything in a cold room.
- karlwachs
- Posts: 33
- Joined: Thu Jan 14, 2016 7:42 pm
Re: AMG8833 Raspberry Pi Help
how cold is the room?
- greenchad
- Posts: 5
- Joined: Fri Jan 05, 2018 9:24 pm
Re: AMG8833 Raspberry Pi Help
Right now, the thermistor is showing 25.81 C, but the min temperature from the camera is 19.5 C
Here are some stats from all the pixels with a clear background:
Max = 21.75, Min = 19.5, Ave = 020.67, Median = 020.75
StdDev = 0.45
And here's with my two fingers 3" away (it's not picking up my finger tips):
Max = 28.75, Min = 20.25, Ave = 023.19, Median = 022.12
Max = 002.46
I think I'm going to try to take 100 samples of the background before launching in to the main application. I'll use that as a baseline to set my MINTEMP. For detecting fingers, I think I want to scale the MAXTEMP proportionally? Any suggestions?
Here are some stats from all the pixels with a clear background:
Max = 21.75, Min = 19.5, Ave = 020.67, Median = 020.75
StdDev = 0.45
And here's with my two fingers 3" away (it's not picking up my finger tips):
Max = 28.75, Min = 20.25, Ave = 023.19, Median = 022.12
Max = 002.46
I think I'm going to try to take 100 samples of the background before launching in to the main application. I'll use that as a baseline to set my MINTEMP. For detecting fingers, I think I want to scale the MAXTEMP proportionally? Any suggestions?
Please be positive and constructive with your questions and comments.