Particle Photon Analog Input Is Extremely Inaccurate And All Over The Place

Hello,
We are currently using a Particle Photon, and have a 0 - 3.3 volt analog signal running into one of the analog input pins. This analog signal is created with a sensor and an amplification circuit consisting of a few op-amps and some passive components. When I observe the analog signal on a volt meter it is perfect and very steady. However, when I read the analog input from the Photon, I get a value ± 1200 (and remember the 10 bit ADC is 0 to 4096, so plus or minus 1200 is virtually unusable). I also experimented with taking several readings and averaging them together… its still all over the place. I also experimented with putting a 1uF capacitor across the analog input pin and ground in an attempt to smooth the signal out for the ADC, and this had no effect on the readings.

On my other projects where I have used ADC chips (I have used MCP3202 - MCP3208 chips) the analog signal would fluctuate maybe ± 10 or so… and taking averages of that works just fine and gives me a reasonable reading.
So this has me thinking that something is not right. Any help is greatly appreciated, thanks again!

Would your external circuit be unduly effected by, shall we say, a surprisingly low input impedance on the ADCs ?

The STM32 ADC system has a (to my mind) low, and somewhat variable input impedance.

Also - just checking the basics, you do set the pin for analog input before using it ?

Hi Andy, thanks for the reply!
I’ll be honest, my lack of knowledge has me a little confused about your question about the circuit being effected by low input impedance of the ADC. This image below is fairly similar to what I have implemented:

Only difference is I have adjusted the resistors around the op-amps to turn it into a 0-3.3 volt signal instead of the 0-5 volt signal like the schematic suggests. Also, my R12 and R13 are 180K and 36K respectively. My circuit also has more bypassings caps (0.1uF and 30pF).
Are you saying that this could be a problem associated with me choosing too high value of resistors which would limit the current of the signal?
I double checked and the pin is definitely set as an analog input. Thanks again!

1 Like