letscontrolit / ESPEasy

Easy MultiSensor device based on ESP8266/ESP32
http://www.espeasy.com
Other
3.26k stars 2.21k forks source link

ADS1115 No measured values with firmware after 12/2022 #4801

Closed NucPower closed 12 months ago

NucPower commented 1 year ago

Hello,

ADS1115 used with D1 mini. (ESP8266-12F and ESP8266EX V3).

The “ADS1115” can be enabled in the “ESP Easy Mega”, but only 0.00 is displayed as the measured value. No matter which type of measurement, which channel or other setting is selected. It still works with the firmware “ESP_Easy_mega_20221224_energy_ESP8266_4M1M.bin (mega-20221224_35f2ff8)”.

Where is the problem? Thanks Dirk

TD-er commented 1 year ago

Please try the latest build as I have been working on this plugin quite recently. See: https://github.com/letscontrolit/ESPEasy/pull/4786

You can try this GH Actions build: https://github.com/letscontrolit/ESPEasy/actions/runs/6106970972

Given the mentioned firmware where the sensor did seem to work, I suspect you may have a fake unit. See also the documentation page for this plugin: https://espeasy.readthedocs.io/en/latest/Plugin/P025.html#p025-page

Since I have spent about 20+ hours in figuring out what might have been wrong with that .... fake module, I hope you will understand it when I will not try to make ESPEasy work properly with such fake chips.

If however you don't have a fake chip, then it will probably work flawless with the linked GH Actions build.

TD-er commented 1 year ago

Oh and just to explain why it "seemed to be working" on the older builds... On older builds ESPeasy might sometimes interpret readings from one pin as if they came from another pin. That bug was fixed around Christmas of 2022. About a month ago someone reported nearly the same issue as you're now reporting and he sent me a few samples of those modules. That's when I started digging and found out that those were fake chips, which were also causing lots of other issues. Sometimes those chips may even stall the I2C bus, just output samples from whatever pin you may have selected and also seemingly act like a 12 bit ADC with some added noise to appear as 16 bit.

NucPower commented 1 year ago

Hello TD-er,

You were right. It was a faulty chip. I have checked it. The pins and the display were also different for me, shifted by +1. Signal at A0 was displayed at A1.

The new ADS1115 that I have bought in the meantime work perfectly. I have installed the latest firmware.

Thank you for your help and great work. Dirk

NucPower commented 1 year ago

solved

TD-er commented 1 year ago

Thanks for getting back about this. Last night Ton also reported my detection algorithm wasn't working, which later proved to be a fake chip too. It had the right markings, but the font was clearly different from what TI uses. And he later found a unit bought over 2 years ago as being an ADS1115, which ESPEasy reports as ADS1015. This one had the markings wiped off from the chip.

So I guess the detection algorithm does seem to work :)

Now the people making the fake chips have to put in more efforts in making a chip which is acting just like the real deal, but I guess that would cut into their profits...

NucPower commented 1 year ago

That´s mine

mine

NucPower commented 1 year ago

Hello, another question about the addresses.

Can you use all four addresses? Also 0x4B? I get the ADS1115 with 0x4B = SCL not enabled.

Thank you Dirk.

TD-er commented 1 year ago

According to the datasheet you have to connect the ADDR pin to either:

It must be connected to either one of these, but only one. I can imagine most boards already have a resistor between ADDR and GND. So if you connect ADDR to either SDA or SCL, you may pull this down to GND and thus I2C will no longer work.

tonhuisman commented 1 year ago

When connecting multiple of these boards to the same ESP, you can also use an I2C Multiplexer, as this is supported by nearly all ESPEasy builds, and when only the 'safe' I2C addresses 0x48 and 0x49 are used, you can have up to 16 of these sensors connected on a single ESPEasy install. That would have to be an ESP32, as the ESP8266 builds only support 12 tasks 😉

NucPower commented 12 months ago

@TD-er Oh yeah, I hadn't thought of that. Thanks Dirk

NucPower commented 12 months ago

@tonhuisman This tip is very good and solves some of the problems. Thanks Dirk