Vext dropping from 3.3V to 3.0V

I’m developing a simple project with a Lora32 (V2), but I’m identifying a 0.3V drop on both Vext pins.

I’m using the Vext pins to power two CSG-1 magnetic sensors with an external pull up (10k resistors for each). I connected the sensor’s positive terminal to the Vext output, and it’s output is connected to pins 12 (SENSOR_ESQ) and 27 (SENSOR_DIR).

I also have a switch (represented by the CONTROLE variable) that is connected to the ESP’s internal pull up, and it’s working as expected: 3.3V on a OFF state for the switch, and 0V from a ON state. If the switch is OFF, there’ll be a voltage drop from 3.3V to 3.0V on the Vext pins.

This is the program’s code:

#define SENSOR_ESQ 12
#define SENSOR_DIR 27
#define CONTROLE 21
//#define ENTRADA 18

void setup() {
  Serial.begin(115200);
  
  // put your setup code here, to run once
  pinMode(CONTROLE, INPUT_PULLUP);
  pinMode(SENSOR_ESQ, INPUT);
  pinMode(SENSOR_DIR, INPUT);
  //pinMode(ENTRADA, INPUT);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  
  Serial.println("Working");
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(1000);
  
  Serial.printf("CONTROLE = %d, ", digitalRead(CONTROLE));
  Serial.printf("SENSOR_ESQ = (Analog: %.3fV, Digital: %d), ", 3.3*((float)analogRead(SENSOR_ESQ))/4095, digitalRead(SENSOR_ESQ));
  Serial.printf("SENSOR_DIR = (Analog: %.3fV, Digital: %d)\n", 3.3*((float)analogRead(SENSOR_DIR))/4095, digitalRead(SENSOR_DIR));  
}

I am a little confused in your code and diagram
digitalWrite(3,HIGH); ?
digitalWrite(4,HIIGH); ?

The sensors power wires should be common to Vext.
and Vext turned on with
pinMode(Vext, OUTPUT);
digitalWrite(Vext, LOW); // turn on power to the sensor
which you must have done as you read 3.3v at Vext.
and to get a logic value if the device is reading open switch or closed with
digitalRead(SENSOR_ESQ) as a bool on or off
just as you have done with
Serial.printf("CONTROLE = %d, ", digitalRead(CONTROLE));

Also the device is 5v minimum supply and vext is only 3.3v.
Have you proven the mag sensor works at 3.3v?

The digitalWrite(3, HIGH) and digitalWrite(4, HIGH) was a mistake on my part. If I enable Vext as you showed, the CONTROLE input will stop working, giving only LOW input values.

I disabled the CONTROLE input to run an isolated test for the Vext powering the sensors. What I found odd about it is that I’m using a Pull Up resistor, but the LOW value isn’t close to 0V on this case: it’s 1.6V. What could be causing that?

The device is working fine with a 3.3V input, but this may be the reason for this behaviour.

I suspect the 1k resistors are not big enough. I have used similar sensors with an ESP32 and did not use pull up resistors .I Just set the GPIO’s as input with weak pull ups.