Data saving in Arduino

Hello,

I'm very much new to Arduino programming.

My program is very simple. According to my analog input control will switch the solenoid. but really want to save the data( switching date, time and duration) in the chip for future analysis.

Is it possible to do in Arduino mega 2560.

Please let me know,

Thank You,
Janitha

Is it possible to do in Arduino mega 2560.

Use EEPROM for storage of small amounts of data or an SD card for longer term or greater amounts of data.

Thank you for your prompt reply.

Do you have any sample code, exapmle...
Is it possible to retrieve data through USB interface.

Janitha

Do you have any sample code, exapmle...

There are plenty of examples on the EEPROM reference page. YOU have to determine WHAT you want to store, and WHERE you want to store it.

Is it possible to retrieve data through USB interface.

Not directly. You can send data to the Arduino, via the serial port. The Arduino COULD interpret data like "Hey, dude, what's in EEPROM address 47" to mean something, and it could generate an appropriate response.

(Of course, a simpler protocol might be easier...).

Is it possible to retrieve data through USB interface.

If you mean read the EEPROM or an SD card on the Arduino and pass it to the PC then yes, but you will need a program on the PC to receive and deal with the incoming serial data. You could also pass the data to the PC as soon as it is read by sensors attached to the Arduino but you will still need a program on the PC. Some terminal emulators can save incoming data directly to a file on the PC.

Hello,

Thank You for reply.

What do you mean by SD card. Because I'm going to use "Arduino mega 2560" is this board comes with SD card or is there any slot to pug SD card in "Arduino mega 2560"

could you please specify free terminal emulator.

Thank You,
Janitha.

The easiest way to use an SD card is to use an SD shield such as SD Card Shield V3.0 | Seeed Studio Wiki

could you please specify free terminal emulator.

Tera Term

You can get an SD module, a small board with SD slot, voltage leveling circuits and header pins for less than $2.
You still need jumpers with one end male for Arduino and the other female for the header pins. The best jumpers like that to get is a 40-wire DuPont Cable, you peel off as many wires as you need, they all have separate jumper ends.

You can make your own SD adapter out of a micro-to-full-SD-adapter sleeve, an HC4050 chip and wire. Since the sleeve comes with most micro-SD cards, the adapter parts cost less than $1.

Yes you can save through USB, the serial COM link.
If your Arduino prints to serial, your terminal program may save that for later use.

I like the free PuTTY terminal. I can feed scripts through it and log the output.
When I type a letter it sends the letter, not wait for Enter to send a line.
That level of interaction allows much better user IO like instant error notice and correction which is much better than type an entry and then find out there's error(s) and retype, etc. Been there, fixed that over 30 years ago. PuTTY can emulate VT-100 and other workhorse terminals.