I'm setting up a scientific project where I want to read a bunch of sensors simultaneously, and continuously, probably about 15 analog signals, give or take, 10-12 bits each, at about 400Hz. Then I want to store that data for offline analysis, either by putting it on an SD card (without interrupting the sensing!) or by sending it across wifi (maybe in batches of samples?).
My question is basically: is Arduino the right solution for that? Or can you recommend other starting points?
Thanks for reading this and I appreciate any input you are willing to share!
That is not going to happen, you can only make one measurement at a time. This is a restriction no matter what platform you use. In the case of the Arduino they only have one A/D converter with a multiplexer on the front end so only ever one measurement at a time.
What type of sensors and do you really mean simultaneously ? If so, then it is unlikely that an Arduino is the right tool for the job as, except for a limited set of circumstances it can only read one sensor at a time
Hi Grumpy_Mike and UKHeliBob, awesome that you replied so quickly.
I can see now I wasn't being clear; when I said "reading simultaneously" I really meant quasi-simultaneously. That is, within each reading cycle at 400 Hz, i.e. within 2.5ms, read each of the 15 or so sensors. As long as they are all read within the same 2.5ms window, that's precise enough for me.
Does that help to clarify?
Curious to hear your thoughts about feasibility. Thanks!
That depends all on the answer times of sensors.
Right, good point. I think it varies by sensor but I'm ok to make the assumption that the sensor answer time is negligeable, so it's really a matter of reading an analog signal on the part of the Arduino.
Silly idea, when you can simply read the sensor specs and determine the data acquisition time.
Take an Arduino and start with coding to gain the knowledge.
Hi jremington, that's a helpful idea to check the sensor specs. It's not always clear for me though how to find that information. For example, one sensor that I want to read is AD8232 (ECG), and in their manual (https://www.analog.com/media/en/technical-documentation/data-sheets/ad8232.pdf) I'm not sure where latency information is to be found.
Sorry to be thick, but is there such a thing as an "answer time" on an analogue sensor connected to an analogue input port?
Hi paulpaulson, actually I have coding experience in Arduino and Teensy as well. I've built various projects. My concern is just whether conceptually this idea is feasible or not. I think I can figure out the details. I've never sent data across a wireless connection though or SD. So I'm not sure how long that would take, if that's feasible within a single sampling cycle (2.5ms). Similarly, I'm not sure whether you can meaningfully have 15 analogue reads in such a short time as well. Does anybody have info about that? Thanks
Look for the ODR (output data rate) or frequency response.
The link you posted is to an instrumentation amplifier, not a sensor, which has a high frequency response limit of about 1 kHz. So at best, you can collect one data point per millisecond, which allows you to monitor signals with a maximum frequency of 500 Hz. From a single channel, of course.
Design a prototype with all your funtional and none-functional requierements.
I would have thought this more suitable for a higher end logging system running on a PC - you are producing a lot of data in a short time at high resolutions which will require lots of memory and good software design , plus some hardware knowledge to deal with the AC voltages .
Do you really need to measure so much ? What is the project ??
Hi Hammy, thanks so much for this thoughtful response. That's exactly the kind of insights that are helpful for me. So the project is to measure physiological signals (ECG, respiration, skin conductance, etc.) of multiple people at the same time as they interact in various ways. So they need to wear a small box which will contain the micro-controller and a battery and that connects with all the sensors, but that otherwise is wireless. Since we measure data from each person, we can't really have one PC per person, at least not within my budget. That's why I am thinking about Arduino. Curious what you think about all this. Thanks again!
Yes it is the time it takes to read the A/D. I know the sensor is already outputting the value but until you read it you don’t know what that is.
A normal ATmega based Arduino samples at just under 10K samples per second, but then you have to do something with the results. Wi -Fi is out because it is either not real time or he message can get lost and never arrive depending on what format you use to send the message.
SD card might be fast enough but I am not sure.
Hmmmm … this gets harder as you need to synchronise the data too , so you’ll be needing a clock ; 15 sensors per person is still a lot . It’s better to know what you want to measure than get a load of signals and try and make some sense out of them ( “let’s measure everything really fast and get a massive spreadsheet to sort it “) . If you had say 4 signals per person and a logger on each of them everything would be easier, and why 400Hz and not say 10 hz and have a separate circuit outputting heart rate - even easier .
BTW You’d only need one PC and a some trailing cables - I’d check out what’s available ready built , to see what you are up against , not a five minute project .
Thanks @Grumpy_Mike, that's helpful. So it sounds like with 10k samples per second, I might just barely get my 15 signals in. Then like you say I'd also need to do something with them, i.e. save them somehow. For wifi, realtime is not an issue, since the data can be timestamped by Arduino and then sent for offline analysis. However, like you say it's important of course that no samples are missing. I see commercial solutions use wifi so that's why I wondered whether that might be feasible.
In terms of SD card, I get the impression its access/write times are variable, like reported here:
Is there another more reliable way to save the data?
Thanks @hammy, that's a good point there. Not just measure anything and then see later what I'm gonna use. The issue here is that as I'm developing this, I would like this device to be usable across different studies - especially if I'm going through the trouble of building a whole set of them for measuring a group of people. So that's why I am being fairly inclusive when it comes to sensors.
Also good point for the synchronization of the multiple devices. Other folks who used similar setups have used a radio signal for that, e.g. Frontiers | Increase in Synchronization of Autonomic Rhythms between Individuals When Listening to Music | Physiology Unfortunately they no longer have the technical details of their setup and could not share hardware/software design.
Yes, but there is no provision to synchronize the individual Arduino devices. You need to look at how local area nets operate. They send time messages to each device when traffic allows.