I'm using ADC on my STM32F407 to read the signals coming from a piezoelectric sensor. I have written my code in such a way that if input crosses a certain threshold, it starts sampling and storing it in a buffer for 10ms. It seems to work fine when I directly connect a piezoelectric sensor to GND and ADC input pin of the microcontroller. But when I bring in a probe of an oscilloscope in order to check the input for ADC(the input goes to both the oscilloscope as well as to the microcontroller), the reading on the microcontroller does not cross the threshold.But the signal on the oscilloscope shows that this threshold is easily crossed. What's the reason for this?
Edit - I switched the oscilloscope coupling from DC to AC and it works.