Has anyone else worked with these adc modules from eBay?

Has anyone else worked with these adc modules from eBay? The chip is supposedly a Texas Instruments ADS1115, but it doesn’t seem to work quite right. I suspect it is grey market - maybe they’re chips that were thrown out by TI because they didn’t pass quality control.

When I read the inputs in singled ended mode, I get the same reading on A0 + A3 and A1 + A2. The readings are correct, based on the voltage I see on some pots I hooked up.

When I read the inputs in differential mode, the result is better. A0_1 reads correct for input A2, with A3 tied to ground. A2_3 reads correct for A0 with A1 tied to ground (weird!?)

I wonder if the silicon that selects which input to read is messed up somehow, and not isolating the inputs properly.

I purchased five of these, and have tried two so far, with the same result.

Hi Gordon. You need to give us some detail, so somebody can try and replicate your problem. We need to know your physical set-up and the code you are using.

Sorry about leaving out the details, my bad @Ralph_Werner

ESP-01 module using Arduino IDE 1.6.7, esp8266 board libraries 2.1.0-rc2, Adafruit ADS1x15 library 1.0.0

Code is here http://pastebin.com/vuciB5EC
Wiring wise, I have A0 and A2 connected to 10k pots which are across 3v3 and ground, a1, a3 and addr are grounded

Going to try connecting a Teensy to the module, see if I get the same result.

Exact same output from the Teensy

I have the exact same problems with the module, I was thinking about bad soldering but I couldn’t spot that right away. So if anyone can be of any help, that would be awesome! The thing that worried me though was the “ads1115/ads1015” on the board as if they were not sure :stuck_out_tongue:

Are you using pull-up resistors for SDA and SCL?

Yes… I wondered about this, the module has 10k pull ups and my breadboard has 4k7 resistors. I doubt its the resulting low pull up resistance, but its easy to test.

http://www.ti.com/lit/an/slva689/slva689.pdf for more info. I do not have one of those modules to try and replicate the problem, but have found the pull-up resistors are important to get right or there will be communication errors.

I removed the 4k7 pull ups on my board, no improvement.

Feeling ambitious, I removed the 10k pullup on the module, and put the 4k7 back on my board. no change. i scoped the i2c lines and they look perfect, bus length is less than 3", so I doubt it’s a digital problem. I’'m going to buy one of the Adafruit modules these Chinese counterfeits are based on, as a control sample.

Knowing that at least differential mode works lets me get two usable channels from the module.

If communication problems on the i2c bus lead to (only) invalid readings, the i2c driver code your using is bad. Apparently it doesn’t report back actual communication problems. I know the code that Espressif has this issue, I wouldn’t be surprised if the code you’re using has that code copied 1:1 and the author really doesn’t understand how i2c works.

Having said that, for small distances and small load on the bus, the exact value of the pull up resistors never is the real problem.

I think the code for reading the ic is simply buggy.

FYI at my side the exact same problems occurred on an Arduino Pro Mini. Using the Adafruit ADS1015/ADS1115 library and the standard Wire.h.

@Erik_Slagter interesting idea, that would explain why the problem exists on both the esp and the teensy, as they use the same library. I will stop being lazy and use direct i2c commands to interact with the module and report the results.

@Arno_Klarenbeek please share the wire code you used, I’ll try running it on my hardware.

You might want to have a look at my project. It has an i2c implementation written from scratch with extensive error reporting and tight standards compliance: https://github.com/eriksl/esp8266-universal-io-bridge/blob/master/i2c.c

@Erik_Slagter is there no dedicated synchronous serial port module on the ESP? Bit-banging seems really backward for otherwise such advanced hardware. I guess I’m spoiled by how easy to use the Microchip’s M/SSP modules are.

Yes, there are two UARTS. And two SPI interfaces. But no I2C at all, not even a bare bones one (like USI found on ATTiny’s), not even a shift register. I suspected this from the very beginning but only last month Espressif officially admitted there is no I2C hardware on the ESP8266 and the only support is using their “driver” code (which in fact is a very bad bit banging implementation). The hardware isn’t “such advanced” at all, I am used to having this and more on my simple ATMega328, and that one at least has decent I2C hardware support. But hey, it’s cheap. And it’s not such a big deal, the processor is fast enough to do the bit banging on I2C. It’s only becoming complex when you want to go use it as a slave and you’ll have to go detecting start and stop conditions, that may prove tricky… If there were hardware support for only that…

Strange, SPI and I2C are both synchronous serial protocols, it’s strange the chip will support one but not the other in hardware. UART as I recall is only for asynchronous serial, such as RS232,424,485.

I have setup a PIC18F with eight single ended analog inputs as an I2C slave, and have it feeding analog information to the ESP right now. Pic is only 10bit, but that’s enough precision for my application.

There are other good quality dac for i2c though, but they’re mostly in SOIC package (or smaller). The i2c is not the problem, I have it working on quite a list of devices, none of them having problems.

I was tipped off on a fork of the Adafruit library, this fork allows tweaking the samples per second, and conversion delay, to slow things down for a sub-par chip… and it works great! my e-bay nock off ADC chips are now reading correctly. I’m glad to find out the problem isn’t with esp’s i2c routines, lacking as they are.

Here’s the fork: