Hello,
this post is about both hardware and the related software (is this "hardware" section appropriate ?)
I am at the stage of determining the necessary hardware and software, that would allow a uninterrupted low power (24h or 48h portable) 12 to 18bits data logging at 200 Hz to a SD card.
The goal is to provide me with a home-made portable ecg recording system.
Looking at various sources of info with search key words such as ‘fast portable sd card data logging arduino’
It appears that the SdFat with its 512 byte buffer might be a possible solution.
I want to interface concurrently an ecg chip such as the Max30003 (spi interface), an sd card logger (spi interface), and a real-time clock (I2c interface) ; and possibly upon temporary user choice activate a 240X320 display (spi interface), to pick a view of the incoming data, without interrupting the SD card logging ;
I want a 3 volts system (and not a 5 volts one), in order to use either a lithium battery or LiFePo4 battery with a appropriate buck regulator delivering 3V to the whole system.
QUESTIONS
1 : Would an esp32 (or an arduino nano?) do the job (esp32 with wifi/bluetooth inactivated to save power) ? What would be good arduino-IDE compatible alternate choices ?
2 : is the requirement ‘without interrupting the SD card logging ‘ realistic if the display is activated ?
3 : Is the sdfat library an appropriate choice ?
4 : what about the power budget ?
4.1 : I understand from older posts (circa 2015) that the the power consumption of various flavors of SD card varies wildly ; and that I should stay away if possible from « (circa 2015) high capacity » SD card ; However looking for example at AliExpress, the lowest sd card capacity I could find is already 8Gb : what is the current situation of various power consumption with 8 Gb sd cards ? ; should I beware of the class of the SD card ?
Is there an identified current winner in term of popular SD brand/model reference) ?
4.2 : I have seen some posts where the power to the SD card is lowered (e.g. via a P-Mosfet in series with the power supply to the SD card : taking into account the requirements of data acquisition load), is it worth considering such additional hardware ?
4.3 : For the temporary display (320X240 ILI9341 that I have) , I am of course considering such power control (via a P_mosfet) for inactivationg the display consumption when the display is not used : but is the arduino library (ILI9341_t3) compatible with such supply power manipulation, for putting to sleep/awakening without problem ?
5 : is it worth and appropriate to consider adding a memory chip (spi interface) to increase the buffer size for dumping the data in larger chunks onto the SD card ?
6 : how to avoid ecg data loss when the real-time clock will be accessed (say every nearly full buffer, and complementing the data in the buffer with the date/time before dumping it to the SD card ?
7 : should I look into a real-time OS ? For the present project as described, Is it worh the pain and the steep learning curve ?
7.1: in such case (RT-OS), are there worked-out solution for the « fast » SD card data logging (speed compatible with the requirements of the present project?
Thanks,