How to extract data from arduino?

Hi everyone!

I´m developing a project, which, it is a sensor that sends the data through a wireless network with xbee boards. The problem is that, I want to receive the data from the sensor in a computer and use these data for other purposes. Another problem is that, it should do it in a real time, so in this case a data logger is not useful.

I´ve always thought that you can program de arduino to record the data from a sensor in a specific file in real time and to be able to read this file with another programming language in other to interact with these data.

But I don´t know how to do it and even worse i don´t know if it´s so difficult to do it.

Thanks.

leibniz81:
I´m developing a project, which, it is a sensor that sends the data through a wireless network with xbee boards. The problem is that, I want to receive the data from the sensor in a computer and use these data for other purposes. Another problem is that, it should do it in a real time, so in this case a data logger is not useful.

Why are those problems? If you're sending sensor data over an XBee, and you want to log it real-time on the computer, then you need to connect the XBee to the computer, and use some sort of program to write the incoming serial data to a file, presumably with a time stamp.

You can log to a text file on an SD Card.

Is there some reason why you don't want to use the USB connection to transfer data to the PC. That's the simplest solution.

You will need to write a program for the PC to receive the data from the Arduino and save it to a file.

...R

Sorry but I think i didn´t explain me well. Of course, i´m going to use the usb to connect the xbee receptor to the computer but the data that you can see in serial monitor I need to record it in a file in a real time and this file is going to be read by other application at the same time.

So the quenstion is, how can i record these data in a file? I´ve never done it before in arduino.

then you need to connect the XBee to the computer, and use some sort of program to write the incoming serial data to a file, presumably with a time stamp.

Sorry for my ignorance, what is a time stamp?

leibniz81:
Sorry but I think i didn´t explain me well. Of course, i´m going to use the usb to connect the xbee receptor to the computer

I'm not familiar with XBee so I am confused where others may not be. Do you mean that some XBee device is connected directly to a PC or do you mean that the Arduino that has an XBee device is connected to the PC?

In any case, it sounds like you need to write a PC program (perhaps using Python) which receives the data and saves it into a database (SQLite or MYSql perhaps) so that it can then be accessed by other programs.

A timestamp is just a variable that records the time when the data was recorded.

...R

I'm not familiar with XBee so I am confused where others may not be. Do you mean that some XBee device is connected directly to a PC or do you mean that the Arduino that has an XBee device is connected to the PC?

The xbee transmisor is connected to arduino uno with a xbee shield in my case. You have another ways to connect the xbee to an arduino. The xbee receptor is connected to a board like xbee explorer usb, which makes an interface between the xbee and the PC.

In any case, it sounds like you need to write a PC program (perhaps using Python) which receives the data and saves it into a database (SQLite or MYSql perhaps) so that it can then be accessed by other programs.

I thought so, but I also thought that there would be another easier way to do it, such as a library to help you to record the data or something like that.

A timestamp is just a variable that records the time when the data was recorded.

Ok thank you for the explanation but I don´t understand one thing. If you record the time of each measure, in which way this can help me?

leibniz81:
If you record the time of each measure, in which way this can help me?

It just helps if you need to know when the measurement was taken or if you need to know the elapsed time beteen measurements.

Database systems like SQLite and MTSql also have a mechanism to record the time and date when a record is created - but that could be a short time after the measurement was taken.

And, of course, your project may have no use for time/date data.

...R

leibniz81:
but the data that you can see in serial monitor I need to record it in a file in a real time and this file is going to be read by other application at the same time.

So the quenstion is, how can i record these data in a file? I´ve never done it before in arduino.

Use a terminal program that supports logging to a file, such as PuTTY.

Sorry for my ignorance, what is a time stamp?

(08:04:20) Time stamps are simply a record of time
(08:04:28) for when an entry was inserted into a set
(08:04:32) of data.

leibniz81:
Of course, i´m going to use the usb to connect the xbee receptor to the computer but the data that you can see in serial monitor I need to record it in a file in a real time and this file is going to be read by other application at the same time.

So the quenstion is, how can i record these data in a file?

You can use any PC terminal programme to do this. Try Real Term. You can also use PLX-DAQ, which is a freebie macro for Excel. This enables you to make live graphs as well as record data. Both of the above include timestamping off the PC's clock. I don't see why you should be writing any programmes for a PC. That has been done plenty of times already.