Shop OBEX P1 Docs P2 Docs Learn Events
Data Storage — Parallax Forums

Data Storage

USMCinfinityUSMCinfinity Posts: 150
edited 2010-08-27 22:35 in BASIC Stamp
Hey guys, I need to do a really big project (BalloonSat) in which I want to use the BS2 for data storage, the problem is....how? How can I lets say for starters store the data taken from a photo-detector? as in intervals where it detected light and when it didn't?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 10:27
    First you start by defining the parameters of your project. What data do you need to store? How often do you need to store it? What's the resolution of the clock you're using to identify intervals?

    You can't answer the how before you specify the what.

    What are your other parameters? Is there a hard cost constraint? What about physical size?

    Maybe a BS2 is not adequate for data storage. By the time you add a real-time-clock and some kind of external storage, you'd be better off with something else. Maybe a BS2pe would be perfect for the amount of storage you need to keep (about 30K bytes or less) and the data rate and resolution could be handled by using PAUSE statements for clock ticks (like once a second or less).
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 10:48
    I have the propeller too, is there any project around that I can try it to learn about data storage..?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 11:10
    A Propeller and an SD card can make an excellent datalogger. There are several SD card drivers in the Object Exchange that handle PC-compatible files. Either Kye's or Rokicki's would work well. Often, people will write different files with the logging data, closing the file and opening a new one every minute or hour or day depending on the data rate. The file name usually has the date and time as part of the name.

    You can also find a clock object in the Object Exchange although it's trivial to track absolute times up to about 50 seconds with the Propeller. You normally use the system clock to produce 1 second clock ticks, then keep a count of those to produce the time and date.
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 11:33
    Object exchange?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 11:39
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-08-26 12:04
    For my curiosity, what kind of data are you storing? size/rate??
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 15:02
    In reality I don't know, that's why I'm asking for a example about data logging?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 15:12
    Look at the sample code for the Parallax Memory Stick Datalogger. That illustrates one way to do datalogging with a Stamp.

    EmeSystems sells dataloggers using a BS2pe. You might browse the website. There's a lot of excellent information there on the use of Stamps for all sorts of things. Check out the stuff at the "app-notes" link at the bottom of the page.
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 16:02
    Thanks man, seems I have a lot of research to do!
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 16:19
    What stamp does the datalogger uses? Can I try that out with the BS2? I've spent thousands already so I wanna try to do the stuff with what I have. I know it can be done with the duamilanove, but I have the homework board, the PDB and the propeller, so I wanna do it with one of those...is there NO example of data logging with them?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 16:51
    The EME Systems datalogger uses a BS2pe which has 32K of EEPROM which is where it stores its data. The BS2 has only 2K of EEPROM and your program has to fit there as well so there's not a huge amount of storage for data.

    If you use the Parallax Memory Stick Datalogger, that's where the data would be stored (on the memory stick) and the BS2 would just need to hold the program that talks to the Datalogger and reads the sensors.

    There's no sample code for datalogging using the HomeWork Board or the PDB/Propeller because they have limited storage by themselves and you'd need some additional hardware to hold the data and the hardware you'd need depends on what you want to store.

    Really, figure out what your datalogging needs are first, then we can talk about best ways to implement it using what you've got.
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-26 17:05
    So a good thing would be to buy the datalogger and play with it on the PDB? Usin it's bs2 to control whatever "payload" an store it on the datalogger..? The final "datalogging" would be voltage levels of 5 photodiodes 0-5 volts on a balloonsat to determine it's position in relation to the sun.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 21:12
    You still haven't really answered the questions I've posed. So you've now got 5 streams of data representing voltages from 0 to 5V. How many characters or how many bits of significant data for each voltage? How often do you want to log these? Is the logging triggered by some external event or it is timed? If timed, how often do you want to log it? What else gets logged with the 5 values? What about time stamping? What about date stamping? Would you have to date stamp everything or just log when the day changes?
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-27 10:22
    Holy Smile, hahaha that is exactly why I need some real life example. I was in charge of the electrical design but now I'm in charged of the project, so I though learning about data logging needed to be done first.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-27 11:49
    The Parallax Memory Stick Datalogger (#27937) has links to ZIPs with demo programs for BS2.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-27 12:56
    A real life example of something unrelated to your project is unlikely to teach you anything applicable to your project unless they're similar. If you don't know anything about what you want, how are you going to know if the two projects are similar or not?

    Datalogging is not magic. It's simply the recording of streams of potentially useful data that you're trying to save for later, sometimes when things go wrong, sometimes just for analysis. Usually it's helpful to include some kind of time mark so you know when the data occurred. Sometimes datalogging needs to be done with low power, like if you're running the whole shebang off little bitty batteries that have to last a long time, but sometimes there's plenty of power available and it doesn't matter how much you use for the datalogging part of things.
  • FranklinFranklin Posts: 4,747
    edited 2010-08-27 18:21
    Anything in here you can use? https://wiki.umn.edu/view/MnsgcBallooning/BasicStamp It's even about ballooning.
  • USMCinfinityUSMCinfinity Posts: 150
    edited 2010-08-27 22:35
    Will check everything tomorrow, today I was stuck 8 hours working (salesman) then doing computer architecture and operating systems homework.. :-( ...so much for friday nights!
Sign In or Register to comment.