Shop OBEX P1 Docs P2 Docs Learn Events
Store a great deal of Datas — Parallax Forums

Store a great deal of Datas

Adriano72Adriano72 Posts: 22
edited 2009-05-20 13:56 in BASIC Stamp
Hi all, I'm a beginner

I would like to know if there's a way to store a large amount of data using a Basic Stamp, i.e. temperature measured over one entire day every 5 minutes.

I suspect that the EEprom can't hold so much data so I'm wondering if is there a method to store data to a SD card or something similar.

After storing the data I would need to read these data via USB on a laptop

Thank you in advance

Cheers

Adriano

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-13 14:05
    One temperature reading every 5 minutes is not that much. That's 12 readings per hour times 24 hours = 288 readings with each reading taking 2 bytes. That's 576 bytes, about 1/4 of the EEPROM memory of a BS2. If your measurement program is not very complex, it should fit easily in the remaining memory. Take a look at Stamp Plot Pro which is available free for non-commercial use from Parallax. This PC program can handle the receiving end of the data dump and can store the data in a file and plot it for analysis. The same USB to serial adapter that you use for programming the Stamp can be used for the data transfer.

    www.parallax.com/ProductInfo/Microcontrollers/BASICStampSoftware/StampPlotSoftware/tabid/481/Default.aspx

    It is possible to attach external EEPROMs to a Stamp for data storage. It's much easier to just get a Stamp with more EEPROM storage. The BS2pe is designed specifically for datalogging and has 32K of EEPROM.
  • Adriano72Adriano72 Posts: 22
    edited 2009-05-13 14:36
    Dear Mike,

    thank you for your quick reply. The Stamp Plot shall be very useful to me! But what if I would need to store more data than the BS2 memory can handle?
    If I have to store temp data for a week, or a month for example. Where can I write these data in a way that I can later read them on another device like a laptop?
  • Adriano72Adriano72 Posts: 22
    edited 2009-05-13 14:37
    Much more than 32 K I intend...
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-05-13 16:23
    The "memory stick datalogger" that Wolfbrother mentioned is a good option for being able to transfer data to the computer using a USB flash drive that can hold gigabytes. Note that the datalogger is an accessory for the BASIC Stamp, not a standalone device. The BASIC Stamp acquires the temperature data and formats it to store on the USB stick. Then you plug the USB stick into your computer, viola, there is your data file that you can read into a spreadsheet. However, you should be aware that it is a device that can be problematic for first time users. Be prepared to ask questions!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • GeorgeLGeorgeL Posts: 131
    edited 2009-05-14 04:43
    It ain't the cheapest thing though. $35.00 is quite a sum, still very useful
  • Adriano72Adriano72 Posts: 22
    edited 2009-05-14 08:12
    Yes, it looks what I'm in need of. Though, not the cheapest solution effectively...

    Thanks to all for your precious help!
  • modemmanmodemman Posts: 41
    edited 2009-05-15 14:22
    Is it easy to read data from the "datalogger" or its main purpose is to write stuff into a "log" file to be read later on something else?

    What other storage solutions are there?

    For example, what is the most effective way to store hundreds of phrases to be accessed and spoken by a TTS speech module?

    Thanks for your advice.

    modemman
  • achilles03achilles03 Posts: 247
    edited 2009-05-15 14:46
    Adriano72 said...
    Much more than 32 K I intend...

    If your measurements are only 1 byte each, you could store over 3 and 1/2 months of data on a 32K eeprom. If they are timestamped and, say, you need 4 bytes for each measurement (3 bytes for the timestamp in a format like day-hour-minute and 1 byte for the temperature), then you're still at 28 days.

    Use a 64K eeprom and you're back over a month and a half. There's SPI and I2C eeproms with 64K of memory that you can use with the stamp.

    And if you want more than 64k of data, you can use multiple I2C chips relatively easily.

    The datalogger is an option, but an eeprom is cheaper, simpler, and will hold all the data you require.

    Hope that helps...
    Dave
  • Adriano72Adriano72 Posts: 22
    edited 2009-05-15 14:56
    Thanks Achilles,

    being a naive beginner I didn't realize how much data could be stored in 32K. I'm pretty sure one or two eeprom would fit perfectly for my needs!

    Cheers

    Adriano
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-15 15:00
    modemman,
    First figure out how much memory you need. As achilles03 mentioned, EEPROM is much easier to use than most dataloggers and you can attach 512K to a pair of I/O pins using 4 chips.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-05-15 15:25
    There are both SPI and I2C eeproms available, and either can be used with the original Stamp. For an example of a simple data logger using the SPI memory you can still take a look at the manual for the (discontinued) Data collection proto board. The BS2pe, as mentioned above, already has that 32kbytes on board for data logging.

    My company makes the OWL2pe data logger based on the BS2pe, and the logging memory is a 1 megabyte flash memory (AT45DB081) in a single 8 pin chip. It can store one or several files. There are other uses for large memory, other than a single large data file.

    With that much memory you have to consider how much time it will take to offload the data through the serial port, especially if data stored as binary has to be expanded to ascii text for transmission. For example, it takes about 5 minutes to transfer 64kbytes of raw data. The BASIC Stamp cannot achieve throughput at high baud rates. For really large data files, an SD or USB-stick interface is soooo convenient.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • modemmanmodemman Posts: 41
    edited 2009-05-15 17:12
    Thanks Mike and Tracy Allen.

    Quick shout outs: Mike, you really rock at answering everyone's questions and your experience with all this seems immense. Tracy Allen, thanks for a very informational site on the Basic Stamp, it's one of the best resources out there.

    Eeproms are the way to go. I thought there are modules out there that interface a mem card reader with the stamp in an easy way, but I do realize how hard it is to make a protocol that can do that, giving the completely different ways the standard PC flash memory functions. I'm also sure such device would be expensive, while eeproms are really cheap.

    I'm mostly looking to exchange data with my program, to circumvent the limitations of the 2k (x8) in my BS2P. So, it's not just the data acquisition part that interests me (as in a datalogger), but also being able to read from it and ease of addressing.

    Examples that come to mind (mostly robotics) are:

    - storing many text phrases for a TTS module, to be addressed by number from the program. For example, instead of "if robot sees stairs then say [noparse][[/noparse]'Oops, I almost fell down the stairs...']", do "if robot sees stairs then say [noparse][[/noparse]phrase(123) from memory]" - I think an 128k Eeprom is more than sufficient for something like this (could really store over a thousand phrases).

    - storing a complex map of a location, a behavioral pattern for robots, sound patterns (ring tones for the piezo), etc., etc...

    PS. Thank you Parallax for dropping the stamp price to $50!!

    EDIT: For only 2 bucks one can get a 256Kbit (32Kbyte) I2C Eeprom! see www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/List/1/ProductID/400/Default.aspx?SortField=ProductName%2CProductName

    Post Edited (modemman) : 5/15/2009 5:26:15 PM GMT
  • Adriano72Adriano72 Posts: 22
    edited 2009-05-15 17:40
    I would like to join modemann saying only that: I posted some question more than a year ago and Mike answered me. Now I posted another question and who answered first ? MIKE !

    I don't want to diminish others' help though, but only say a big THANKS to Mike!

    Really, this is a great great forum filled with highly skilled, polite and helpful people. Thanks to all!

    Going back to the topic: As like as modemann, I have the need, once logged data on eeprom, to read them on a pc. I suppose is not a very easy thing to do for a beginner (even tough I'm a software programmer). But still I can't figure out how to do it... I plug the BS2 on the serial or usb port. And then??

    cheers


    Adriano
  • modemmanmodemman Posts: 41
    edited 2009-05-20 13:56
    UPDATE: I ended up getting these chips, which are quite spacious at 1Mbit:

    search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=24LC1025-I/P-ND

    As most eeproms today (things I learned from this forum, of course) they are organized in pages - 8 pages of 128 bits each. As Mike pointed to me when I was getting excited about the numbers - don't forget, we are talking bits here.... so, at 8 bits per byte (for example), a page is 16KBytes (for a total of 128KB - that's pretty big for an eeprom). The chips can do random reads and sequential reads. You can read by address or by page. The chip should support at least 1 million read/write cycles and should be able to hold data for over 200 years... 4 of those chips can be cascaded (linked) together and read as one large memory databank via I2C.
Sign In or Register to comment.