Python Forum

Full Version: Sampling
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Is there any possibility how to read samples - one sample every 30microseconds?
Is it real in python?
I need read samples via GIPO pins, in totoal 30k samples.
One array will be time in microseconds [0,30,60,.....]
Second data [20.2233443,21.3454567,19.3456543,.....]
Is it possible on Raspberry with Python?

Thank you
frohr Wrote:Is it possible on Raspberry with Python?
it's done all the time. One sample every 30 ms is not fast and easy.
Of course a sample from GPIO is binary.
If you need to read intensity or other analog signal, you will need to used Analog to Digital conversion
example, see: https://learn.adafruit.com/raspberry-pi-...converters

There are quite a few tutorials on using python to read GPIO in the pi.
Use google, it's your friend here.
Here's one example: https://projects.raspberrypi.org/en/proj...omputing/1
I use ADS1256 connected to the GPIO pins. But now I am pretty sure, there is no possibility to read 30kSPS on Raspberry with Python.
Anyway, thank you for links.
33 khz sampling is going to be a challenge with C. No way with Python.
OK, thank you for info.
I will use Teensy 4.0 with ADS1256 because there I can sample 30kHz and then send array to Raspberry via USB for FFT.
In this case I will have more hardware and more power consumption but is works fine.
Those Teeny boards are pretty cool. I was going to chime in with the dual problems of sampling speed and non-determinism with the RPi but the Teeny looks like a good solution for both. Let us know how it works out...
FYI: you can add up to 16 MB additional memory if needed (teensy 4.1) for $3.40
see: https://www.pjrc.com/store/psram.html