NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Sending Data to a File

February 21, 2012
by TheUnfocusedOne
TheUnfocusedOne's Avatar

Hi everyone,

Quick question. Anyone know a simple method of sending data from the MCU to a file?

I want to set my nerdkit up to collect some temperature reading over a few hours while occasionally depositing the data into a file so I can calculate an average temperature.

Obviously, I know how to set up the thermometer, but dumping the data into a file is beyond my current skills.

Trying to figure out an optimum area to brew beer, so this project is high priority!

February 21, 2012
by hevans
(NerdKits Staff)

hevans's Avatar

Hi TheUnfocusedOne,

There are a couple of ways you could go about this. The simplest way would probably be to just dump the contents your terminal emulator to a file. If you are using Putty to view the values coming back over the serial port you can just turn on logging on Putty. I found a quick tutorial about it here .

The other option is to write a quick program yourself on the PC side to log the input to a file. We have a few examples of using Python to read in data from the serial port and then graphing it, you can just save it to a file instead of graphing it.


February 21, 2012
by 6ofhalfdozen
6ofhalfdozen's Avatar

Hiya TheUnfocusedOne,

There are several ways to set up a data log from the serial port, depending on what programming languages you know and what software you have available.

I can't remember if you can save hyperterminal logs or not, but if you have it and it can that would be a very fast and quick way to do it. Just set up hyperterminal to find your NK (comports speeds etc..and log what the NK sends.)

Probably one of the other fastest methods is mentioned in the thread from a few days ago by RevMoses about using python to log data. The links for all the python stuff are mentioned repeatedly on here.

Normally I use to log data from NK for my mead brewing, though I have started playing with Processing recently to make faster graphs and logs. I believe there are several threads about VB or C+ programs to log on this forum or others. Worse case scenario if you wanted I could send you a small logger for you to do some quick testing.

February 21, 2012
by TheUnfocusedOne
TheUnfocusedOne's Avatar

Interesting, I didn't realize I could use a python program to route the data. It makes sense since the USB will just be spitting out digital signals which any language should be able to work with.

I'll try to play around with the python program posted few days ago and let you guys know how I make out. It's been a while since I did anything with python, so it'll be a nice mini refresher.

I'm using a mac, and I don't think I have putty. This sounds like a more interesting method anyway.

Thanks for the help so far!

Post a Reply

Please log in to post a reply.

Did you know that you can follow NerdKits on Facebook, YouTube, and Twitter? Learn more...