Electronics > Beginners
help with rapid ADC data aquizition
powerfly:
I am trying to obtain ADC voltage readings at a rate of 10kHz with a resolution of 12 bits or more. This is to be done with a portable, small device, such as a microcontroller with a small power bank attached to it. I would like to be able to use this with 7 data channels, and if possible even up to 24 channels. I have been looking at microcontrollers to do the job, but I'm stuggling to find a suitable one (or maybe I just need guidance on how to use them properly).
7 channels of 12 bit data is 7*1.5 bytes = 10.5 bytes.
10kHz --> 105kb/s of data storage.
Ideally, at least 20s of data could be stored at this rate before a short interval and then repeat.
1. Are there any microcontrollers that would be able to write at these sorts of speeds straight to an SD card or memory stick? - Someone I know tried doing this with an Arduino uno and the data logging was far too slow. would a teensy 3.6 work as it has a native micro sd card slot?
2. If this does not work, is it possible to store data at this rate to flash memory on a micro controller? apparently it is possible with arduinos, although they do not have enough flash memory. A teensy 4.0 might just be able to do the job, although I am not sure how to write at this rate to the flash memory of a teensy, it has a different architechture to most arduinos which I think makes things more tricky. Are there any other micro controllers I should be looking at?
3. Is a microcontroller the best option? I have thought about possibly using a rasberry pi, although I have no experience with theese and basically no coding experience, which might mean it is tricky. The 4 Gb of ram is appealing though and if the right sampling rates are attainable this could be a great solution. Due to the size and probably more tricky coding this option seems less appealing than a micro controller atm.
Bear in mind I have very limited experience with coding, any help would be much appreciated!
Wimberleytech:
Silicon Labs sells 8-bit micros with 12-bit ADCs on them. The C8051F020 supports a sample rate up to 100ksps. In addition, it has an on-board 8 input mux.
JimRemington:
--- Quote ---would a teensy 3.6 work
--- End quote ---
Yes, but there are only two independent ADCs. A Teensy 3.2 will work too.
jhpadjustable:
1. Just about any 32-bit MCU with an onboard ADC could do it. For perspective, an STM32F103 (bluepill, etc.) has a 1Msps ADC with 8 or more inputs depending on package. If zero skew and zero error isn't a requirement, you can sample as many channels as you like and pass them along to your storage device, maybe do a bit of oversampling on the way. You can even use DMA and timers to handle all the grunt work for you. Teensy 3.x would probably be enough power for the job.
2. SD cards are pretty easy. They can be used in an SPI-like mode, in case your chosen MCU doesn't have a proper SDIO peripheral or you don't want to use it for some reason. Beware that flash lifetime is rated by the number of writes. After you exceed the limit, you may find data isn't being written correctly. Maybe that's not a big problem if you have 8GB of SD card that does its own write leveling. Speed might still be a concern. You would need to qualify your particular choice of SD card. If you really don't need non-volatile storage, you could use a pseudo-SRAM with a serial interface, for example.
3. SD cards are pretty simple. USB host is hard. The trouble with the Pi is that the multitasking OS gets in the way, and it's also a bit anemic as to peripherals.
powerfly:
--- Quote from: JimRemington on December 06, 2019, 07:19:17 pm ---
--- Quote ---would a teensy 3.6 work
--- End quote ---
Yes, but there are only two independent ADCs. A Teensy 3.2 will work too.
--- End quote ---
Are you saying that a teensy 3.6 would fully be able to do the job, or that it has ADCs?
I think the ADCs on the teensy each have several channels so it could be used for more than 2 channels couldn't it?
--- Quote from: jhpadjustable on December 06, 2019, 08:37:20 pm ---1. Just about any 32-bit MCU with an onboard ADC could do it. For perspective, an STM32F103 (bluepill, etc.) has a 1Msps ADC with 8 or more inputs depending on package. If zero skew and zero error isn't a requirement, you can sample as many channels as you like and pass them along to your storage device, maybe do a bit of oversampling on the way. You can even use DMA and timers to handle all the grunt work for you. Teensy 3.x would probably be enough power for the job.
2. SD cards are pretty easy. They can be used in an SPI-like mode, in case your chosen MCU doesn't have a proper SDIO peripheral or you don't want to use it for some reason. Beware that flash lifetime is rated by the number of writes. After you exceed the limit, you may find data isn't being written correctly. Maybe that's not a big problem if you have 8GB of SD card that does its own write leveling. Speed might still be a concern. You would need to qualify your particular choice of SD card. If you really don't need non-volatile storage, you could use a pseudo-SRAM with a serial interface, for example.
3. SD cards are pretty simple. USB host is hard. The trouble with the Pi is that the multitasking OS gets in the way, and it's also a bit anemic as to peripherals.
--- End quote ---
Thank you for your in depth response, I think it is helping me figure things out :)
At the moment I'm going for a teensy 3.6 or 4.0, it sounds from your comment that you are reccomending a micro-controller over a rasberry Pi.
I'm not quite understanding what you are saying about micro-SD cards. I am happy to spend a bit of money on a decent micro-SD card if it will store the data at the rate I need, for this a teensy 3.6 might be ideal as it has a native micro-SD port. Are there any micro-SD cards that could be used in conjunction with a teensy (or other microcontroller) and get the desired data rate? If so, what kind of Micro SD card?
As for the volatile RAM thing - Is it simple to add on this 64mb of ram to a teensy, temporarily store data there and subsequently dump the memory to a card when a chunk of data has been collected? If so, it does not matter that it is volatile.
Navigation
[0] Message Index
[#] Next page
Go to full version