Need help with arduino datalogger.

Hello

I am making a project where I am logging data on a SD card using the vma304 datalogger. To test the datalogger I have made this script.

#include <SD.h>
#include <SPI.h>
#include "SdFat.h"

const int CS = 10;
int i = 0;

void setup()
{
Serial.begin(9600);

pinMode(CS, OUTPUT);

if (!SD.begin(CS)) {
Serial.println("No SD Card present");
return;
}
Serial.println("SD Card Ready");
}

void loop() {
File dataFile = SD.open("test.txt", FILE_WRITE);

if (dataFile) {
dataFile.println("Test");
dataFile.close();
}
else {
Serial.println("error opening the file");
}

delay(500);
}

and my connections are:

CS - 10
MOSI - 11
MISO - 12
SCK - 13

My problem is that the program always returns a "No SD card present". I have checked that all the connections are valid, that the libraries are up to date, and bought a new datalogger in case the old one was broken. Does anybody know if there is something wrong with my script or if I am making some kind of other mistake?

Thanks

PS. I am kind of new to arduino so don't judge me too hard for some newbie mistake.

We need to find someone who has successfully used the vma304 to help you. I've never used one, but looking at a picture of the device I'm really confused about the design. While it regulates the incoming 5V power down to the 3.3V needed by the SD card, the clock, MOSI and CS lines seem to remain at 5V when high. There are resistors, but they appear to be inline resistors, not voltage dividers. This may work with many cards, but I still think it's all wrong. (By the way, E3RO, you do have power and ground connected to the vma304, don't you?)

Otherwise, I don't see anything you're doing wrong.

One thing you are surely doing wrong is your use of two different SD libraries. This is likely to be as fatal as it is pointless. I have never known of a reason for using SDFat and suggest you delete the call for it and start over from scratch. SD library includes a datalogging example which is probably all you need.

There is nothing unusual about the SD module, it looks the same as one that I have and I think it is in common usage.