Page 1 of 1

ADC in python, change sampling time

Posted: Mon Oct 08, 2018 8:02 pm
by ksaksasy
I am new to python and also to raspberry pi, I have connected the High-Precision AD/DA Board to the RPI 3 model B, and I am looking to change the sampling time of the ADC and I am not sure if I need to change the RPI reading time as well, I have found some code such as

Code: Select all

  byte drate_reg = 3; // Choosing Data Rate register = third register.
  byte drate_data = 0b11000000; // 11000000 = 3,750SPS
  SPI.transfer(0x50 | drate_reg);
  SPI.transfer(0x00);   // 2nd command byte, write one register only
  SPI.transfer(drate_data);   // write the databyte to the register
However when I run the sudo ./ads1256_test to verify if it is properly reading, I am getting this random voltages that are not changing even though I have run with no error the line byte drate_data = 0b11000000; // 11000000 = 3,750SPS. The reading I am getting are: Image

Re: ADC in python, change sampling time

Posted: Wed Oct 10, 2018 11:30 pm
by sora03
I have no experience with that ADC, Try to add a filtering capacitor, a 0.1uF ceramic to the input channel of the ADC to smooth out the ripples.

Re: ADC in python, change sampling time

Posted: Thu Oct 11, 2018 5:54 pm
by mikronauts
you will get a lot of variance if you leave the input floating

Tie unused inputs to ground.