Shop OBEX P1 Docs P2 Docs Learn Events
Did I really just waste 100 bucks..please give me a hand..... — Parallax Forums

Did I really just waste 100 bucks..please give me a hand.....

doughboydoughboy Posts: 12
edited 2006-10-09 06:48 in BASIC Stamp
Im a first year engineering student and am in a class where we build a baloon satellite, create and experiment for it and then launch it to 100,000 feet.
The so called experiment my group decided to under go was the measuroing of light absorption in the atmosphere. We planned to do this by measuring light intesity in flight to compare them. We figured we could accomplishment this with a BS1 and a superboard for it. Did we mess up?
We have 3 photo diodes with diffrent filters on them to cover most of the light spectrum, not just the visible.
The issue we are having is storing data from these, apparently you can only store variable data in the RAM and not the EEPROM, essentially meaning we cant measure the light intesnsity every 3 minutes of the 1.5 hour flight from each of the three diodes, instead we can only measure "MAYBE" 7 times of data from each sensor assuming we use the minimum amount·as variables and store the data as bits.
My questions are:
Can we add more ram?
Can we workaround the only constants in eeprom?
What other options are there?

The primary issue is funds, we are allocated only 275 for this experiment as well other materials and we had to purchase a digital camera to convert to IR.

Any other tips would be great, I have no idea what im doing pretty much and only programed in basic freshman year in highschool.

Comments

  • Ken GraceyKen Gracey Posts: 7,387
    edited 2006-10-04 04:10
    doughboy-

    The first tip I would have provided is to not disclose that you're a student. Third time I've ever used an emoticon =>· roll.gif Now we're going to want you to do the work on your own!

    The only money you wasted was the rest of the money you didn't spend at Parallax.

    Only kidding. . . measuring light every three minutes of a 1.5 hour flight would be 30 samples per sensor. Three sensors would be 90 samples. If the values you want to save are less than 255, then you need 90 bytes. Don't have 90 bytes of RAM laying around? No problem! If your PBASIC program is less than 256-90 bytes = 166 bytes in length you can use READ and WRITE to store the data in EEPROM. Sounds like you're using the POT command to do this job. Write a tight little program that reads the POT value of each sensor, saves it in a variable, writes it to EEPROM location, increments the EEPROM cell and does the same thing all over again until 90 samples are taken.

    Lots of big things have been stuffed into BS1s for the last 14 years. You can do it. You could even add an external EEPROM for data storage. You can use the SEROUT command on the BS1 to get the data back to your PC, or use DEBUG while it's connected to the PC and copy/paste from the blue window. Lots of options to achieve this task.

    Ken Gracey
    Parallax, Inc.
  • doughboydoughboy Posts: 12
    edited 2006-10-04 04:16
    Well, there has to be a reason to why i have no idea what im doing..i dont know what pot is but i'll try it! thanks

    Post Edited (doughboy) : 10/4/2006 4:26:16 AM GMT
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2006-10-04 04:27
    See the BASIC Stamp Manual's description of POT. It's like RCTIME for the BS2, but for the BS1. There's even a handy little feature built into the BASIC Stamp Windows Editor which allows you to configure the command. Provided your light sensors are resistive devices and setup with a capacitor and resistor in an R/C circuit, POT could be the easiest solution (no A/D converter and code overhead to go along with them - sometimes a challenge in the BS1).

    Oh, one more tip. Make this project work in small pieces, only proceeding to the next step when you've succeeded with the prior one. In other words, do it like this: connect one sensor; use POT to read the R/C value; add WRITE to save the value in EEPROM; add a PAUSE or SLEEP command for the delay; repeat process for 2nd and 3rd sensors; make it all work together. Don't build the whole project first and point at it while saying "it doesn't work". Nothing works with microcontrollers until you make it work. If you do this in small steps you're bound to have success.

    Back to my evening project now. Others can take over.

    Ken Gracey
    Parallax, Inc.
  • doughboydoughboy Posts: 12
    edited 2006-10-04 06:35
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-10-04 11:15
    You may need a BS2 to handle that chip.
    (I don't think the BS1 has the command set needed to utilize it)

    Will projects be recycled or upgraded later?
    If so, a BS2pe would be perfect for this kind of projects as it has a lt of storage(16 x 2KB slots, of which 8 are dedicated for data storage, and the rest of which can contain both data and programs) and a low power consumption.
    (Actually, a Propeller would be even better, as it has a ridiculously low power consumption when 'idling' at 20KHz, but it has a bit of a learning curve... )

    The biggest error you've done is that you haven't studied the documentation for all the parts in the project closely enough. (Reading the PDFs at the page you point to shows that they use the COUNT instruction, which a perusal of the manual show only exists on the BS2 and newer)
    This is a classic fault, though, and something we all do from time to time...

    Thankfully you didn't ask us to write your program for you. smile.gif
    (There's usually a rash of that kind just before end of terms, and very few of those ever get much help... )

    How are you going to retrieve the balloon and data?

    Have you studied the High Altitude Photographic Balloon project?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-10-04 11:34
    If you can't get it working, and want to try a BS2 on a budget, you can order an OEM BS2 in kit form from tha Parallax sale page. If you know how to solder, you should be able to knock it out quickly.
  • metron9metron9 Posts: 1,100
    edited 2006-10-04 14:44
    I would add a small release pin the stamp could activate to drop the stamp with a parachute. Add a small piezo buzzer to emmit a chirp and an LED to blink, that way it will be easier to find when it falls back to earth.

    External eeproms work good as well for data storage if you need more data space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • doughboydoughboy Posts: 12
    edited 2006-10-04 17:48
    the balloon and the data have a gps system that will parachute down
    how hard or easy is it to interface adittional eeprom?
  • metron9metron9 Posts: 1,100
    edited 2006-10-04 18:08
    This will get uou started
    http://www.parallax.com/dl/docs/prod/appkit/8kSerialEeprom.pdf

    Then just read the datasheet for example on this eeprom
    http://www.parallax.com/detail.asp?product_id=604-00020

    Do a serach for eeprom on these forums, lots information here.

    I like to use www.digikey.com part search engine. I find parts i don't know how to use and just read the datasheets. Amazing how much you can learn just paging through hundreds of pages of information packed datasheets. Click on the big D at the end of each line for the datasheet on each part.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-04 18:08
    If you pick an SPI interfaced eeprom, it should be very easy. I haven't used the BS1 myself, actually, I'd be sorely tempted to start with the BS2 -- it's only another $50 - oh, and the 'OEM' version is on sale for $30, and comes with it's own circuit card.
  • doughboydoughboy Posts: 12
    edited 2006-10-09 06:48
    thankfully due to the very·forgiving return policy we returned the bs1 kit and got a bs2 and super carrier board, ironically it ended up costing less. [noparse]:)[/noparse] if someone is bored and wants to look at my code so far it's pretty short and self explainatory!

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    '----------------- 'variable assignments------------------------------------
    memDiode1 VAR Byte             ' memory locations for diode readings     output of sensor
    memDiode2 VAR Byte
    memDiode3 VAR Byte
    timer VAR Word
    eepromstorage1 VAR Byte
    eepromstorage2 VAR Byte
    eepromstorage3 VAR Byte
    
         eepromstorage1 = 0
         eepromstorage2 = 0
         eepromstorage3 = 0
         timer = 1
    
    '----------Pin Assignment'''''    o is defualt as input
    INPUT 1
    INPUT 2
    INPUT 3
    OUTPUT 4 'sensitivity 1 high
    HIGH 4
    OUTPUT 5 'sensitivity 0 low
    LOW 5
    OUTPUT 6 'scaling 1     low
    LOW 6
    OUTPUT 7 'scaling 2     low
    LOW 7
    OUTPUT 8 ' output enable
    
    '--------------------Data grabbing/storage--------------------------
    
             FOR     timer = 1 TO 150 STEP 3    'takes 50 sets of data
                    PAUSE 1800 'pauses for 1800ms, 3 min
                    COUNT 1,5, memDiode1         'time in microseconds for a period to occur
                    COUNT 2,5, memDiode2
                    COUNT 3,5, memDiode3
                    DEBUG  "1:",memDiode1
                    DEBUG  "2:",memDiode2
                    DEBUG  "3:",memDiode3
                    WRITE    Timer+0, (memdiode1)          '--------saving to eeprom''''''''''''
                    WRITE    Timer+1, (memdiode2)
                    WRITE    Timer+2, (memdiode3)
    
            NEXT
            END
    

    and then once its retrievied we will write this code to it and run it to get an output:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
      timer VAR Word
      datadiode1 VAR Word
      datadiode2 VAR Word
      datadiode3 VAR Word
    timer = 1
    
    'debug it to the computer
       FOR     timer = 1 TO 150 STEP 3
        READ   timer,Word datadiode1
        READ   timer+1,Word datadiode2
        READ   timer+2,Word datadiode3
        DEBUG    "time",timer,"DATA",datadiode1
        DEBUG    "time",timer,"DATA",datadiode2
        DEBUG    "time",timer,"DATA",datadiode3
      NEXT
      END
    
    


    see any issues?

    Post Edited (doughboy) : 10/9/2006 6:52:27 AM GMT
Sign In or Register to comment.