Shop OBEX P1 Docs P2 Docs Learn Events
Need a precision timer — Parallax Forums

Need a precision timer

jtaylor408jtaylor408 Posts: 15
edited 2009-02-26 05:09 in BASIC Stamp
I'm doing a project where I am sending signal using the 433 MHz RF transmitter and then having another board receive the signal and send one back to the transmitter(there is receiver on that board as well) So basically I am pinging the board and i want to measure the time it and from that be able to calculate the distance away. Will the 555 Timer IC CMOS do the trick or is there another timer that I will need.

Comments

  • JonathanJonathan Posts: 1,023
    edited 2009-02-19 00:55
    If I understand what you want to do, there is no timer available that will be fast enough. RF travels at the speed of light, so the flight time over short distances is very difficult to measure. The laser based tape measures and such use phase shift, not a timer, to detect range.

    You can do what you are talkign about with sound easily enough, but not RF.

    Sorry if I don't get what you mean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-19 01:41
    Given what you said, is there anything I can uses that is compatible with parallax that will travel at a slower speed and make it easier to use a timer?
  • SRLMSRLM Posts: 5,045
    edited 2009-02-19 01:44
    jtaylor408 said...
    Given what you said, is there anything I can uses that is compatible with parallax that will travel at a slower speed and make it easier to use a timer?

    A robot...
  • Craig EidCraig Eid Posts: 106
    edited 2009-02-19 01:52
    Although electricity flows at the speed of light, the communication path you are referriing to is far slower due to the limitations of the Stamp and Linx chipset. The Linx chipset operates at a maximum speed of 9600 baud while the Stamp is limited to a few thousand instructions per second. The SX chip would be·a much better choice for measuring the response time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Craig Eid

    www.TriadRD.com
  • JonathanJonathan Posts: 1,023
    edited 2009-02-19 03:56
    He is talking about measuring distance, not response time. There is no way to use an SX or other chip to measure short distances this way. From here to the moon, sure.

    Jtaylor, what exactly are you trying to do? I have done something similar to what you are talking about using ultrasound, in a navigational system I have been building on and off for a while. Basically I have an RF setup like you describe. My bot sends an RF command to the the second unit, which I call a beacon. When it recieves the command, it emit a burst of ultarsound. My bot has an ultrasound reciever, and it measures the length of time it takes to get the sound. Subtract the processor overhead that was mentioned above, divide by the speed of sound, and you have the distance. I have three beacons, and the idea is to be able to triangulate a position. So, in essence I am measuring the distance using ultrasound between three fixed points, and using that as a basis for a relative positioning system.

    Anyway, tell us what you are trying to acomplish, and maybe we can help more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-19 04:18
    What I want to do is build a robot that can find avalanche victims. The victim will have a tranceiver on them and the robot will have another one on it. The robot will send a signal out to the victim and the the victims transmitter will send a signal back. The robot will measure the time it takes for the whole process and using that measure the distance between them. Ultrasound won't work since it won't penetrate the snow very well. The standard frequency for such uses in snow is 433 kHz but I am limited to a stamp. Any suggestions?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-19 04:47
    You can't do it with a Stamp or with the transceivers you want to use. The time intervals are just too short and the response times of the Stamp and of the transceivers is too long. You could design special transceivers and precise external timing circuitry to do the measurements and have the Stamp interpret the data once the raw timing was done, but that's it.

    Think about the times involved. You have signals traveling roughly at the speed of light. That's roughly one nanosecond per foot. If your transceiver is buried under 20 feet of snow, you've got a round trip travel time for the signal of only 40ns and that assumes that the buried transceiver can echo the signal instantaneously, something likely to be accomplished only with a reflector, not an active device like a transceiver.

    Post Edited (Mike Green) : 2/19/2009 4:58:20 AM GMT
  • JonathanJonathan Posts: 1,023
    edited 2009-02-19 04:51
    I think that most climbing system use a simple signal strength method. It doesn't give an exact distance, just when tells you if you are getting closer or farther. It can't give range, as different snow types and compaction will make a differnece, as will locaton of the transmitter (in a pocket, under the body) etc.

    The Parallax RF units I have have a signal strength indicator pin, but if I recall it is not actually implemented or something, I may well be wrong. If it does work, then measuring the signal strength will probably be your best option. If not, building an RF detector would be the next thing I guess.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-20 06:12
    I think you meant 433MHz rather than 433KHz.·

    If I were doing this I'd use a direction-finder rather than a distance-measuring transponder.· With angular measurements from different places you can triangulae to get the distance and the actual location.

    Of course, I'm biased in that directiion because I'm currently building just that -- a radio directiion finder.· It'll work at 433 MHz, too, although I won't be working at that particular frequency.

    Incidentally, though, transceivers for distance measurement are old hat.· Old-fashioned DME in airplanes measures in feet, not miles --·the circuitry is reasonably fast.· But it can be done.

    Consider:· to measure a ten-foot distance, you get a 20-ns transmission delay (two ways), plus the delay in the transceiver and in your own equipment.· For ten-foot accuracy you count at 50 MHz (20 ns per count), which is easy.· Also you design your transponder to have a constant, known delay, and account for it in calibration.

    But a Stamp is too slow.· So is a Propeller, I think.· The solution?· Use a fast counter to do the counting, and a Stamp or Propeller to do the controlling, calculating, and displaying.

    A 75HC93 ripple counter can count at 100 MHz.· Other families (7493, 74LS93, 74HCT93, etc.) can't go as fast and wouldn't do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net

    Post Edited (Carl Hayes) : 2/20/2009 7:08:13 AM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-20 06:54
    Thinking about it some more:

    The system has two parts:· an inquirer (the thing you carry around while looking for a lost guy), and a responder, or transponder (the thing you hope the lost guy remembered to put batteries in).

    The responder has a very simple job.· Here's what it does:

    · (1) Listens for a ping from the inquirer
    · (2) When it hears a ping, responds with a ping of its own after a fairly long interval.

    What's that "fairly long interval" for?· It's time for the inquirer to stop transmitting and start listening.· This is easy to do slowly (a couple of milliseconds) but hard to do fast (a couple of microseconds).· So let it do it slowly.· The transponder's "fairly long interval" should always be precisely the same, within a nanosecond or so, but need not be especially short.· That's not too tough.

    The transponder, by the way, doesn't need any computers in it because its job is so simple.· That's good, because computers are too slow.· And any transceiver designed for use with a Stamp will be too slow, too.· Design one for the specific task.

    What is the inquirer's job?· It's a little tougher, but not much, and a microcomputer can be a help.· The inquirer's job is:

    ·· (1) Clear the counter.
    ·· (2) Open a gate to send clock pulses (at perhaps 100 MHz) to the counter.
    ·· (3) Send an inquiring ping, whose delay from counter-start is precisely known and always the same.
    ·· (4) Listen for an answering ping, and stop the counter precisely, after it is received.
    ·· (5) after a while, stop the counter anyway.· It'll have a max count that tells you "no answer".
    ·· (5) Read the counter contents.

    The computer knows how much time the various built-in delays add up to.· It subtracts this constant delay·time from the counter contents and thus it knows whether an answer was heard and how far away the transponder is.

    How does the computer know the built-in delays?· After you built the thing, you ran some experiments.

    There!· Wasn't that easy?· Now go out and build it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net

    Post Edited (Carl Hayes) : 2/20/2009 7:06:26 AM GMT
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-20 07:06
    That is a very helpful suggestion but I am limited to a stamp or other cheap items. I was curious if you can wire up a transmitter and receiver not made by parallax to the basic stamp board and still program it with BASIC. Parallax just does not offer the things I need. If there are any low speed transmitters out there that are compatible with the Stamp, I think those would be best.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-20 07:15
    From your comment, it seems that you still don't understand the kind of short time intervals we're talking about. Even Carl's suggestion requires precision in the timing of the response and the measurement of the the timing of the response. This kind of precision doesn't come cheap. There are all sorts of low speed transmitters out there that could be used with a Stamp, but not to do what you need.
  • SRLMSRLM Posts: 5,045
    edited 2009-02-20 07:22
    @ Carl

    Will a 74HC4040 work instead of the 75HC93? I tried looking around for the 75HC93, but couldn't find anything. The 74HC4040 operates a maximum frequency of 90 MHz, so I'd assume that it's not as precise as the 75HC family. Is this an accurate assumption?

    Here's the link to a product page.

    As a side note, these chips are really cheap. You can probably get them for $1.00 a piece (with S&H).

    Edit: more searching, and these chips go up to 101 MHz, but are not in stock. These chips go up to 99 MHz, and are on sale!

    Post Edited (SRLM) : 2/20/2009 7:33:21 AM GMT
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-20 07:25
    The standard for an avalanche transceiver is 457 kHz, and travels much slower than the speed of light. If i can get a transmitter that transmits at that frequency and use that to ping, I think it will be bit more feasible
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-02-20 10:40
    jtaylor408 said...
    The standard for an avalanche transceiver is 457 kHz, and travels much slower than the speed of light. If i can get a transmitter that transmits at that frequency and use that to ping, I think it will be bit more feasible

    (At the risk of revealing my own ignorance, I write[noparse]:)[/noparse]

    What travels much slower than the speed of light? Not the radio waves sent out by the device. Changing the frequency of a radio device doesn't change the speed at which the radio waves propagate. Unless I'm seriously mistaken, if you're using radio, your signals are moving at the speed of light. In fact those standard avalanche beacons don't work by measuring timing at all, but use a completely different system:

    www.telemarkski.com/html/how_beacon_select.html

    You're not going to get around the basic fact that the travel time of your radio waves is going to be too short to be measured directly by a Stamp. But judging from the information on that page, you might still be able to build a Stamp-based system that works like real avalanche beacons work. You'll just have to learn something about those "flux lines" and antennas and forget about measuring the signals' travel time.

    Post Edited (sylvie369) : 2/20/2009 10:57:47 AM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-20 17:06
    SRLM said...
    @ Carl

    Will a 74HC4040 work instead of the 75HC93? I tried looking around for the 75HC93, but couldn't find anything. The 74HC4040 operates a maximum frequency of 90 MHz, so I'd assume that it's not as precise as the 75HC family. Is this an accurate assumption?

    Here's the link to a product page.

    As a side note, these chips are really cheap. You can probably get them for $1.00 a piece (with S&H).

    Edit: more searching, and these chips go up to 101 MHz, but are not in stock. These chips go up to 99 MHz, and are on sale!
    Sure.· Any counter tht will count fast enough, will count fast enough.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-20 17:12
    jtaylor408 said...
    The standard for an avalanche transceiver is 457 kHz, and travels much slower than the speed of light. If i can get a transmitter that transmits at that frequency and use that to ping, I think it will be bit more feasible
    Must be ultrasound, not radio.· For ultrasound, my ignorance is almost total -- but I do know that everything runs about 270,000 times as slow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-02-20 18:22
    It seems to me like Carl's project would be a good starting point for this. It would require at least one more transciever and the use of directional antenna arrays.
  • achilles03achilles03 Posts: 247
    edited 2009-02-20 22:20
    Using some sort of digital wireless transmission is probably NOT the way to go. Rangefinders that use radio waves use some novel techniques, some of which are analog based. I would consider reading up on those techniques instead of trying to go down a digital path which will likely be a dead end.

    Dave
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-21 05:43
    achilles03 said...
    Using some sort of digital wireless transmission is probably NOT the way to go. Rangefinders that use radio waves use some novel techniques, some of which are analog based. I would consider reading up on those techniques instead of trying to go down a digital path which will likely be a dead end.

    Dave
    Who's talking about digital wireless?· Nothing in what I propose is digital, except the control stuff and the counters.· The radio part is all normal radio stuff.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-21 06:40
    So it comes down to needing a low speed signal that can go through snow. Any ideas?
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-02-21 11:57
    jtaylor408 said...
    So it comes down to needing a low speed signal that can go through snow. Any ideas?

    No, it comes down to either using something capable of doing the timing speeds required (like Carl is suggesting in his reference to DME) or a different, non-timing based system like RDF with triangulation (Carl's other suggestion) or the flux line system that commercial avalanche beacons use.

    The only low speed signal suggested in this thread was ultrasound (again, in one of Carl's posts, and Jonathan's project). I guess that might be fruitful, but I'll bet there's a reason it's not already used. Take a look at how the Ping))) sensor works: it simply measures time for a known signal to be reflected back from an object. But you're not trying to detect "an object", you're trying to locate _a particular object_. Bouncing sound waves around won't do you any good unless there's a device on the other end capable of detecting the specific sounds you're sending, picking them out from the ambient sound, and then transmitting its own specific sounds in response (again, after a carefully measured, known delay, though with sonic speed waves this will be much easier than with light speed waves, and perhaps negligible).

    Will this kind of thing work when the object you're trying to locate is buried in snow? I have my doubts. How powerful will that sound need to be to go through the snow and also be picked out against the background sounds of wind up in snowy mountain country? Using ultrasound might move the to-be-detected sound out of the background noise spectrum so that it can be easily picked up, so that part might be okay. Will the sound it needs to give off produce additional avalanche risk? I have no idea, but it's an important consideration. Will the sound-producing part be small enough that a skier would be willing to carry it? How large and powerful will it have to be to give useful range? How large will the detecting part of it be (the part that detects the ultrasound the searcher is emitting)? And finally, once you've got something that gives off that much sound, why not just issue audible pull-pin alarms and earplugs?

    Frankly it sounds to me like you're still hoping that there'll be some kind of low-speed radio that you can use along the lines of your original question. You need to stop hoping for that. The only low-speed signal suggestion you've gotten here was ultrasound, which is not radio at all, and which has a different set of challenges. Commercial 457 KHz avalanche beacons use radio, but not some kind of magical low-speed radio. They use normal radio waves that travel at the speed of light, but use them in a way that does not involve measuring travel time.

    Post Edited (sylvie369) : 2/21/2009 12:16:49 PM GMT
  • JonathanJonathan Posts: 1,023
    edited 2009-02-21 15:42
    Also, not be a downer but...

    Finding avalanche victims has to happen fast, or else the "rescue" turns into what is called a "recovery" (ie finding the dead body). Lugging a 'bot to do so around isn't going to happen. Weight considerations aside, I'd rather have a monkey (human)with a hand held unit and a shovel looking for me. Before I blew out my knee I was an avid climber in the Sierra's (I live in CA) and have participated in a couple of rescues (not from avalanches, lost or stuck folks). While I have carried and been trained to use a victim locater, I've never (thank goodness *knocks on wood*) had to use one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-02-21 17:59
    Brief research reveals that there is a standard technology for avalanche beacons.· They are not UHF devices and they are not ultrasound devices.

    An avalanche beacon basically creates a detectable modulated·magnetic field at 457 KHz.

    Parenthetical note:· this is not an electromagnetic field, although it is a magnetic field created by an electromagnet.· Much confusion is caused by misuse of the term electromagnetic field.· An electromagnetic field is a radio wave (or light wave, or xray wave, etc.) traveling through space.· A stationary magnetic field, even if it is created by an electromagnet, is not an electromagnetic field.· The error is common enough to caution against -- I even saw it in an article in this month's Elektor magazine (in an article by someone whose native language is not English, so it's not a foolish error).

    An avalanche beacon creates a stationary, modulated magnetic field at a standard frequency, and is typically capable also of detecting and indicating the directiion of such a field.· The person hidden in the snow turns his beacon on to create a field, and the searcher turns his beacon on, set to detect the field.· The searcher then follows a curved path (along the flux lines of the field) and eventually (soon, we hope) reaches a position at which the flux lines point down into the snow.· Then he digs.

    All of our discussion has centered on (1) use of UHF radio waves, or (2) use of ultrasound.· Can either of these travel through several feet of snow?· You think so?· I am in doubt.· Will you bet your life on it?· I think we've spun our wheels without useful result.

    If other people, whom you may wish to find in the snow -- or who you hope can find you in the snow -- are carrying a standard kind of avalanche beacon, I have to say I think it would be foolhardy to carry anything else.

    Therefore I recommend against any UHF radio approach (including the one I suggested in earlier posts)·and against any ultrasound approach.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • jtaylor408jtaylor408 Posts: 15
    edited 2009-02-24 05:35
    I have come up with an that i think will work. I want to use a speaker and a microphone as my "tranceivers". I will then be able to use a timer since I will be dealing with much larger times. To counteract the fact that the some of the sound will bounce off the snow, the speakers on each board will be playing a different frequency so the microphones will only be searching for a specific frequency.
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-02-26 05:09
    Interesting reading, from RADAR to magnetic beacons!
    It is apparent that the BS (quite expectedly) is not capable of range finding by itself.
    However, the whole concept of trying to find a magnetic beacon distance seems futile using one receiving device (around 433MHz in ping - wake up and reply - mode). It seems that if one is buried under snow and other debris (which this discusuion didn’t consider) and has avalanche magnetic beacon operating (!) than the rescue approach should be using multiple beacon detection. This is where BS should come to play – analyzing these detected signals and calculating the distances / direction from each detector.
    BTW I would be interested to see a schematic of the avalanche magnetic beacon – so far no luck on the web. I found some 3 axis magnetic field detectors with strange DC to 1KHz “response characteristic”. What is that? How do you get to 433 kHz modulated magnetic field?

    Cheers
Sign In or Register to comment.