hello everyone,
The idea of the project is to create a small box with an esp module and a tm1651 to read the percentage of the battery of my inverter via wifi. The esp will be powered by a usb power supply.
I have been doing some tests for a few weeks without success. I took the TM1651 Battery LED module following the guide . From the sensor of my inverter called “sensor.inverter_battery_percent” I have to represent the relative percentage of the battery through this module. The display continues to remain off, I have 3 esp8266 D1 mini modules and 3 TM1651 thinking they were defective but even replacing them they still do not work.
Home assistant is installed on raspberry pi, with esp I would like to read the percentage in wifi mode.
Where am I going wrong?
Hi,
thanks for your interest in my problem.
unfortunately I see very little from the log
[21:54:39][I][safe_mode:041]: Boot seems successful; resetting boot loop counter nothing more.
I’m following the technical information of the module referring to the esphome link, therefore it makes me understand that this module is supported. TM1651 Reference
I found various projects on the web with this module often combined with arduino but no reference yaml from which to take inspiration. I looked at the pinout documentation and it doesn’t seem to me that there are particular PINs dedicated to the CLOCK or DIO.
thank you very much! It works, I don’t see anything from the logs but the display is lit and more or less it seems aligned with the battery.
I’ll leave the yaml working in case it can be useful to someone in my situation.
UPDATE:
This morning after leaving the esp on all night I can view the logs with the battery values.
currently the module works and is aligned with the real percentage of the battery (40% with 4 segments on) using id(tm1651_battery).set_level_percent(level);
[08:23:27][D][homeassistant.sensor:024]: 'sensor.inverter_battery_percent': Got state 39.00
[08:23:27][D][sensor:093]: 'battery_percent': Sending state 39.00000 with 1 decimals of accuracy
[08:23:27][D][battery_display:052]: Battery level: 39
The ideal for me is that when the battery is at 42% the green LED that corresponds to segment 6 lights up. With the battery at 40% the string used so far correctly lights up 2 red LEDs + 2 orange ones (the orange ones are 3 in total).
So to decide on a controlled ignition I was experimenting with this code that should light up segment 6 as soon as the battery reaches the value =>42 but it continues to light 7 segments. I played with the various thresholds but without success.
id(tm1651_battery).set_level(10);
} else if (level >= 80) {
id(tm1651_battery).set_level(9);
} else if (level >= 70) {
id(tm1651_battery).set_level(8);
} else if (level >= 60) {
id(tm1651_battery).set_level(7);
} else if (level >= 50) {
id(tm1651_battery).set_level(6);
} else if (level >= 40) {
id(tm1651_battery).set_level(5);
} else if (level >= 30) {
id(tm1651_battery).set_level(4);
} else if (level >= 20) {
id(tm1651_battery).set_level(3);
} else if (level >= 10) {
id(tm1651_battery).set_level(2);
} else {
id(tm1651_battery).set_level(1);
}```
With bitterness I realize only now that some segments are coupled and I am forced to settle for these settings. 2 red segments, 2 green segments and another 2 green segments coupled.
The single segments are only the 3 orange ones and the blue one.
If I had known before I would have built a synoptic with simple LEDs.
Thanks for the tips!