# OV5640 Manual Setting Black Line Calibration (BLC) Error

**URL:** <https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462>\
**Category:** OpenMV Boards\
**Created:** [January 2, 2026, 6:20pm UTC](https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462 "2026-01-02T18:20:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajacobs](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@ajacobs](https://forums.openmv.io/u/ajacobs)\
**Post date:** [January 2, 2026, 6:20pm UTC](https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462/1 "2026-01-02T18:20:36Z")

</div>

Manually setting of gain, exposure and white balance works as expected with the OV5640 sensor. However, manual setting of black light calibration (BLC) causes a washed out and discolored of image.

The attached code reproduces the issue. Start in auto mode take some snapshots, read the blc registers, disable auto mode and set the blc registers with the values read in auto mode, take some more snapshots. The first image is in auto mode, the second is with blc disabled and maually set the blc registers with the tuple read in auto mode.

 ![Auto_Mode](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/a/ad9641e5696ff162eaf8467456b7853f0b38634a.jpeg)  
 ![Manual_Mode](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/9/9d2c7a94c0122bdfcafddc47eb9b74f967cce456.jpeg)  
[Sensor Manual Control V2.py](https://forums.openmv.io/uploads/short-url/3nSUuHSsnUH6wey6EiMPYOeWRT6.py) (1.5 KB)

---

<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:** [January 2, 2026, 7:17pm UTC](https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462/2 "2026-01-02T19:17:29Z")

</div>

Hi, the BLC registers for the OV5640 are opaque to us. However, the purpose of our providing read/write access to them is that you have to read/write them along with the auto registers to restore default functionality from wakeup. You cannot change the mode and apply settings from a different mode…

---

<div class="post-metadata">

**Author:** ![ajacobs](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@ajacobs](https://forums.openmv.io/u/ajacobs)\
**Post date:** [January 2, 2026, 7:45pm UTC](https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462/3 "2026-01-02T19:45:20Z")

</div>

It appeared from the sensor library documentation that one can apply the blc values read in auto mode to set them manually - “if disabled then you can manually set the blc register values via the values you got previously from get\_blc\_regs().”

Doing this works for gain, exposure and white balance, but not for BLC.

Which register values are returned in the get\_blc\_regs tuple?

---

<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:** [January 2, 2026, 7:57pm UTC](https://forums.openmv.io/t/ov5640-manual-setting-black-line-calibration-blc-error/11462/4 "2026-01-02T19:57:40Z")

</div>

It’s [openmv/drivers/sensors/ov5640.c at master · openmv/openmv · GitHub](https://github.com/openmv/openmv/blob/master/drivers/sensors/ov5640.c#L1267)

> <https://github.com/openmv/openmv/blob/master/drivers/sensors/ov5640.h#L112>

As for what they do… unknown. On all our new cameras from Pixart we actually have direct product level support from FAEs. But, not for this sensor.
