EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: tijeff on August 19, 2024, 06:46:15 pm
-
I need to sample and record 6 signals simultaneously without lossing samples 24/7 for months. Im fine with the electric part.
I need about 4000samples per sec per chanel, or bether and 10 bit effective precision. The sampling part can ne done many ways, but send data, or record data without stopping sampling is often an issue. Csv or wav files format is fine Cutting in date named files every ~10min
First ive tried a rasbbery pi with python and 3 cheap usb stereos sound cards. Signals weres delayed between different usb devices.
2 Iv upgrade to a 8inputs professional usb recording device, signals weres in phases, but precisions of signal was often varying 5% or more between signals. Seems normal in the audio word
3 I'm curently fidling around with arduino and mcp3008. But i'm always having issue to send data without stopping sampling. Not to say that uart is pretty speed limitated
Im open to any sugestions !
-
First ive tried a rasbbery pi with python and 3 cheap usb stereos sound cards. Signals weres delayed between different usb devices.
Were the delays constant? Seems like you could synchronize the streams by simultaneously sending a "start" signal on all of the channels.
Might be worth trying it on a laptop/desktop with multiple USB interfaces.
Re using an "Arduino"... this kind of streaming is trivial with an MCU that has DMA. I'm sure you could write the whole thing in Micro Python on a Raspberry Pi Pico.
-
That is some 100MiB per channel for half a year.
I would go with some linux computer, just because of the file system and network what "just works". No messin' with FatFS or memory IC limitations that limit storage, or are dificult to access from more then one process. A linux system that creates a file for each 10 minutes or sampling or so is easy to handle on such a system.
For the actual sampling. Separate USB sound cards sounds awful (no pun intended :) ) You will have drift in between the different cards, and it may even drop a few samples here and there. Maybe you can do it with a single sound card if you modify the input filter and add an analog multiplexer. But things like amplitude stability or DC accuracy are not a priority for audio.
6 channels * 4ksps *10 bit = 240kbit/s and that is indeed a bit much for an Uart which also has extra overhead, but it is doable, many uarts can be pumped up to 900kbps or thereabouts. Those small Linux SBC's also have SPI channels and those have plenty bandwidth.
For the sampling itself, something like an ADS1256 is probably more then you need. 8 input mux, 24 bit and 30ksps (at reduced resolution) sampling and with an SPI interface. If you need synchronous sampling, then multiple ADC's and reading them cyclically is a better option. An I2C bus may be just enough, most of those have multiple I2C buses. Sustained sampling may be a problem. It's quite possible an SBC is "busy" for a bunch of milli seconds every now and then, for example for managing file buffers, video interrupts or "whatever". In that is a problem, then using a microcontroller frontend with a bunch of ADC's is easier to program than attempting an RTOS on a Linux system. And then use the SBC only for bulk data transfer and storage.
And some uC's come with built in Ethernet. A bunch of STM32 have Ethernet, the Teensy 4.1 has Ethernet (and plenty of processing speed).
-
you can do this with a Pico scope 4824A and the SDK for this scope.
you will have 8 channels and up to 10MSamples/second in 12 bit resolution.
So 4kSamplels/second is about crawling for this device.
Benno
-
The sampling part can ne done many ways, but send data, or record data without stopping sampling is often an issue. Csv or wav files format is fine Cutting in date named files every ~10min
Our of curiousity... what did you use for this? The command line utility "arecord" will supposedly do the record/saving to
multiple timestamped files for you -- have you tried that?