1

I'm trying to read AC signals using single-ended mode but for reason, the reading is off by a factor of 10. For example, if the actual signal is supposed to be from 0 to 5 V I get a reading from 0 to 0.5 V. The signal coming to the ADC is generated using a function generator. I'm using a gain of 1 and a sampling rate of 30000. Using the same setting I tried to read a DC signal and the reading is very accurate. I don't know why there's an offset with the ac signal.

M. Rostami
  • 4,235
  • 1
  • 15
  • 34
techacro
  • 11
  • 1
  • The Pi is irrelevant to the question. – joan Feb 14 '20 at 22:04
  • 1
    Sorry I'm new here. I'm using a ADS1256 connected to a raspberry pi 4 – techacro Feb 14 '20 at 22:38
  • Ah your problem is interesting. If DC OK but AC problemastic, then very likely your Rpi4B buster release 2020feb05 version python 3.7.3 program is buggy or your understanding of AC vs DC is a little bit "vague". Say are you talking about RMS value you get from Rpi? If your sig gen is generating a square signal with 50% duty cycle, then you should get 50% of corresponding DC reading value, But if it is sinusoidal or triangular, then it is different story. But you offset factor 10 problem seems another thing. – tlfong01 Feb 15 '20 at 01:29
  • Show me the Rpi python 3 listing (Sorry I only know python 3.x and no nothing else) and I can reproduce you situation (I do have a couple of sig gen in hand and on my bench top. Or, to get a hint, perhaps search this forum for my suggestions on related questions). – tlfong01 Feb 15 '20 at 01:29
  • BTW. I do have a couple of two brands of ADS1256 in hand, and I did answer a couple of ADS1256 question in this forum. ADS1256 is abut tricky to program, one troubleshooting suggest is to test your AC DC reading with MCP0008 10 bit, or MCP3208 12 bit, which is 10 times easier to config, and therefore 10 time harder to go wrong. You can search my posts of how to program them in this forum. – tlfong01 Feb 15 '20 at 01:34
  • You might like to compare my sig gen's with yours, (mine are all low freq, < 150k). See my comments in this Q&A: https://raspberrypi.stackexchange.com/questions/108358/control-pwm-duration-with-python – tlfong01 Feb 15 '20 at 01:37
  • that is not offset ... it is scaling ... example of offset is when 0-5 V signal is read as 3-8 V – jsotola Feb 15 '20 at 22:32
  • @jsotoja, Ah, yes, it is very important to point out to the OP the difference between "offset" and "scaling/gain", especially for ADS1256 which is very tricky to program. See Appendix D, and References 4, 5 of my answer to the following question: https://raspberrypi.stackexchange.com/questions/99353/separate-spi-data. – tlfong01 Feb 16 '20 at 02:44

0 Answers0