Package: grideye-driver
grideye-driverPython driver for the Panasonic AMG88 Grid-EYE infrared array sensor.InstallationThe package is available onPyPI. Installation is can be done with your favourite package manager. For example:pipinstallgrideye-driverUsageIn order to initialise the device we need an openSMBusobject.
Depending on the machine that you are running on you may need to provide another bus number or path:fromgrideyeimportGridEyefromsmbus2importSMBuswithSMBus(1)asbus:device=GridEye(bus=bus)The I2C address of the GridEye sensor is either0x68or0x69.
The default of theGridEyeclass is0x69, and you can specify another address
by providing for exampleGridEye(bus=bus, address=0x68).Basic usage is as simple as:withSMBus(1)asbus:withGridEye(bus=bus)asdevice:image=device.imageTheimagevariable will be an 8x8 list-of-lists containing 64 floats - each representing the
measured temperature in degrees Celsius of a pixel.Device ModeThe device is instantiated in sleep mode. All functionality is unavailable
in sleep mode - except for waking the device. Theasleepproperty will beTrue.The device can be woken with thewake()-method, and put back to sleep with
thesleep()-method:device=GridEye(bus=bus)device.wake()image=device.imagedevice.sleep()Or instead, one can use theGridEyeas 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:withGridEye(bus=bus)asdevice:image=device.imageordevice=GridEye(bus=bus)withdevice:image=device.imageSettingsThe Grid-EYE has two framerate settings: 1 fps or 10 fps.
The framerate can be read and set with theframe_rate-property.
The framerate value is always agrideye.FrameRateenum object:device.frame_rate>>>FrameRate.low# Low is 1fpsIt can be set by providing aFrameRateobject:fromgrideyeimportFrameRatedevice.frame_rate=FrameRate.highor 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 themoving_average-property or
eitherTrue(enabled) orFalse(disabled).MeasurementsTwo properties are available:temp=device.device_temperatureimage=device.imageThe first returns the internal device temperature as a float,
the latter an 8x8 matrix of sensor readings.InterruptsThe Grid-EYE sports three types of interrupt: global, pixel-level and overflow.The interrupts are configured with theinterrupt_config-property,
with is anInterruptConfig-object. This object has five attributes:Anenabled-flag. If this isFalse, then the interrupt status flag is alwaysTrue.Two limits:upper_limitandlower_limit.Anabsolute-flag. If this isFalse, 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.Thehysteresis, which represents the hysteresis applied to the limits.For example:fromgrideyeimportInterruptConfigdevice.interrupt_config=InterruptConfig(upper_limit=30,lower_limit=5,hysteresis=1,enabled=True,absolute=True)The interrupts can be easily disabled by callingdevice.disable_interrupts().If any pixel breaches the limits as defined in the interrupt config,
the interrupt-flag (device.interrupt) will beTrue. This
can be reset toFalseby callingreset_interrupt.Additionally, the interrupt status of each pixel is available
as an 8x8 boolean matrix indevice.pixel_interrupt. These
values will not be changed byreset_interrupt: to clear
those you will need to callreset_flags().Finally, there is anoverflow-property, which will be set to True
if the internal ADC of the Grid-EYE has overflowed. This
can be reset by callingreset_overflow(), or by callingreset_flags().ReferencesPanasonic product page