Newbie: How to log serial data with UNO

Hi! I'm super new to this, but I am looking for a way to store data from a capacitive moisture senor. My knowledge is SUPER basic so far, so ideally I'd like to keep things as simple as possible.

So far, I've successfully followed this tutorial:

And I plan on adding an LCD (when I get the parts) as seen in this tutorial:

In the end, we need the sensor to log data in time intervals, and store in .txt format for later analysis.

Assume I don't know what anything does outside of my little setup... This is my first project with any sort of electronics.

Thanks in advance!

You could sent the data over a serial link to the PC running a terminal program like Putty or Realterm. Those (free) terminal programs can log incoming data to a file on the PC.

Or use an SD card module and save the data to SD.

Add a Real Time Clock to be able to add precise timestamps if using the SD option.

1 Like

I would suggest logging the data in CSV (comma separated values) format. Then it can be easily imported into a spreed sheet or data base.

1 Like

Thank you for the help! Looks like I'm going with the SD/RTC setup, then I'll be able to convert the .txt file to csv for analysis.

If you send the data to a free terminal like RealTerm, you don't need an SD and you certainly don't need an RTC. RealTerm can add a timestamp using the PC clock. The only time you need an RTC is when you really need the time and no other source is available, which is not often.
I don't think you ever need to convert txt to csv. The content stays the same.
Note also that you can send Arduino output direct to Excel for live graphs and analysis.

Thanks! I'll keep that in mind for our lab tests, but ultimately we will be running the sensors off a 9V in the field without a PC. You all have been incredibly helpful and given me a lot of great direction. I appreciate it :slight_smile:

I do hope that, by "a 9v" you do not mean a PP3 - unless, of course, you have done some serious research into battery power.

Check out openlog, the easiest way for me.

Google

Openlog

and look for an inexpensive module you don't need to program*, just power it and hang it off you serial output port and it will automatically Hoover up all the output of your Arduino onto an SD card for use later however.

Design you serial output for convenience or use editing tools on the big com;user you use to examine the log files.

Beyond configuring the openlog device*, that is, which is just a matter of putting some parameters on the SD card for it to see and adjust itself by.

But shop around, you can get them for less.

a7

No, just a single 9V battery with a clip to DC connection.

Probably a very bad idea. You need to determine how much power you need and for how long, mindful of the fact that a PP3 delivers very little and for only a short time - or virtually none at all for quite a while, hence their use in smoke alarms.

If operating from batteries, you do not use a "smoke alarm" battery (as this will operate the Arduino, SD card and and sensors for less than an hour).


You do not use the "barrel jack" on a UNO or "Vin" as that would

  1. not work if you draw more than about 200 mA
  2. waste almost half of the battery power since you are dropping 4 V to get 5 V.

You do not use a UNO or Nano as the USB interface is wasting power even if you put the processor to sleep as you need to most of the time to conserve battery power.

You use a Pro Mini and a 4.5 V battery pack of three alkaline "AA" cells.

And even then there are problems controlling power use by the sensors and SD card

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.