DIY MORE ESP32 DHT11 Voltage sensor

Whose board doesn’t have a voltage sensor but it can be installed by 2x100k resistors and use the PIN 35 to measurements

Described here https://github.com/SamKry/PlantSpeak/blob/ee8921380514d95091c6c1b4d2064baa52818f57/README.md

and can be used with Tasmota from here https://github.com/sfromis/templates/blob/bbc55ab6e2e2b001a4c9fd7bc49adad4abc2fa5c/_data/gpios.yaml#L4636

or in native code

  const int POWER_PIN = 35;

  analogReadResolution(12); // 12-bit resolution (0-4095)
  analogSetAttenuation(ADC_11db); // Full range ~0-3.3V
  int rawValueVoltage = analogRead(POWER_PIN);
  // Convert to voltage (ESP32 ADC with 11db attenuation)
  float voltage = (rawValueVoltage / 4095.0) * 3.3;  // play with 3.3

Залишити коментар