# Lepton 3.5 Activating AGC

**URL:** <https://forums.openmv.io/t/lepton-3-5-activating-agc/7440>\
**Category:** OpenMV Boards\
**Created:** [August 26, 2022, 8:02am UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440 "2022-08-26T08:02:39Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![oramafanis](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/oramafanis/32/1783_2.png) [@oramafanis](https://forums.openmv.io/u/oramafanis)\
**Post date:** [September 1, 2022, 7:39am UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/22 "2022-09-01T07:39:53Z")

</div>

flir 3.5 has auto ffc enabled by default. its possible to use manual but still need once ffc on every wake up.  
Without this you will not get results.

I wonder why you are trying to do this with this sensor and not with a simpler one like:

[![](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/9/954aa5df356455d9448155874e2d7661a779f40d.jpeg "New MLX90640 and AMG8833 thermal sensor support!") ](https://www.youtube.com/watch?v=FsOuB61KNnk)

---

<div class="post-metadata">

**Author:** ![BehicMV](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/behicmv/32/2233_2.png) [@BehicMV](https://forums.openmv.io/u/BehicMV)\
**Post date:** [September 1, 2022, 7:47am UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/23 "2022-09-01T07:47:33Z")

</div>

Thank you for answering @oramafanis,  
Because I thought that Lepton 3.5 will be the best sensor for my project. But anyway I bought one time and nothing to do with FFC right now. Now I have to enable/disable the AGC mode.

Do you know something about AGC or filter the image like “max\_temperature , min\_temperature”?

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [September 1, 2022, 12:33pm UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/24 "2022-09-01T12:33:05Z")

</div>

> [@BehicMV](#):
>
> What should I do @kwagyeman @iabdalkader @oramafanis?

What is the question/issue ? Measurement mode resets the sensor and leaves AGC at its default value (disabled). I’m not sure what you expect to see ?

```auto
    if (!measurement_mode) {
        if (LEP_SetRadEnableState(&LEPHandle, LEP_RAD_DISABLE) != LEP_OK
            || LEP_SetAgcEnableState(&LEPHandle, LEP_AGC_ENABLE) != LEP_OK
            || LEP_SetAgcCalcEnableState(&LEPHandle, LEP_AGC_ENABLE) != LEP_OK) {
            return -1;
        }
    }

```

---

<div class="post-metadata">

**Author:** ![BehicMV](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/behicmv/32/2233_2.png) [@BehicMV](https://forums.openmv.io/u/BehicMV)\
**Post date:** [September 1, 2022, 12:47pm UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/25 "2022-09-01T12:47:53Z")

</div>

Hi @iabdalkader  
I was trying to get images more clear from my Lepton 3.5 to detect alive creatures. For this goal, Im trying to enable/disable AGC mode and also filter the image by max min temperatures to get only the alive creatures. Im trying for several days and I couldnt activate AGC as you see my code.

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [September 1, 2022, 1:24pm UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/26 "2022-09-01T13:24:12Z")

</div>

> [@BehicMV](#):
>
> disable AGC mode and also filter the image by max min temperatures

This disables AGC and filter the image by min/max range:

```python
min_temp_in_celsius = 20.0
max_temp_in_celsius = 40.0

sensor.reset()

sensor.ioctl(sensor.IOCTL_LEPTON_SET_MEASUREMENT_MODE, True)
sensor.ioctl(sensor.IOCTL_LEPTON_SET_MEASUREMENT_RANGE, min_temp_in_celsius, max_temp_in_celsius)

```

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [September 1, 2022, 1:27pm UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/27 "2022-09-01T13:27:40Z")

</div>

If you want to have AGC on the default script for just demoing does that.

If you want to turn AGC off then that’s literally what Ibrahim posted above does.

Turning off FFC is something completely different. That’s the calibration method the FLIR Lepton uses with it’s shutter. As previously mentioned many times we don’t have an API call for that but you can use the set\_attribute command to mess with the sensor settings if you want to try to turn that off.

---

<div class="post-metadata">

**Author:** ![BehicMV](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/behicmv/32/2233_2.png) [@BehicMV](https://forums.openmv.io/u/BehicMV)\
**Post date:** [September 1, 2022, 1:43pm UTC](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440/28 "2022-09-01T13:43:36Z")

</div>

Thank you both 🎉

[Previous page](https://forums.openmv.io/t/lepton-3-5-activating-agc/7440.md?page=1)
