pvvx / ATC_MiThermometer

Custom firmware for the Xiaomi Thermometers and Telink Flasher
https://github.com/pvvx/pvvx.github.io/tree/master/ATC_MiThermometer
Other
2.75k stars 196 forks source link

Issue with the accuracey of the CR2032 graph and what's actually happening. #395

Open 420pootang69 opened 8 months ago

420pootang69 commented 8 months ago

I'll keep this brief.

I initially was setting my units to advertise (using ATC profile) every 10 seconds, but after seeing the graph showing that there is no/little point in this I switched to 2.5 seconds.

Two months later and the unit at 2.5 seconds is showing a battery of 80%, but the ones at 10 seconds are mostly still showing 100% battery.

Am I reading that chart incorrectly, or is the chart wrong?

EDIT: Just to link direct to the chart PowerAdvInt

pvvx commented 8 months ago

This is the calculation for Xiaomi LYWSD03MMC B1.4 with a 220 mAh CR2032 battery (+25С). Taking into account the installed capacitor on the printed circuit board in the power circuit. Without capacitors, the battery operates up to 60%. The diagram is based on real measurements of sleep currents and circuit activity at a transmission level of +0dB. In the settings, only the interval is changed. The rest of the settings are default. The external BT-BLE logger works in passive scanning mode (!).


  1. Not all CR2032 batteries are designed for pulse consumption and low temperature. See additional publications on this topic.
  2. Cheap Chinese CR2032 last about 8..10 months. Real example on the chart. The thermometer (LYWSD03MMC B1.9) was operated outdoors at the indicated temperatures and humidity. No modifications (installation of a capacitor) were made. (Failure due to high humidity when working on the second battery. The birds threw the thermometer to the ground, into the rain :). Sent to the trash heap.) image https://www.ti.com/lit/wp/swra349/swra349.pdf

Tested CR2025

  1. Depending on the HW version of the LYWSD03MMC thermometer, they consume different amounts of energy. Depends on the type of LCD controller and sensor.
  2. Working the thermometer with ESPHome or other programs on the ESP32 that make the connection drains the battery terribly. The reason is the loss of ESP32 packets and the low speed of service of BLE traffic. The thermometer has to duplicate transmissions many times.
420pootang69 commented 8 months ago

Thanks for your detailed response. Honestly I was going with the idea that they're just terrible CR232s they come with as stock and when I change them, I might get a better lifespan. They are ridiculously cheap modules after all. Yes, I am using them in advertising mode and passively receiving the messages, not connecting to them.

(Failure due to high humidity when working on the second battery. Sent to the trash heap.)

Can you expand on this one? I put one outside during wet Irish weather where the humidity would have been at 90%. It failed and seems to be in a boot loop or something. Just wondering if I'm wasting my time putting another outside and should use something else for outside measurements.

pvvx commented 8 months ago

Our prevailing humidity is >85%. In summer there are two thermometers in the greenhouse. Every night they are covered with dew, in the form of dripping drops... :)

The batteries included with the thermometer are more or less normal. Better than CR2032 by $0.08.

pvvx commented 7 months ago

Xiaomi LYWSD03MMC V1.9 test on the cheapest CR2016 battery image

sezlony commented 7 months ago

how is it possible, that battery still works for days (or even for weeks) after reaching 0% ? this annoyes me more than the (relative) quick discharging. could it be a FW bug or is it just me?

Screenshot 2023-12-07 at 13-36-48 Előzmények – Home Assistant

pvvx commented 7 months ago

If a CR2032 battery drops to 2.200V, then it is considered 0% discharged. At a temperature of -30C, the voltage of the new CR2032 battery is 2.2 V when loaded with the current consumption of the thermometer.

The thermometer is equipped with a program that switches off to sleep mode when the voltage is below 2.2V and restarts when the voltage rises. This ensures stable operation from solar panels with small batteries. And in cases of outdoor use, at low temperatures. If the voltage drops sharply below 2,000 V, Xiaomi LYWSD03MMC will show this voltage on the screen in mV and go into sleep mode for a few minutes with ultra-low consumption (1 µA). After some time, the voltage on CR2032 may be restored and the thermometer will start again. Although the CPU itself can operate up to 1.8V, manufacturers do not recommend using Flash, sensors and screens at voltages below 2.2V.

The percentage of charge is transmitted in whole values, without fractional parts. 0% does not mean complete zero. There is such a thing as "rounding". 0.00000001...0.500000% = 0% :P

Write about your dissatisfaction with the manufacturer CR2032. And also write to the Bluetooth SIG why the battery charge value is transmitted in integers 0..100%.

You can write a script in HA adding to the charge percentage any number you choose and a value of 0% which will not.

pvvx commented 7 months ago

CGPR1 Qingping Motion & Light:

image

image

Outdoor temperature: image

pvvx commented 7 months ago

this annoyes me more than the (relative) quick discharging. could it be a FW bug or is it just me?

Don't use cheap Chinese batteries. The difference in capacity between cheap and normal CR2032 batteries reaches more than 90%. And write to Xiaomi why they didn’t put capacitors on the sensor board, which the developers provided and recommended by all chips manufacturers. Because of this, the battery loses up to 40% of its charge. Xiaomi saves a couple of cents.

Sample - https://github.com/devbis/z03mmc/issues/11#issuecomment-1841546441

pvvx commented 7 months ago

@sezlony - Regarding rapid discharge and the difference in capacities available at retail on the CR2032 battery, read the publications in the "White Paper SWRA349" from the engineers at Texas Instruments.