Go Down

Topic: Writing in to excel sheet (Read 1 time) previous topic - next topic

AMPS-N

Dear all.

can some help for programming below.

I wanna write the perametre like time and date from Arduino code to excel sheet. Can some one suggest me how to configure arduino to write into Excel sheet. How programing code look like

AMPS

michinyon

The arduino cannot write into an excel sheet.

Excel software runs on a computer, not an arduino.

Arduinos can send data using conventional serial protocol to other devices, including computers.
As far as I know,  excel has no method available to collect this data itself.

You would need to write a program to run on your computer,   to collect the serial data being sent by
the arduino,   and then put that data into excel,  or write it into a file which excel can read.

AMPS-N

can you tell me the where i can get code for loging data either in excel sheet or text file



The arduino cannot write into an excel sheet.

Excel software runs on a computer, not an arduino.

Arduinos can send data using conventional serial protocol to other devices, including computers.
As far as I know,  excel has no method available to collect this data itself.

You would need to write a program to run on your computer,   to collect the serial data being sent by
the arduino,   and then put that data into excel,  or write it into a file which excel can read.
AMPS

michinyon

well here is two methods:

(1)  Write your data into a plain text file with commas between the fields,  onto an SD card connected to the arduino.
There are plenty of online tutorials and code examples for this.   Take the SD card out of the arduino. Stick it into the
computer.  Use excel to input the data from the "CSV" format file on the SD card.

(2)  Learn how to use "Processing" or some other language on the PC capable of collecting data from the serial port.
Send the data from the arduino to the computer,  collect it with a program you have written,  and save on the PC
in a CSV format text file.   Then read it into excel.

AMPS-N

can you explain me where i can get more idea over 2nd topic



well here is two methods:

(1)  Write your data into a plain text file with commas between the fields,  onto an SD card connected to the arduino.
There are plenty of online tutorials and code examples for this.   Take the SD card out of the arduino. Stick it into the
computer.  Use excel to input the data from the "CSV" format file on the SD card.

(2)  Learn how to use "Processing" or some other language on the PC capable of collecting data from the serial port.
Send the data from the arduino to the computer,  collect it with a program you have written,  and save on the PC
in a CSV format text file.   Then read it into excel.
AMPS

linwendil

It is not impossible, just very hard and demands some extra components it seems. At least at a quick glance on this link http://social.technet.microsoft.com/Forums/is/ITCG/thread/ccdaded5-fb27-42a2-85e2-eca8aab4037e

That said I think method 2 above is the way to go

AMPS-N

Dear all,

I made it work using python .

software needed pyserial v2.5 software and usb to serial converter .



code  to run on python:

import serial
import csv
import os

os.path.abspath("F:\BK -cd1\python")


logfile="time.csv"


def main():
    pass

if __name__ == '__main__':
    main()
    COUNT=0
    while(COUNT<=60):
      ser=serial.Serial()
      ser.port=12
      ser.baudrate=9600
      ser.open()
      x=ser.read(16)
      foo=open("fool.txt","a+");
      print x
      foo.write(x)
      foo.write("\n")
      foo.close();
      ser.close()
      COUNT=COUNT+1
      if(COUNT==60):
        COUNT=0
AMPS

pito

FYI - looong time back I used this gadget:

http://www.parallax.com/tabid/393/default.aspx

It writes directly ("in real time") to the excel sheet from any mcu via serial, just do follow the required format.. :)

Go Up