analogRead() adding noise to signal?

Using: ATmega2560 microcontroller with the Arduino Bootloader

I have a pressure sensor connected to 2 separate voltage buffers, one voltage buffer is fed into the arduino, the 2nd goes on into additional filtering (both signals are read directly after the buffer)

the signal going into the arduino seems to have a very consistent period/amplitude and doesn’t seem to be random noise, but it is adding noise, while the 2nd buffer that continues to additional filtering does not have this noise. I added a picture from the oscilloscope below depicting the noise that’s being produced from the signal being read from the arduino (the signal is supposed to be centered at .2)

I guess my question is, would there be any reason that the arduino’s analog input load as adding noise to the signal as it passes into the arduino

Edit: we also tested one of our unused analog pins that was empty and just simply read the empty signal just to see if this noise was added to it as well, and it wasn’t… also, everything in the system shares common ground plane

I guess my question is, would there be any reason that the arduino's analog input load as adding noise to the signal as it passes into the arduino

I doubt it. What exactly is the scope connected to? At a guess I would say that this signal was being generated by your op amp and being filtered out later. However at 1MHz that can't be a signal through the A/D because you can't sample that fast.

Grumpy_Mike:

I guess my question is, would there be any reason that the arduino's analog input load as adding noise to the signal as it passes into the arduino

I doubt it. What exactly is the scope connected to? At a guess I would say that this signal was being generated by your op amp and being filtered out later. However at 1MHz that can't be a signal through the A/D because you can't sample that fast.

it's 318 kHz not 1MHz, the blue signal isn't being read from the oscilloscope, you can ignore that.

the oscilloscope is connected to the output of the buffer going to the Analog Input of the arduino. I can post a measurement of the signal coming from the 2nd buffer then then goes on to additional filtering, but basically it's a "flat" line at 0.2v (what seems to be the center of the noisy signal from the buffer going to the analog input) without this consistent noise

Can you post a schematic. At a guess I would say it was a lack of decoupling on the op amp power supply.

Grumpy_Mike: Can you post a schematic. At a guess I would say it was a lack of decoupling on the op amp power supply.

I have .1 uF decoupling capactitors. it's a quad op-amp chip, that's why I only have decoupling on one of the op-amps but they are, it's all on the same chip. The red box shows what the oscilloscope is reading (the one with the noise) which is what's going to the arduino Analog Input and the green box is the one that if measured does not have that noise and is just a consistent 0.2v, the green box goes on to additional op-amps.

Thanks for posting that.
Is there anything stoping the arduino’s input from seeing a negitave voltage? That will damage it and might cause the oscillation you are seeing. Does this diasapeare when you disconnect that output from the arduino’s input?

Grumpy_Mike: Thanks for posting that. Is there anything stoping the arduino's input from seeing a negitave voltage? That will damage it and might cause the oscillation you are seeing. Does this diasapeare when you disconnect that output from the arduino's input?

The sensor starts at .2V and goes up to 5v (though with the noise that is being generated for unknown reasons, it does seem to dip a little into the negative (no more than around .1V) since the noise has a peak-peak amplitude that is around .6V and the sensor starts at .2V ... we can't really disconnect it because it's already traced on a PCB (i.e. we're using the microcontroller loaded with the bootloader on a PCB layout) though, we did try checking an open analog input that I temporarily programmed the microcontroller to read from constantly and there was no noise being produced there. Tomorrow though we're going to try to connect the clean signal (the green box) into another Arduino we have laying around to see if when we do, it adds the same noise, but until then we're still unsure what's causing the noise, all we know is that only at points where the signal is being sent to an arduino analog input, this same noise is added (same amplitude and frequency in every case).

on a side note, we just burnt the bootloader on the atmel microcontroller (ATmega2560-16au), we didn't set any of the fuses to use an external oscillating crystal (yet, one is wired in though), could this possibly be an issue?

Well, we ended up just doing additional tests before heading home:

First we took the clean signal (green box) and wired it to a free analog input (a test point on the PCB) to see the same noise was added, it wasn't, the signal remained clean

Next, we took an external buffer we had previously made on a perfboard, same schematic, and fed it a clean 1V signal, whose output we put into one of the free analog inputs, then tested the signal coming into the arduino with the oscilloscope, that signal remained clean as well

We're still pretty stumped as to why we are getting this noise (which doesn't look random since the frequency/amplitude is the same in each case) is added to the signal.

Looking at the circuit I think your resistor values are all out, R115 and R122 are down as 0R and R117 and R133 are down as 10M. These values are way out for correct operation. I am willing to bet your noise is coming from the op amp not the arduino. The only filtering you have on the other amp is a feedback cap of 27pF. Why are you doing that, this is way too low to be actually effective in any sort of signal you are going to get from a pressure sensor. It is probably just stabilising the op amp because of the too high value of the 10M. I would make the 10M resistors 220K and the 0R resistors 10K. I would also put a 27pF cap across R116 to stabilise it. Then I think you will find your op amp will stop oscillating.

Thats what I think. Your OpAmp circuit is a noise generator and pickup for noise with that very high impedance of 10M.

Why do you use the OpAmps at all? The pressure sensor output can be connected to an analog input of the ATmega2560. I would recommend a small resistor and capacitor for safety. You already have 680pF at the sensor output. Perhaps a resistor of 1k to the analog input of the ATmega2560, and an other 1nF to ground at the analog input.

Grumpy_Mike: Looking at the circuit I think your resistor values are all out, R115 and R122 are down as 0R and R117 and R133 are down as 10M. These values are way out for correct operation. I am willing to bet your noise is coming from the op amp not the arduino. The only filtering you have on the other amp is a feedback cap of 27pF. Why are you doing that, this is way too low to be actually effective in any sort of signal you are going to get from a pressure sensor. It is probably just stabilising the op amp because of the too high value of the 10M. I would make the 10M resistors 220K and the 0R resistors 10K. I would also put a 27pF cap across R116 to stabilise it. Then I think you will find your op amp will stop oscillating.

The overall layout was made so that we could swap out parts if needed, the 10 Mohm was supposed to act as an open and 0 ohm as a close and give us the capability to change if needed (such as turning the voltage buffer into some sort of filter/gain) to give us more options since this was printed on a PCB.

Krodal: Thats what I think. Your OpAmp circuit is a noise generator and pickup for noise with that very high impedance of 10M.

Why do you use the OpAmps at all? The pressure sensor output can be connected to an analog input of the ATmega2560. I would recommend a small resistor and capacitor for safety. You already have 680pF at the sensor output. Perhaps a resistor of 1k to the analog input of the ATmega2560, and an other 1nF to ground at the analog input.

The purpose of adding a voltage buffer between the analog input and pressure sensor was to again, give us flexibility in our design after the PCB had been printed.

We ended up fixing it by removing a 0.1 uF decoupling capacitor (not shown on the schematic) that was attached between the output of the buffer and analog input to the arduino. We had put those there because the traces we used we figured were long and susceptible to noise from the power supply. I suppose the op-amps used didn't like these capacitive loads.

Thank you for your help/suggestions.

(not shown on the schematic

I didn't stand much of a chance of spotting that error then did I?

Grumpy_Mike:

(not shown on the schematic

I didn't stand much of a chance of spotting that error then did I?

It was added when the PCB's layout was designed, not in the schematic, so I hadn't even noticed it either