Having trouble saving continuous sensor data on SD card using Openlog.

Hello!

I was wondering if I could get some help with an issue Im having.

I have a bunch of sensors (RTC, BME280, CCS811, SHTC3, ZioQwiic, AS7265X) that I am collecting data from and I am collecting them to print out in CSV format. I have done this and monitored the output through the serial monitor and it came out like this;

‘’

Date , Time , Humidity , Pressure , Altitude , Temperature , CO2 , TVOC , Humidity , Temperature , Soil Moisture , A , B , C , D , E , F , G , H , R , I , S , J , T , U , V , W , K , L

10/31/2021 , 10:33:48PM , 23 , 95550 , 492.2 , 25.84 , 400 , 0 , 32.29 , 23.38 , 1023 , 89.72 , 380.28 , 139.05 , 370.83 , 121.30 , 601.43 , 368.31 , 417.12 , 2086.99 , 118.34 , 136.83 , 84.38 , 45.90 , 34.69 , 74.43 , 37.51 , 23.59 , 18.79

10/31/2021 , 10:33:50PM , 22 , 99682 , 137.7 , 25.83 , 400 , 0 , 32.27 , 23.38 , 1021 , 89.72 , 380.28 , 139.05 , 370.83 , 121.30 , 602.17 , 368.31 , 417.12 , 2086.99 , 118.34 , 136.83 , 84.38 , 45.90 , 34.69 , 74.43 , 37.51 , 23.59 , 18.79

‘’

This was easy enough to do and I have attached the code I used for this, “SensorTestSerialMonitor”. However, when I try to save the data on an SD card using the Openlog, I run into a few problems. First, none of the sensor data seem to print, I get no value. Second, I can’t seem to able to print the updated data. I attached my attempt to the post, “LoggingData”.

Any help would be very useful,

Thanks!

LoggingData.txt (5.97 KB)

SensorTestSerialMonitor(1).txt (6.49 KB)

Not enough information to even guess.

Which Arduino are you using?

How have you wired it to OpenLog? Post a wiring diagram.

What do you expect to be printed?

What do you mean by “I can’t seem to able to print the updated data”? What are “updated data” and how did you try to print them?

Sorry about that! I’m using a RedBoard qwicc and I have the Openlog and sensors all connected on the qwiic connection. I’m trying to print the csv text (I put a sample in the post). As you can see it prints data every 2 seconds. This works perfectly when I’m justing priniting on the Serial Monitor, but it doesn’t work at all when I try to save the data on the Openlog. I attached the Serial Monitor code (that works) and the Openlog code (that didn’t work) to the post.

Start with the OpenLog examples and make sure that those work, and that you understand what they are doing.

Then build your application.

That’s exactly what I’ve done. I know how to print a basic text message onto the file in void setup but when I try to print the sensor data in void loop it does not work.

when I try to print the sensor data in void loop it does not work.

How do you know? You have not provided any useful information about the problem. “Does not work” just tells us that you are unhappy with the result.

Explain what you expected to happen, and what happened instead.

Describe what steps you have taken to troubleshoot the problem, and what you discovered.

I looked at the code, but it is a mess. Start with one of the working logging examples, and modify it to log data from just one of your sensors. A good test is to collect and record some data, remove the card from the Arduino, read the file on a PC, and verify that you recover correct data in the expected format.

First thing that jumps out to me is that your Setup() routine doesn’t initialize any of the sensors.

/mike