25
votes
Accepted
Why is our refresh rate consistently decreasing in logging on SD card?
I don't have certain answer for you, but a deep suspicion. If I get bored I'll confirm it. Confirmed below.
In each pass of loop(), you have:
dataFile = SD.open("log1.csv", FILE_WRITE);
...
6
votes
What is the chip in this board?
but what is C3? Looks like it is between the output and GND.
C3 is likely a 10 uF cap for the 3v3 output of the regulator.
(Source: datasheet for Sunrom SD module (PDF))
The circuit design used in ...
4
votes
Arduino SD Card open file modes append / overwrite
You only need to open the file with FILE_WRITE and use file.seek(EOF) to go to de end of the file. After that you can write whatever you want that will be appended to the end of the file.
File ...
4
votes
Arduino SD Card open file modes append / overwrite
The Arduino SD library is an Arduino wrapper of old version of SdFat library (put into utility subfolder of the SD library). This SdFat library has constants like O_READ, O_WRITE, O_APPEND.
Arduino ...
4
votes
Proper Micro SD card schematic
As per the SD card specification:
When an SD card is operating in SPI mode or 1-bit SD mode, the CMD and DATA (DAT0 - DAT3) lines of the SD bus must be pulled up by 10 kOhm resistors. Slaves should ...
3
votes
Accepted
Arduino UNO And SD Card Custom csPin
Pin 10 is special. It's the hardware chip select pin for SPI. It is integral to the SPI peripheral in the chip.
That pin must be an OUTPUT for SPI to operate as master, or INPUT for it to operate as ...
3
votes
Accepted
Arduino SD Card open file modes append / overwrite
If you look in this library, you see:
File SDClass::open(const char *filepath, uint8_t mode) {
...
if ((mode & (O_APPEND | O_WRITE)) == (O_APPEND | O_WRITE)) {
So you can use all these ...
3
votes
Best buffering practice for continuous SD card writing
Is this a sensible solution to the problem?
No, unfortunately not. The size of the buffer is limited by the available RAM on your chip. Jumping between multiple buffers or cores will not change that, ...
3
votes
Accepted
How to difference hardware reset and software reset?
You can't. There is no "software" reset. When you upload new code a hardware reset is triggered by the DTR pin of the USB interface chip.
Instead I would suggest maintaining a "data ...
3
votes
Accepted
Random access to SD card using SD.h or another library (ESP32)
Solved!
The solution was to migrate from the SD library to mySD, which seems to be a SdFat wrapper for ESP32.
You can see in the file mySD.h that the FILE_WRITE mode is defined as:
#define FILE_WRITE (...
2
votes
Fast data logging
Read the values into an array big enough to store them
Write the array with the write(const uint8_t *buffer, size_t size) method.
Each write then gives you a block of binary data (512 values, 1024 ...
2
votes
DFPlayer for Writing to SD Card
Unfortunately the DFPlayer cant write that data to the SD card. The Arduino has some non volatile memory of its own built in though. Theres 1K of EEPROM for the UNO. Notes on how to use it here: https:...
2
votes
Accepted
How does one **get** attributes for SD files?
In the FAT filesystem the timestamps and other attributes are stored in the directory, not in the file. So you need to read the "file" that is the directory that contains the file you're interested ...
2
votes
How does one **get** attributes for SD files?
You need to get an SdFile object for your file then use the SdFile::dirEntry method to get the directory entry for the file.
The directory entry (struct directoryEntry) has the timestamps.
2
votes
Accepted
Can I read from a memory card with three pins?
Not with an ATTiny85, and not with so few pins, no.
However, all is not lost.
The ATTint85 has 512 bytes of EEPROM inside it where you can store your login details. All you need is some way of ...
2
votes
Datalogger with interruputs
The millis() function is based on a counter which is incremented by
the Timer 0 overflow interrupt. Since you reconfigured
that timer to never overflow, that counter is not incremented anymore.
If ...
2
votes
Best buffering practice for continuous SD card writing
Buffers will help you if at some point the input stream stops, so the "slower" device (e.g. the SD card) can catchup. If the data will always be received faster than it can be written (note ...
2
votes
Proper Micro SD card schematic
There's an excellent tutorial on Instructables I recommend one to read.
here's the link
https://www.instructables.com/Select-SD-Interface-for-ESP32/
2
votes
Accepted
sizeof tm struct (datetime) different on ESP32 vs linux64x
You can not trust system-level structs for data storage or transfer between different systems. The main reasons are:
Different data type sizes (16 / 32 / 64 bit ints, floats vs doubles, etc)
Struct ...
1
vote
SD seems too slow for SMTP
Try a simpler approach (with some code refactoring)
bool TrySend(){
if(client.connect(ServerChar, 25)){
theFile = SD.open("Smtp.txt");
if(theFile){
while(theFile....
1
vote
STM32 and SDFat - Can't create file in directory in SD
I found the issue. I'm not creating the directory folder properly. When I checked the SD card from another device, the DATA folder was invalid, and creating it manually works. I'll look for a solution ...
1
vote
Accepted
SD Library function doesnt work while using second SPI port with ESP32
Ok i found the solution. It was not too complicated. I just assumed the problem was in the code. This works well enough (dont ask me about the counter--)
unsigned short EKG_recording::...
1
vote
Can I read from a memory card with three pins?
SD cards work with SPI. This needs only one pin per device (SlaveSelect) but 3 pins for the other common signals ( MISO / MOSI / SCK )
Card reader modules simply do some voltage level shifting (if at ...
1
vote
SD card reader and lcd display
This is talked about in multiple Arduino threads. This thread, this thread & this thread are just 3 found.
It appears reading and SDCard using an Arduino results in a text like character string. ...
1
vote
Arduino SD Card open file modes append / overwrite
File outputFile = SD.open(LOG_FILE, MODE);
With Arduino PCB: MODE=FILE_WRITE to append the data.
With ESP32 pcb, V 3.1.1: FILE_WRITE to overwrite the data. FILE_APPEND to append data.
Append:
File ...
1
vote
Use 5V SD-Adapter on 3.3V System
You can use the adapter because:
the adapter uses an AMS1117 to generate 3.3V to supply the SD card and the level shifter
the level shifter is a 74LVC125 which uses 3.3V and works with 3.3V (and ...
1
vote
Use 5V SD-Adapter on 3.3V System
Catalex Micro SD Card Adapter has built-in level converter in a form of 74LVC125A 3-state buffer. This buffer chip needs 1.65 to 3.6V voltage supply. The +5V from your Arduino is lowered to 3.3V by ...
1
vote
Use 5V SD-Adapter on 3.3V System
The SD card is a 3.3 V device. The 5 V module with SD card adapter steps down the voltage for powering the card and has logic level conversion for card's SPI pins.
If you want to connect SD card to a ...
1
vote
Accepted
PMS5003 Serial Output Data to SD Issues
There is a mismatch in the code.
The Arduino loop function assumes that readPMSdata needs to be called just once for valid data but the function readPMSdata itself assumes that it will be called over ...
1
vote
Accepted
Where are the implementations of the SdFat BlockDriver methods?
The typedef in BlockDriver.h is only for pointer type, not for instance of the object. The object is always of type SdSpiCard, but in one case it is not an implementation of BlockDriverBase, so the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sd × 64sd-card × 22
arduino-uno × 14
spi × 8
esp32 × 7
esp8266 × 5
sd.h × 5
arduino-mega × 3
library × 3
datalogging × 3
serial × 2
arduino-nano × 2
c++ × 2
analogread × 2
rfid × 2
time × 2
audio × 2
frequency × 2
stm32 × 2
arduino-zero × 2
arduino-ide × 1
power × 1
lcd × 1
softwareserial × 1
communication × 1