Writing Sensor data into a text file from Arduino to PC

Hi People!

Hope you guys are doing great!

Well I am writing an Arduino sketch to read 4 sensors over I2C communication bus. What I want to do is to read for example my Temperature values and write them simultaneously in a (.txt) file on the PC....

Though I am not new to Arduino IDE but am still learning to program using the wire library... Can we achieve the task defined above using 'wire' library???

Or should I be using some other language to do this?

Please help me get started with this part of my program... Any pointers / Links / sample sketches / suggestions!!! :) :)

I deeply appreciate your support!! :) :)

Cheers

Pramit

The wire library will allow you to use the I2C bus to read your sensors. You can then organize the data into packets and send the data to the PC via serial prints. I would write an application in Processing to send the data to a file, but you can also write the data to a terminal program that can save the data to a file. I can't recommend a terminal program, though, as I don't use any.

and write them simultaneously in a (.txt) file on the PC....

Not even remotely possible. The Arduino can NOT open a file on another computer. It can't write to the file.

The ONLY thing it can do is write to the serial port. You CAN write an application that runs on the PC, listens to the serial port, and writes to the file.

There are plenty of examples on the Playground, using a vast variety of languages, that show how to create such applications on the PC.

Well thank you so much for your quick and clear replies!! :) :)

Paul, is there a specific name to such applications so that it a bit a easy to search?

Prost!

Pramit

Hasn't anyone ever heard of a serial terminal?

Just go get PuTTY or CoolTerm and have it read the COM port the Arduino is attached to. All you have to do to log is tell it to log to a file. Both are pretty easy to use and it beats having to spend months learning a new language just to log a serial port with text data ......

longjohn119: Hasn't anyone ever heard of a serial terminal?

Just go get PuTTY or CoolTerm and have it read the COM port the Arduino is attached to. All you have to do to log is tell it to log to a file. Both are pretty easy to use and it beats having to spend months learning a new language just to log a serial port with text data ......

If all you want to do is log the data that is fine.

I suspect there are more ambitious plans for that data from the OP.

There is also an Excel macro called PLX DAQ that gets data from Arduino via serial and puts the data into an Excel spreadsheet.

PLX DAQ

There is also an Excel macro called PLX DAQ that gets data from Arduino via serial and puts the data into an Excel spreadsheet.

For some (older) versions of Excel.

Here's a pretty good option. http://www.aggsoft.com/serial-data-logger.htm But this is not free. They has the Home version for hobby projects.

You could easily modify the Python code in this Python demo so that it writes data to a file on the PC

...R

Thank you so much people!!

For the wonderful support!! :)

I will get going with implementing it now... maybe I need some support when I am half way through!! :)

Regards

Pramit