Arduino Forum

Development => Other Software Development => Topic started by: Emix on Jul 23, 2013, 11:47 am

Title: Save data to file
Post by: Emix on Jul 23, 2013, 11:47 am
Hi,

I've been looking for a way to store the data of the Serial Monitor to a file on my computer and I found a lot of topics talking about it but no suitable answer. I think this would be a great improve of the arduino program. Here's a first try to allow the Serial Monitor to switch between writing to the screen the aquired data and writing to a file. Only three arduino java files have been modified and all modifications are starting with a comment //bay.
Maybe this could be helpful to someone...

Best regards
Title: Re: Save data to file
Post by: AWOL on Jul 23, 2013, 11:50 am
Most proper terminal emulators allow storage to a file - no need to change anything.
Title: Re: Save data to file
Post by: Emix on Jul 23, 2013, 07:53 pm
How do you do that ? I haven't found anything on the web but weird scripts that try to catch what the Serial Monitor says... If you have a better solution, I'm really interested !
Title: Re: Save data to file
Post by: AWOL on Jul 23, 2013, 07:55 pm
PuTTY, Hyperterm...
Title: Re: Save data to file
Post by: Emix on Jul 23, 2013, 08:04 pm
Alright but there you need to run a script in parallel to the arduino program. I thought that it would be nice if the arduino program could do this on his own.
Title: Re: Save data to file
Post by: liuzengqiang on Jul 24, 2013, 07:29 am
Try this:

https://sites.google.com/site/terminalbpp/

You can even plot data with it besides simple logging. Toggle arduino reset. etc.
Title: Re: Save data to file
Post by: aarondc on Jul 24, 2013, 09:44 am
Thanks for the idea :D

Do you mind providing a little more information about why you wish to save serial output to a file?
Title: Re: Save data to file
Post by: Emix on Jul 24, 2013, 11:31 am
My arduino is aquiring data from a circuit with a scintillation cristal in order to measure the spectrum of radioactive sources. It is displaying instantly the histogram on a lcd screen and the number of the channel of each hit is displayed in the serial output. So in order to be able to save the histogram created, I'd like a way to say to the program that it should save it into a file.
Title: Re: Save data to file
Post by: liuzengqiang on Jul 26, 2013, 07:57 pm
Emix,

Is this some sort of physics experiment? I am interested in more details, such as how arduino is hooked up to the scintillator.
Title: Re: Save data to file
Post by: AWOL on Jul 26, 2013, 08:52 pm
Yes, I'd be interested in the details too.
Is it an array of scintillators responding to different energies/frequencies?
Title: Re: Save data to file
Post by: aarondc on Jul 27, 2013, 12:33 am
+1, video too, please :D
Title: Re: Save data to file
Post by: Emix on Jul 27, 2013, 01:24 am
Hi guys, it's nice to see that there are some people interested by physics !  :)

So, yes, it's a physics experiment. It's a small setup for the practical work of physics students. I only have one cristal, so the energy range is limited but good enough for the purpose of this experiment. The scintillator is connected to a PIN diode which is in turn connected to a pcb specifically designed for this experiment. The most important part of the circuit is the sample and hold feature that holds the signal detected long enough so that the arduino can read it and process it. It's quite nice and it's starting to work well but the setup is not fully finished yet, so the video will maybe come later, ^^.
Title: Re: Save data to file
Post by: liuzengqiang on Jul 27, 2013, 02:51 am
So you are doing less than say 200,000 counts per second then with sample and hold? I only know how to use the detector with single or multichannel analyzers, which turn the pulses into digital signals for the next stage of things, such as counters. So you are not using these analyzers or counters but a sample and hold circuit? I could do something like this if it doesn't involve high voltage. The detector needs a few thousand volts, but the current is low, right?
Title: Re: Save data to file
Post by: pito on Jul 27, 2013, 05:50 pm
In TeraTerm: File->Log
and everything you see in the monitor get logged into a file of your choice..
Quote
So you are doing less than say 200,000 counts per second then with sample and hold?

Hopefully not too close to the experiment, though :)

PS: long time back I built a detector with PIN diode (7mm2 active area), without a scintillator. I get 0.05 - 3 pulses per second (needle-shaped pulses with different amplitudes, ~30uS long) based on irradiation. Looking for a good peak detector with S/H too..  :)
Title: Re: Save data to file
Post by: Emix on Jul 28, 2013, 12:16 am
It's a small scale experiment for students, so the source is really weak, < 100 ?Cie and it needs a low voltage, 12 Volts.
Title: Re: Save data to file
Post by: Emix on Aug 30, 2013, 10:34 am
Hi there,

So here are a few news about this experiment. It is able to acquire data from a detector made of a scintillator and a PIN diode or from a PhotoMultiplier. It will display directly the histogram of the spectrum on the screen connected to the Arduino. When the spectrum is thought to be good enough, one can press a physical button connected to the Arduino in order to save the actual histogram into a file. I find this method much more efficient and useful than using a terminal emulator and saving each entry in the file. I guess that will depend on what data you have and what you want to do with them.
Here are the final version of the files that allow to do that, maybe this will be useful to someone.
Title: Re: Save data to file
Post by: Emix on Aug 30, 2013, 10:36 am
And here are a few pictures of the setup and the detector,  :)
Title: Re: Save data to file
Post by: Emix on Aug 30, 2013, 10:37 am
And one more, sorry for the number of posts, but the pictures are too big ! ^^
Title: Re: Save data to file
Post by: door144 on Apr 14, 2014, 11:44 pm
Have you ever got your scintillator working im trying to build one now but im having some issues. http://forum.arduino.cc/index.php?topic=232151.0
Title: Re: Save data to file
Post by: pYro_65 on Apr 15, 2014, 06:05 am
HTerm is the best, it has the connect + save data buttons right next to each other. All the main functionality you'd expect is on the main screen.  Nothing to install either, it is one file.

Their homepage below has the download link at the top, it is in german, but the application is in English.
http://www.der-hammer.info/terminal/

Title: Re: Save data to file
Post by: Robin2 on Apr 15, 2014, 09:37 am
The Arduino can't save data on a file on a PC without some software running on the PC that is controlled by the PC. You can use one of the terminal programs as has already been mentioned, or you could write your own PC program in Python or your favourite language. Many people that use Arduinos seem to like Processing.

You could add an SD Card to to your Arduino system and have the Arduino write directly to a file on that. Later you could take the SD Card to your PC to upload the data.

...R
Title: Re: Save data to file
Post by: liuzengqiang on Apr 15, 2014, 05:49 pm
Hey Emix,

I lost track of this post. Would you be interested in competing at the AAPT apparatus competition this summer? Impress construction! I would like to know more about it!

http://www.aapt.org/Programs/contests/apparatus.cfm