I know this may not be an issue with Photon, but I would like to consult with your expertise. I am doing some magnetic measurements with Photons and Borons as the main microcontrollers, the problem is that sometimes my readings are very stable (figure 1), and sometimes they are some kind of square wave pattern (which is not expected from this kind of phenomena (figure 2)). Furthermore, I have been investigating possible sources of noise such as temperature, electronic and ADC resolution both in the laboratory and on the field but not any appreciable difference. I did this for the magnetic sensors and consulted with the manufacturer company, and we discarded them. So, the possible problem is reduced to originate from the interaction between the photon and the ADC (see figure 3 for scheme). I was told that this characteristic behavior is observed from an IC instrument going into different (voltage?) compensation. I just wanted to know if somebody has had a similar issue.
Thanks in advance for your help,
P.S. Please discard the third and forth subplot in figures 1 and 2.
Your 1k pull-ups to 5V seem rather strong and for the Boron I’d strongly advise against pulling up to 5V as its GPIOs are only 3.3V tolerant.
Furthermore the Boron also has ~13k internal pull-ups to 3.3V on the default I2C pins so you need to consider them too.
What kind of load will your sensors present on the Vdd pins?
How are you powering your entire setup?
What is your code and the RGB LED on the controller doing during these problematic periods?
Thanks @ScruffR, for your quick reply. The answers are as follows:
What kind of load will your sensors present on the Vdd pins?
The load for my magnetic sensors and ADS is 5V as is indicated in the scheme.
How are you powering your entire setup?
It is powered via the vusb port in the photon/boron with a Li-ion battery on the field and constant power on the lab.
What is your code and the RGB LED on the controller doing during these problematic periods?
I am not sure what you mean in this question, however my code does not have any particular call to the RGB LED on the photon, and it does not blink during these periods.
My initial guess for the pull-up resistors was based on this page
Which explains very well how the I2C mechanism works. Based on that I change my pull-up resistors from 1k to 2.2k, and they improved a little bit but they still show the square wave pattern. By now I just experimenting with the Photons and here the results
How long are the wires or traces from the sensors to the ADS1115?
They are very short (wires/traces), around 10 cm long.
Is your testing being done on a protoboard or a custom PCB?
Both and they also show the same square wave pattern.
I noticed you are not using differential inputs on the ADS1115 using the signal and Vrefout (set to 1.65v) from the sensor. Any reason for this?
I am, from the scheme above you can see that the Vref = 2.4 V in the A1N3 pin of the ADS1115. We are using the multiplex mode for three channels. From the sensor, apart to limit the sources of noise there is no special reason to use the vref on the drv425.
You are using a 1K ohm (R1, R3) and some (unknown) capacitor (C1, C3) as a filter on your sensor output. What drove this design decision?
We have both scenarios, using the RC filter and without it. We just wanted to reduce high frequencies noise, but the square pattern is shown not matter if we use the low pass filter or not.
For the low noise signals we are not sure where they come from. That is why we start testing the sensors and now checking the I2c communication. The problem is sometimes the measurements are this kind of square wave pattern (which is not a natural phenomena), and sometimes they are just fine, so we want to narrow the possible causes.
@juanes, you are using a Vref that is not from the sensor but from a resistor divider powered by the USB via a diode to get 4.8/2 = 2.4v. This reference is not “related” to the sensor Vref. However, I understand you have only four inputs on the ADS1115 and they all seemed to be used.
One thing you can do is a static test without the I2C bus running to see if you have any noise on any of the analog lines, assuming you have an oscilloscope. You should also check Vref and Vdd. If things look clean, then disconnect your sensors (if possible) and ground the analog inputs of the ADS1115 (except for Vref) to see what the AD values are like. They should be hovering about zero or Vref +/- a couple of bits max. Again, check Vref and Vdd for noise.
If everything looks clean by this point, connect one analog input to a sensor and look at that signal. If noise now reappears, then something is going on with the sensor or sensor wiring, either of which may be picking up noise. BTW, is the Photon WiFi on and sending any data during your tests? The RF field could affect the sensor so be sure to turn off the WiFi during your tests.