Traducido del English por IA ·
El cableado está bien, tu lectura llega demasiado pronto. En modo no-hold, el HTU21D responde NACK a su dirección de lectura hasta que termina la medición, justo lo que muestra el analizador. Una lectura de humedad de 12 bits tarda hasta unos 16 ms; con la resolución por defecto y un poco de margen, conviene esperar más de 15. La temperatura es la lenta, con 50 ms, y probablemente copiaste el retardo de un ejemplo solo de humedad y tuviste suerte en sentido contrario.Consulto el sensor en lugar de adivinar:
Wire.beginTransmission(0x40);
Wire.write(0xF5);
Wire.endTransmission();
uint8_t n = 0;
for (int i = 0; i < 10 && n < 3; i++) {
delay(10);
n = Wire.requestFrom(0x40, 3);
}
if (n < 3) { /* skip humidity this round */ }
Y cuando una lectura sigue fallando, omite la clave en el mensaje de ese minuto o envía null. No envíes 0: Hermetry lo guarda como un 0 % real y tu regla de alarma se va a aprovechar de ello. null solo significa que no hay lectura.
Wiring is fine, your read is too early. In no-hold mode the HTU21D NACKs its read address until the measurement is done, which is exactly what the analyser shows. A 12-bit humidity reading takes up to about 16 ms, and with the default resolution and some margin you want more than 15. Temperature is the slow one at 50 ms, and you probably copied the delay from a humidity-only example and got lucky the other way round.
I poll instead of guessing:
Wire.beginTransmission(0x40);
Wire.write(0xF5);
Wire.endTransmission();
uint8_t n = 0;
for (int i = 0; i < 10 && n < 3; i++) {
delay(10);
n = Wire.requestFrom(0x40, 3);
}
if (n < 3) { /* skip humidity this round */ }
And when a read still fails, leave the key out of that minute’s message or send null. Don’t send 0, Hermetry stores it as a real 0 % and your alarm rule will love that. null just means no reading.

