Skip to main content

grideye-driver

Python driver for the Panasonic AMG88 Grid-EYE infrared array sensor.

GitHub Workflow Status PyPI PyPI - License PyPI - Downloads

Installation

The package is available on PyPI. Installation is can be done with your favourite package manager. For example:

pip install grideye-driver

Usage

In order to initialise the device we need an open SMBus object. Depending on the machine that you are running on you may need to provide another bus number or path:

from grideye import GridEye
from smbus2 import SMBus


with SMBus(1) as bus:
    device = GridEye(bus=bus)

The I2C address of the GridEye sensor is either 0x68 or 0x69. The default of the GridEye class is 0x69, and you can specify another address by providing for example GridEye(bus=bus, address=0x68).

Basic usage is as simple as:

with SMBus(1) as bus:
    with GridEye(bus=bus) as device:
        image = device.image

The image variable will be an 8x8 list-of-lists containing 64 floats - each representing the measured temperature in degrees Celsius of a pixel.

Device Mode

The device is instantiated in sleep mode. All functionality is unavailable in sleep mode - except for waking the device. The asleep property will be True.

The device can be woken with the wake()-method, and put back to sleep with the sleep()-method:

device = GridEye(bus=bus)
device.wake()
image = device.image
device.sleep()

Or instead, one can use the GridEye as context manager, which will automatically wake the device upon entering the context, and put it back to sleep when exiting the context - even in case of an error:

with GridEye(bus=bus) as device:
    image = device.image

or

device = GridEye(bus=bus)
with device:
    image = device.image

Settings

The Grid-EYE has two framerate settings: 1 fps or 10 fps. The framerate can be read and set with the frame_rate-property. The framerate value is always a grideye.FrameRate enum object:

device.frame_rate
>>> FrameRate.low   # Low is 1fps

It can be set by providing a FrameRate object:

from grideye import FrameRate
device.frame_rate = FrameRate.high

or by a string with value "low" or "high":

device.frame_rate = "low"

To reduce noise, the Grid-EYE has a moving average feature. It can be controlled by setting the moving_average-property or either True (enabled) or False (disabled).

Measurements

Two properties are available:

temp = device.device_temperature
image = device.image

The first returns the internal device temperature as a float, the latter an 8x8 matrix of sensor readings.

Interrupts

The Grid-EYE sports three types of interrupt: global, pixel-level and overflow.

The interrupts are configured with the interrupt_config-property, with is an InterruptConfig-object. This object has five attributes:

  • An enabled-flag. If this is False, then the interrupt status flag is always True.
  • Two limits: upper_limit and lower_limit.
  • An absolute-flag. If this is False, then the upper and lower limit represent the minimum differences compared to the previous measurement to trigger the interrupt. Otherwise, the upper and lower values represent the absolute values below or above which the interrupt will be triggered.
  • The hysteresis, which represents the hysteresis applied to the limits.

For example:

from grideye import InterruptConfig

device.interrupt_config = InterruptConfig(
    upper_limit=30,
    lower_limit=5,
    hysteresis=1,
    enabled=True,
    absolute=True
)

The interrupts can be easily disabled by calling device.disable_interrupts().

If any pixel breaches the limits as defined in the interrupt config, the interrupt-flag (device.interrupt) will be True. This can be reset to False by calling reset_interrupt.

Additionally, the interrupt status of each pixel is available as an 8x8 boolean matrix in device.pixel_interrupt. These values will not be changed by reset_interrupt: to clear those you will need to call reset_flags().

Finally, there is an overflow-property, which will be set to True if the internal ADC of the Grid-EYE has overflowed. This can be reset by calling reset_overflow(), or by calling reset_flags().

References

Panasonic product page

Metadata

Release files for grideye-driver 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grideye-driver 0.1.1
File Size Uploaded Provenance
grideye_driver-0.1.1.tar.gz 10.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for grideye-driver 0.1.1
File Interpreter ABI Platform
grideye_driver-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.8 kB

Release files / grideye_driver-0.1.1.tar.gz

Download URL grideye_driver-0.1.1.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
11d257a0d355b3fb4e425f6e45f02c52111c2e41ef65f2edbf93457aaf603b72
BLAKE2b-256 checksum
How to use checksums
93ca6fffc0230cdfcb7331691bb7f89cdcdef7019da50ae443074dc92208ef5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / grideye_driver-0.1.1-py3-none-any.whl

Download URL grideye_driver-0.1.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9ddb5d172d016699dbad568a8e9cfee789ad6ec5b5ab341e2b6802d70f428b6
BLAKE2b-256 checksum
How to use checksums
29649e6e3bee07bf6e64dbbc281e4eadedb302ca434bc82570c0dfef46aafaa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for grideye-driver 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page