Trouble connecting WCMCU-101 (OPT101) to ESP32 – inconsistent or saturated output readings

ClaxonDeCon
Posts: 1
Joined: Wed Nov 12, 2025 3:02 pm

Trouble connecting WCMCU-101 (OPT101) to ESP32 – inconsistent or saturated output readings

Postby ClaxonDeCon » Wed Nov 12, 2025 3:17 pm

Hi everyone,

I’m trying to connect a WCMCU-101 (OPT101) photodiode amplifier module to my ESP32, but I’m getting confusing behavior depending on how I wire it.

I already bridged the three back pads (N–C–R) with solder (to enable the internal 1 MΩ feedback resistor), and I’ve tested several wiring configurations.

Here’s what I tried:

Case 1:
VCC → 3.3 V
GND → GND
1M → (nothing)
OUT → GPIO34
–V → (nothing)
COM → (nothing)

Result:
The reading stays at 3.300 V continuously.
Sometimes it starts off normal (values react to light), but after a few seconds it slowly climbs to 3.3 V and stays there.
Could this be caused by a capacitor charging inside the module?

Case 2:
VCC → 3.3 V
GND → GND
1M → (nothing)
OUT → GPIO34
–V → GND
COM → (nothing)

Result:
Output sits around 2.2 V, and when I shine my phone flashlight on the sensor, it drops to about 2.0 V instead of increasing.
That seems reversed — maybe the reference or COM pin isn’t correctly tied?

Case 3:
VCC → 3.3 V
GND → GND
1M → (nothing)
OUT → GPIO34
–V → GND
COM → GND

Result:
Output stays around 2.4 V, completely static — no change when light or shadow varies.

Here's the code I used :

Code: Select all

#include <Arduino.h>

const int PIN_OPT101 = 34;
const float VREF = 3.3;
const float ADC_MAX = 4095.0;

void setup() {
  Serial.begin(115200);
  delay(500);
  analogReadResolution(12);
  analogSetPinAttenuation(PIN_OPT101, ADC_11db);

  Serial.println("OPT101 prêt (ESP32).");
}

void loop() {
  int raw = analogRead(PIN_OPT101);
  float volts = (raw / ADC_MAX) * VREF;
  Serial.println(volts, 3);
  delay(100);
}
Setup details:
• ESP32 powered via USB (3.3 V rail)
• ADC configured as 12-bit with 11 dB attenuation
• Simple Arduino sketch printing voltage every 100 ms (works fine with other analog sensors)

Questions:
1. What’s the correct wiring for the WCMCU-101 (OPT101) in single-supply 3.3 V mode with the ESP32 ADC?
2. Should COM and –V both go to GND, or only one of them?
3. Is there a known charging or recovery effect with the internal feedback capacitor that could cause slow drift up to 3.3 V?
4. Could the op-amp be saturating because of a missing bias path or feedback configuration?

Any working example or reference wiring diagram would be greatly appreciated.
Thanks in advance!

Who is online

Users browsing this forum: Bytespider, Qwantbot, trendictionbot and 3 guests