Shop OBEX P1 Docs P2 Docs Learn Events
appropriate microcontroller — Parallax Forums

appropriate microcontroller

TbagTbag Posts: 31
edited 2005-05-20 16:37 in BASIC Stamp
Please help!

I built a Piezoelectric transmitter and receiver, each attached to Stamp2 pins 0 and 1 respectively.

Goal 1 is to activate the transmitter via HI at Pin 0 and and have the Stamp2 detect a HI at PIN 1 sent by the reciever when it is activated by the transmitter.

Goal 2 is to measure the time from PIN 0 Hi to PIN 1 HI.

Setting aside actual time from transit through the circuit, we have time of flight.

Does any one know how to achive my goal 1 and 2?



confused.gif

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-18 18:22
    Tbag said...(trimmed)
    Please help!
    Does any one know how to achive my goal 1 and 2?
    PING sensor?· And you even save an I/O pin...·· tongue.gif·· Serisouly though, I don't think it's going to be that simple doing it the way you posted.· You going to need circuitry to handle the reception of the return pulse, then activate the Stamp pin.· Then you'll have to calculate the load times for the instructions, and there may be some tolerance issues with doing that on such a timing critical measurement.· Bottom line you will probably need an SX as a co-processor to handle the timing issues.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TbagTbag Posts: 31
    edited 2005-05-18 18:42
    Now I know it ain't simple. shakehead.gif

    Now, the TOF is actually a "pseudo TOF". As long as the load times are constant I just need a constant TOF value between all transmitters and receivers. I am using distance units not acutal distances (make any sense?). Therefor all ofher factors that are constant are ok.

    The hardware is good to go. Calculating load times? SX processor? Uh-oh. Where do I start? Also (please forgive me for asking) do you think a basic to intermediate BASIC Stamp2 student would be better off with an OOPIC for this operation because of its complexity?

    (don't expell me from the forum - I love the Stamp, it has done me right)

    roll.gif

    Post Edited (Tbag) : 5/18/2005 6:47:05 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-18 19:29
    Hello,

    ·· It's not so much about complexity as timing, and the SX can handle that no problem.· Your biggest problem if you're trying to use the stamp, is what reference do you have for timing the delay on the signal?· There is no internal clock to read when you activate the transmitter then read when you receive the pulse to calculate the time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TbagTbag Posts: 31
    edited 2005-05-18 19:54
    Well, thats really the nugget of my question.

    I need a PIC to sequence the transmissions and clock the delays. Would the SX do this with the addition of a timer (SX controls the timer and the sequenceing of the transmissions)?> Can it be software ended PBAsic?
  • edited 2005-05-18 22:37
    Hello,
    ··········· You could try the RCtime command; this would give to a amount back in relation to time.
    ·
    RCtime 1,1,variable

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Stephen Swanson

    Technical Support
    Parallax, Inc.
    sswanson@parallax.com

  • TbagTbag Posts: 31
    edited 2005-05-18 22:50
    Well, OK, I see your point. So instead of measuring TOF I could measure the Piezo input from the receiver in volts. I could change out an ADC0831 to a 16 bit for more accuracy. So my distance units could be in volts. But the issue is still being skirted, some what. I don't think the volt-distance relationship is linear...and there is a lasting effect within the circuit too with a decrease in sampling rate. It would be simpler to measure on/off circuits with a high smapling rate than measuring voltage.

    Question: So if I stayed with the TOF idea, for linearity, would I have to add further circuits to my receiver or transmitter to get the RC time command working?

    Post Edited (Tbag) : 5/18/2005 10:57:59 PM GMT
  • BeanBean Posts: 8,129
    edited 2005-05-18 23:33
    You can program the SX in BASIC with the FREE SX/B compiler that Parallax offers.
    The SX should be able to do everything for you and pass the info to a stamp in whatever format you need.

    What type of signal comes from the receiver ? A pulse ? Multiple pulses ?
    Are you sending and receiving from the same module or different modules ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • TbagTbag Posts: 31
    edited 2005-05-19 03:31
    Bean,

    All great questions.

    The receiver will output a digital waveform pulse.
    I am sending and receiving from different modules.

    The receiver will have a window comparater that will output a digital waveform to a base station flip flop counter when a threshhold signal in the receiver is breached from a transmitter pulse. The time delay calculated in binary. Thats the goal. Ideally the PIC will sequentially trigger 1 transmitter and calculate time delay to 2 receivers at the same time; this should be repeated for transmitters 2 and 3 as above to the same two receivers.

    I am wondering if the SX can cover time delay and sequencing of the several modules I do have and do all the work up to transmitter activation then resuming at comparater output from the receiver - I have everything else in between worked out.

    Do you still think the SX will do?

    T.
  • BeanBean Posts: 8,129
    edited 2005-05-19 11:31
    I still don't quite follow what your doing...Maybe you could draw a little diagram.
    But since we're talking about speed of sound, I think the SX would be more than fast enough.

    From what I understand you have 3 different modules (Base-station, Transmitter, and Receiver).
    Are all the modules hard wired together ?
    Are you trying to measure the distance between the two receivers ? Or from the transmitter to each receiver ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • TbagTbag Posts: 31
    edited 2005-05-19 17:13
    Bean,

    Here is a diagram that should explain. I had trouble sizing it to see the details - look at the one attached all the way to the right.

    "Time" I need calculated can be deviated from true TOF as long as deviations are constant and linear.



    T.

    Post Edited (Tbag) : 5/19/2005 5:25:58 PM GMT
    608 x 556 - 42K
    1000 x 914 - 114K
    1500 x 1372 - 190K
  • BeanBean Posts: 8,129
    edited 2005-05-19 18:25
    Thanks, that helps alot.
    I think the SX would be as good as any for this application.
    You should be able to measure sub-microseconds with a 50MHz SX.

    How much distance between the transmitters and receivers ?
    I assume you are doing triangulation since you have three transmitters ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • TbagTbag Posts: 31
    edited 2005-05-19 19:27
    Yes - traingulation. Distance should be up to 1.5m. Maybe slightly more or less. Working with small volume high accuracy.

    1.Where do you order the SX
    2. does it supplement the BS2
    3. where can I get a 16 bit+ voltmeter kit for either the BS2 or SX (the ADC0831 is too step small) (this is a seperate question from the current discussion)
    4. do you consult regularly

    Thank
    T.
  • BeanBean Posts: 8,129
    edited 2005-05-19 21:10
    T.,
    1)
    The programming kits are on back order from Parallax until 5/27, check some electronic distributors to see if they have it.
    What you want is the "SX-Tech Kit".
    You may want to call Parallax and check on the ETA.

    2) It can. Using serial to communicate back and forth.

    3) I'll have to check and get to back to you.

    4) Yes, please send me a private message using the "PM" icon on the left.

    Bean.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • TbagTbag Posts: 31
    edited 2005-05-20 03:23
    There is a tool kit lite and a tool kit plus. Which do you suggest?

    T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-20 04:41
    Hello,

    ·· The SX Tech Tool Kit PLUS is only $99.00 right now.· But is currently back-ordered until the 27th.

    http://www.parallax.com/detail.asp?product_id=45181



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BeanBean Posts: 8,129
    edited 2005-05-20 10:45
    The difference is tha the PLUS includes a very good book by Guenther.
    I would recommend getting the PLUS version.
    Don't forget to order a power supply also...
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    Product web site: www.sxvm.com

    "It's not getting what you want, it's wanting what you've got."
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-05-20 15:37
    Hello,

    ·· You should make sure the supply is 7.5V and at least 1A.· We have these.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • TbagTbag Posts: 31
    edited 2005-05-20 16:37
    Thanks folks. I'll order up.


    T.
Sign In or Register to comment.