Shop OBEX P1 Docs P2 Docs Learn Events
Looking for some examples. — Parallax Forums

Looking for some examples.

SpeedySpeedy Posts: 2
edited 2008-08-27 04:04 in BASIC Stamp
Hello All,

I'm new to the program writing for Basic stamps and I'm trying to find a few coding and build·examples.

What I'm trying to do, is build my Homework stamp to connect too and record too Excel the following.

1). Record Temperature via thermalcouple or LM 35·one hundered times per·seconds.

2). Record Pressure readings from a transducer·one hundered times per·seconds. " 30mv Max output "

3). Record Postions via wiper potentiometer·at least one hundered time per second. " 0 to 5v "

·I have gone through the owners build manual and completed all the projects. Now its time to put this thing to work and I'm struggling. Anything, web site ect.. that you could point me to would be greatly app.

[noparse]:)[/noparse]


·

Comments

  • ercoerco Posts: 20,256
    edited 2008-08-25 02:29
    Not sure if a BS2-class chip can keep up with your minimum 100 samples per minute rate. Are you trying to measure all 3 (temp, pressure and 0-5V) at 100 samples per minute? That's obviously 300 samples per minute or more; only ~3 milliseconds per sample. Dat's fast.

    The easiest way to use RCtime is with·variable resistance sensors, but the execution time varies. Lower resistance=faster execution; higher resistance= slower execution, since you're timing the voltage in a capacitor bleeding off through a resistor. So to minimize execution time, you want small cap and resistance values, which will require some experimentation. You could speed up execution time by lowering your resolution, but that's counterproductive.

    Remember that·every RCtime starts with a 1 ms delay to charge the capacitor, leaving you·(at most)·2 ms for·reading and writing or serially transmitting the data, both time-intensive processes for a BS2 chip.··I'm sure a Propeller chip will be better able to support your high·sample rate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • metron9metron9 Posts: 1,100
    edited 2008-08-25 03:49
    I read you want 100 times per second.

    First step is to calculate how much memory you need for the amount of data you wish to collect. That depends on how many bytes you will need to store for each reading. If you are using 16 bit numbers you will need 6 bytes x 100 = 600 bytes per second. If you collect 10 seconds you need 6000 bytes.
    A BS2 can only exectute about 2000 instructions per second.

    Even if you could get a 16 bit number from 3 sensors with one line of code for each sensor·you still need to store the data with another line of code. Of course you will need many more lines to increment data pointers and store those numbers in memory. That would be 6 lines of code times 600 or 3600 lines of code per second. So the BS2 clearly will not work. You also would need 600 bytes of memory for every second of data you need. The memory will also have to be fast enough to allow this rate.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • SpeedySpeedy Posts: 2
    edited 2008-08-26 21:26
    Thank you both for the rapid replys. I understand the comments about the ability to record in the time frames that I've indicated.

    I could slow thinks down a bit I'm sure.

    What·I was hoping for, is that someone could point me to a web site with information about how to put together, both hardware and programing side, a stamp that would perform the measurments I had listed.

    Much thanx just the same. smile.gif
  • DgswanerDgswaner Posts: 795
    edited 2008-08-27 04:04
    have a look at this project. it's reading from an Excel file but it might get you started.

    http://www.c-sharpcorner.com/UploadFile/mgold/FlashingStockAlert09152006184241PM/FlashingStockAlert.aspx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
Sign In or Register to comment.