Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sampling
#1
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
Reply
#2
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
Reply
#3
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.
Reply
#4
33 khz sampling is going to be a challenge with C. No way with Python.
Reply
#5
to get a feel, see: https://forums.raspberrypi.com/viewtopic.php?t=128387
Reply
#6
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.
Reply
#7
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...
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply
#8
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  time setup for realtime plotting of serial datas at high sampling rate alice93 6 3,762 Jan-07-2022, 05:41 PM
Last Post: deanhystad
  How to control frequency sampling rate my dial_tone through AJAX to flask server? Hadad 4 3,251 Jul-26-2019, 05:00 PM
Last Post: Hadad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020