0

Channel Cross-talk on ADS1015
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Channel Cross-talk on ADS1015

by Entropy42 on Thu Mar 04, 2021 9:45 pm

I have a few of these boards, and I frequently am having this problem on 1 or more channels. All 4 inputs are connected to a protection diode (https://smile.amazon.com/gp/product/B08 ... UTF8&psc=1) with a 1 MOhm resistor. I just modified the sample code to read out all 4 channels on each pass. Here is 4 sets of samples, where I have connected a 1.5 V battery to Ch 2 for the middle 2 samples. As you can see, nothing reads 0 when no voltage is connected, then when I do connect it, every channel increases in voltage, some substantially. Same thing happens if I put the battery on Ch 3, but the other channels change very little when I test Ch 0.
1. What would be causing this? Am I frying something when I solder them?
Ch# Raw V
0 6368 0.790
1 1744 0.216
2 1232 0.160
3 1104 0.138
-------- 0.008371999999999602 -----------
0 7120 0.880
1 6288 0.784
2 12592 1.574
3 6064 0.756
-------- 0.008295000000000385 -----------
0 7024 0.866
1 6256 0.780
2 12592 1.574
3 6048 0.756
-------- 0.007643999999999984 -----------
0 6368 0.790
1 1728 0.214
2 1280 0.162
3 1120 0.138

My test on Ch 1 looked like this:
0 4736 0.584
1 12592 1.574
2 4720 0.592
3 2768 0.342
-------- 0.0080910000000 -----
0 3776 0.464
1 1728 0.194
2 1216 0.146
3 1024 0.132
-------- 0.00905699999999987 -----------
0 3472 0.438
1 2224 0.278
2 1088 0.144
3 1088 0.110

As you can see, that's slightly better, but Ch 2 still goes up by 0.4V. The weird thing I don't understand here, is the values in bold. If the channel.value is equal, how can the channel.voltage be different? I've never tried changing the gain on any of the channels, so its still set to the default.

Code: Select all | TOGGLE FULL SIZE
import time
import board
import busio
import adafruit_ads1x15.ads1015 as ADS
from adafruit_ads1x15.analog_in import AnalogIn

i2c = busio.I2C(board.SCL, board.SDA)
ads = ADS.ADS1015(i2c)
chan0 = AnalogIn(ads, ADS.P0)
chan1 = AnalogIn(ads, ADS.P1)
chan2 = AnalogIn(ads, ADS.P2)
chan3 = AnalogIn(ads, ADS.P3)

print("{:>5}\t{:>5}\t{:>5}".format('chan#','raw', 'v'))
while True:
    t0 = time.clock()
    print("{:>5}\t{:>5}\t{:>5.3f}".format('0', chan0.value, chan0.voltage))
    print("{:>5}\t{:>5}\t{:>5.3f}".format('1', chan1.value, chan1.voltage))
    print("{:>5}\t{:>5}\t{:>5.3f}".format('2', chan2.value, chan2.voltage))
    print("{:>5}\t{:>5}\t{:>5.3f}".format('3', chan3.value, chan3.voltage))
    t1 = time.clock() - t0
    print("-------- ", t1, " -----------")
    time.sleep(0.5)

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by Entropy42 on Thu Mar 04, 2021 9:49 pm

This is unrelated, but the protection diode circuits have a pin for Vin, which I'm supplying 5V to from the Pi, but I don't understand what its purpose is. All the piezo protection diode circuit diagrams I've seen don't have an input voltage, and it still clips the output when I don't supply Vin, though Vo will range from 4.5 to -0.5V.

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by adafruit_support_bill on Fri Mar 05, 2021 7:15 am

As you can see, nothing reads 0 when no voltage is connected,

That is expected. When there is no connection, the pin is 'floating' and the device will read whatever static voltage is on the pin. This can be influenced by many things - including the voltage on adjacent pins. If you want it to read zero, you need to connect it to something at 0V potential (i.e. GND).

This is unrelated, but the protection diode circuits have a pin for Vin

The link you posted was for a Piezo sensor. Not a protection diode. Please post a diagram of your circuit and specs for the actual component you are using.

adafruit_support_bill
 
Posts: 81550
Joined: Sat Feb 07, 2009 10:11 am

Re: Channel Cross-talk on ADS1015

by Entropy42 on Fri Mar 05, 2021 12:17 pm

Thanks for the response.

The link I posted is for both the piezo and (what I thought was) the protection circuit. It is a Zener diode (5.1V, BZT52C5V1) and 1 MOhm resistor (I think in parallel like the diagram below), but I don't know what the 5V input would be for. Unfortunately there is no datasheet for it. I just hoped that there is a common diode protection circuit that would take a Vin, and someone here might be familiar with it:
j0Vi7.jpg
j0Vi7.jpg (37.44 KiB) Viewed 107 times
.
I measure 1 MOhm across the resistor, and 650kOhm between the signal out pin and ground, so it definitely is at least providing a reference ground for the ADC inputs. It also does keep the voltage output between 0 and 5 V, since I've captured piezo hits on an oscilloscope without the diode circuit and I get +/-30V oscillations. With diode circuit in between, nothing comes out above 5 V.

The ADC input pins also ready wildly different values without the piezo circuit connected at all. Once its connected they get down closer to 0.

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by adafruit_support_bill on Fri Mar 05, 2021 1:00 pm

A piezo can generate pretty high voltage spikes. The combination of the Zener and the resistor are there to keep the output to 5v so it can be used by most microcontrollers. If you are using it with a lower voltage analog input, you could either divide it down or replace the zener with a lower voltage version.

adafruit_support_bill
 
Posts: 81550
Joined: Sat Feb 07, 2009 10:11 am

Re: Channel Cross-talk on ADS1015

by Entropy42 on Fri Mar 05, 2021 1:13 pm

To eliminate that circuit from consideration, I tested the ADC without it. I have pull-down resistors (Ch0 0, Ch1 10k, Ch2 100k, Ch 3 1M) attached between the ADC inputs and ground. I tested a few different values.
The issue still persists on some channels, but it I think it slightly improved.
Putting the battery on Ch0 works perfectly. That channel reads 1.57V and the other channels don't change at all.
Putting the 1.5V battery on Ch2 produces only a 0.5 V increase on Ch 3, and basically no change on Ch1 (Ch0 is floating)
Putting the battery on Ch1 or Ch 3 produces on a 0.1V increase on Ch2

Why can't I post "Ch 3" without a space in it?

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by adafruit_support_bill on Fri Mar 05, 2021 1:41 pm

What happens if you read each channel twice as below and only print the second value?

Code: Select all | TOGGLE FULL SIZE
chan0 = AnalogIn(ads, ADS.P0)
chan0 = AnalogIn(ads, ADS.P0)

chan1 = AnalogIn(ads, ADS.P1)
chan1 = AnalogIn(ads, ADS.P1)

chan1 = AnalogIn(ads, ADS.P1)
chan1 = AnalogIn(ads, ADS.P1)

chan3 = AnalogIn(ads, ADS.P3)
chan3 = AnalogIn(ads, ADS.P3)

adafruit_support_bill
 
Posts: 81550
Joined: Sat Feb 07, 2009 10:11 am

Re: Channel Cross-talk on ADS1015

by Entropy42 on Fri Mar 05, 2021 5:09 pm

Putting the 1.5V battery on Ch2 still produces a 0.5 V increase on Ch 3.

I think that suggested code just defines the channel twice though, it doesn't actually make 2 reads? All the reads are in the while loop. I also tried
Code: Select all | TOGGLE FULL SIZE
while True:
    t0 = time.clock()
    x0 = chan0.voltage
    print("{:>5}\t{:>5}\t{:>5.3f}".format('0', chan0.value, chan0.voltage))
    x0 = chan1.voltage
    print("{:>5}\t{:>5}\t{:>5.3f}".format('1', chan1.value, chan1.voltage))
    x0 = chan2.voltage
    print("{:>5}\t{:>5}\t{:>5.3f}".format('2', chan2.value, chan2.voltage))
    x0 = chan3.voltage
    print("{:>5}\t{:>5}\t{:>5.3f}".format('3', chan3.value, chan3.voltage))
    t1 = time.clock() - t0

Which I think would do a read of the voltage value, throw it away, then do it again and print it. Still have a 0.5V change in Ch2 when testing battery on Ch 3.

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by Entropy42 on Fri Mar 05, 2021 5:28 pm

adafruit_support_bill wrote:A piezo can generate pretty high voltage spikes. The combination of the Zener and the resistor are there to keep the output to 5v so it can be used by most microcontrollers. If you are using it with a lower voltage analog input, you could either divide it down or replace the zener with a lower voltage version.

Yep, this was why I had that circuit there. I want a 5V output from the diode circuit because my ADC is configured for 5V, I just didn't understand why the Zener circuit also has a reference voltage input. The specs for it say that the diode circuit can cap at either 3.3 or 5V, so I think somehow the Vref determines if it operates at 3.3V or 5V. Regardless, this was just a secondary question. My real problem is getting rid of the cross-talk.

Entropy42
 
Posts: 6
Joined: Mon Feb 01, 2021 4:44 pm

Re: Channel Cross-talk on ADS1015

by adafruit_support_bill on Sat Mar 06, 2021 7:31 am

Sometimes you see 'crosstalk' on multi-channel ADCs when you switch channels because it takes some time for the input signal to settle. Taking two readings and throwing away the first often takes care of that.

Not sure what else might be going on there. I'll ask one of our analog circuit experts to take a look.

adafruit_support_bill
 
Posts: 81550
Joined: Sat Feb 07, 2009 10:11 am

Re: Channel Cross-talk on ADS1015

by adafruit_support_mike on Sat Mar 06, 2021 10:04 am

The schematic above looks to be consistent with the photos of the boards at Amazon.

Piezo sensors emit current when they flex, and the 1M resistor turs that into a voltage. The zener diode in parallel keeps the voltage from going too high if the current is especially stong.

Also, looking at the frint and back photos, the pin for positive voltage doesn’t seem to be connected to anything. Three-pin power/ground/signal connections are common though, so the vendor is probably sticking to that format. You can safely ignore it though.

You mentioned seeing crosstalk between the channels when a battery was connected to one of them. That’s a DC signal, so we can probably rule out inductive or capacitive coupling.. those cause problems when the current or voltage changes quickly.

That leaves resistive coupling, and the most common reason for that is two current loops passing through the same resistance.. usually the GND wiring, but other connections are possible.

Post a photo showing your physical hardware and the connections that give the unexpected readings please. 800x600 images usually work best.

adafruit_support_mike
 
Posts: 63053
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.