Ranjan Pal
Ranjan Pal

Reputation: 317

Set user defined sample rate for an ADC while Interfacing with Raspberry Pi

I have a current sensor connected to an ADC whose maximum sampling rate is 3300sps.

I need to save time domain data at fixed number of samples per second..

I am using Python to write the codes.

What would be the best way to ensure I get this maximum sampling rate of 3300sps?

So if someone could please explain this how I would go about, I would be very appreciative.

Thank you!

Upvotes: 0

Views: 346

Answers (1)

Adi
Adi

Reputation: 84

If you look at the datasheet of the ADS1015, the config register (pg 16) can be set the data rate (bits 7:5) at a fixed value. You can use a python library like SMBus to set the register on the i2c bus:

import smbus
bus = smbus.SMBus(1)
bus.write_byte_data(0x38,__,__)

A full sampling rate of 3300 is not possible on a linux based system like the Raspberry pi, you would probably need a RTOS based system running bare-metal c/c++. An arduino would probably be a little faster (you could get around 490S/s), if you add memory with high enough write speeds and large enough capacity.

Upvotes: 2

Related Questions