I am running a sketch on an Arduino UNO which collects data in sram. Power is battery about 6v. When I want to look at the data I connect a computer using the USB port and press a button on the Arduino board which makes the program print out the data to the serial monitor. Sometimes the serial monitor does not work at all until I unplug the USB and plug it back in. But then I find that the data array has been reset to zero as if the power has been cut off. It all works ok when connected to the computer, it only fails when I disconnect the USB, take the device away to collect its data then reconnect the USB to read it. Can anyone help please.

Thanks for the reply. I was wondering about the 6v supply it seems to work but perhaps not well. I will try a higher voltage. Also, I just plug the USB cable in and out with the power on both the computer and the Arduino board. Is that safe? I have not heard of GoBetwino, what is it?

But then I find that the data array has been reset to zero as if the power has been cut off

Any time a host PC connects via serial, the Arduino is auto-reset. So opening and closing the serial monitor will reset your Arduino, regardless of power source. You would need to disable the auto-reset to stop this behavior (and/or store your values in EEPROM.)

Not clear how you are powering Arduino on a 6V battery? 6V is too high for the +5V input, and too low for the VIN input.

This is not completely true. 6.0v is the absolute maximum for the MCUs (although a 6v bat is actually higher then that) on the 5v line and 6v on VIN will produce enough voltage to work, just not full 5v.

Avoid throwing electronics out as you or someone else might need them for parts or use.Solid state rectifiers are the only REAL rectifiers.Resistors for LEDS!

I will respectfully disagree with Mr. Kitty. Not everything you read here is a good idea.

If you checked the datasheet, you would see the 328 is rated for 1.8-5.5v nom with 6 ABSOLUTE MAX and the 8U2 is rated for for 2.7-5.5v nom with 6 ABSOLUTE MAX. Putting 6v in the VIN will produce well over 2.7v on the "5v" line.

Avoid throwing electronics out as you or someone else might need them for parts or use.Solid state rectifiers are the only REAL rectifiers.Resistors for LEDS!

Thanks for all the advice. I think KE7GKP was right that my question is in the wrong area. I am now supplying power with a 9v battery although the 6v one did work ok. Eventually I cut the track between the pads labeled RESET-EN and this prevented the reset when the USB was connected and so the data was available. However, I would still like to read the data into some other program like a spread sheet. Neither Open Office nor Excel seem to see the USB port at all so although I can o/p the data as a string of values with commas between I can't import them to the spead sheet. At the moment there are only 16 values so it is no hardship to type them in by hand, but later there may be many more values. I had a look at Gobetwino and Processing but I am a bit wary of downloading free compilers. I have an old PC running Windows 95 and what looks like real DOS with QBASIC. Perhaps I will try using that.

Oh dear! I didn't mean this topic to wander so much. My reasons for being wary of free downloads of compilers is quite irrational. I did worry about downloading Arduino s/w but I wanted it more than the worry. I have just downloaded Microsoft's Visual studio 2010 in the hope it might help me write a program to access the data I want. However, it is much too complicated. My era was Motorola 6800 assembler language programming when you really felt in full control of everything. Trying to do this project is taking me back to work (I am retired) and I am not sure that I am enjoying it much. I wonder if we should close this thread and if I ever get anywhere with accessing the data I will post it under a more appropriate heading.

My reasons for being wary of free downloads of compilers is quite irrational.

Why? Out of all the dangerous software. Compilers are pretty safe.

At the risk of further derailing this thread ...

There isn't any reason, by itself, to consider compilers as being safer than any other software. It is entirely possible to embed into a compiler malicious code which injects other malicious code into everything it compiles.

That said, if you download a compiler, or other free software, from reputable sources, there's barely the tiniest likelihood of something like that.

Also, on the topic of "free", there's a distinction, poorly conveyed by the English language. There's "free, as in freedom", and "free as in beer". IOW, if someone buys you a beer, there's no cost to you. But free software gives you the freedom to use and modify it yourself.

... it is poor civic hygiene to install technologies that could somedayfacilitate a police state. -- Bruce Schneier

Also, on the topic of "free", there's a distinction, poorly conveyed by the English language. There's "free, as in freedom", and "free as in beer". IOW, if someone buys you a beer, there's no cost to you. But free software gives you the freedom to use and modify it yourself.

So while you may give me a free beer, I may not be able to freely drink it for other reasons? Say I'm the car pool driver, etc.