Shop OBEX P1 Docs P2 Docs Learn Events
Is there a way to edit the stamp code for commands??? — Parallax Forums

Is there a way to edit the stamp code for commands???

Angela1Angela1 Posts: 25
edited 2009-02-19 01:56 in Robotics
Ok, I am trying to measure the·"time elapsed"·by a laser. Its for obstacle detection. I am confused as to what should be the stamp programming·and·the setup of the·circuits.

I read that the "RCTIME" command (256 of manual) has a similiar relation for to the equation I want to use to calculate the time elapsed:·distance traveled = speed of light * time elapsed. But, can I open the command code in stamp and edit it then save as a new command? Can I swap the resistor and capacitor component for the reciever and speed of light?... I dont know the substition second part or any of it... Do you know how to do this?

By the way, could this even work? When I picture this in my mind I see: a low wavelength laser shoots a light beam, the light hits the object and comes back, the PNP detector receives the signal (can the PNP detector recieve laser light too??) or a photoresistor receives the light, then the circuitry will be similiar to the Basic Stamp Manual v.2.0's figure 5.29a under RCTIME, then I will modify the command to interchange resistance with speed of light & the capacitance is substituted with time elapsed... ? sad.gif

I got the laser and detector part a tiny bit figured out, but I don't know how the approach after the photoresistor part. I don't know how to get the time elapsed vaule until it hits the photoresitor by using stamp nor do I know how to build the circuitry for this. Or am I in the completely wrong direction???... and yes... I waited until the last minute... HAAAAALLP!!!

Comments

  • InSilicoInSilico Posts: 52
    edited 2009-02-18 12:59
    For what you're doing, you should use an ultrasonic sensor, like the·PING))) detector (http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/92/List/1/Default.aspx?SortField=ProductName,ProductName).

    The PING))) detector will detect obstacles, and give you the distance between itself and whatever it's pointing at. They also have code samples to use this device (including the Stamp). The PING))) detector can even be had at some RadioShack stores, so you can obtain it right away. This should suit your needs.

    I'm sorry to say that the·configuration you're proposing will not work. Not because your concept of distance=rate*time is wrong, but because it's not practical. Laser light travels at ~299,792,458 m/s (according to google). That's 670,616,629 mph. So light will travel over 1 meter in about 3.3 nanoseconds. There's no way a Basic Stamp will be able to time the laser light travel - it just isn't fast enough. By comparison, a microcontroller like an SX running at 50MHz (which is really, really fast for a microcontroller) has an execution time of 20 nanoseconds per instruction.

    Do note that GPS systems use your approach to figure out the distance between the GPS receiver and a GPS satellite (which is very, very far), but with radio waves instead of light (technically radio waves and light are the same thing - electromagnetic waves). Even then, they use atomic clocks to time the distance traveled by a radio wave.

    Post Edited (InSilico) : 2/18/2009 1:14:00 PM GMT
  • Angela1Angela1 Posts: 25
    edited 2009-02-18 15:10
    InSilico said...
    For what you're doing, you should use an ultrasonic sensor, like the·PING))) detector (http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/92/List/1/Default.aspx?SortField=ProductName,ProductName).

    The PING))) detector will detect obstacles, and give you the distance between itself and whatever it's pointing at. They also have code samples to use this device (including the Stamp). The PING))) detector can even be had at some RadioShack stores, so you can obtain it right away. This should suit your needs.

    I'm sorry to say that the·configuration you're proposing will not work. Not because your concept of distance=rate*time is wrong, but because it's not practical. Laser light travels at ~299,792,458 m/s (according to google). That's 670,616,629 mph. So light will travel over 1 meter in about 3.3 nanoseconds. There's no way a Basic Stamp will be able to time the laser light travel - it just isn't fast enough. By comparison, a microcontroller like an SX running at 50MHz (which is really, really fast for a microcontroller) has an execution time of 20 nanoseconds per instruction.

    Do note that GPS systems use your approach to figure out the distance between the GPS receiver and a GPS satellite (which is very, very far), but with radio waves instead of light (technically radio waves and light are the same thing - electromagnetic waves). Even then, they use atomic clocks to time the distance traveled by a radio wave.
    Hi, InSilico. Thanks for your reply. tongue.gif

    Ok, I understand. This PING detector looks interesting. For what I am trying to accomplish, you think I need to purchase the sample kit of the PING)))·or get any additional parts or will the product·from your link be enough (I am not trying to make the system to·pan or move or anything.) p.s. I only have the Board of Education RevB kit.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-18 15:32
    The documentation for the PING))) (linked from the webstore page) shows how to hook it up to a Stamp. You'll notice that it doesn't require any additional parts. It can be mounted on the breadboard area of the Board of Education (BOE) and connected with the jumper wires included with the BOE. If you want it to be able to be moved about, consider an extension cable. Parallax sells 3-wire cables for use with their sensors and LCD displays ("LCD Extension Cable") that would work just fine.
  • Angela1Angela1 Posts: 25
    edited 2009-02-18 17:17
    Mike Green said...
    The documentation for the PING))) (linked from the webstore page) shows how to hook it up to a Stamp. You'll notice that it doesn't require any additional parts. It can be mounted on the breadboard area of the Board of Education (BOE) and connected with the jumper wires included with the BOE. If you want it to be able to be moved about, consider an extension cable. Parallax sells 3-wire cables for use with their sensors and LCD displays ("LCD Extension Cable") that would work just fine.
    Ah!
    I was hoping they had some additional resource and downloadable information to read up on. Thanks. Ok, no additional parts *whew*... Thanks so much Mike! This has been a life-saver...
  • GWJaxGWJax Posts: 267
    edited 2009-02-18 20:22
    Also if you need the Ping))) faster than ordering it online, don't forget Radio Shack sells them as well but with a small mark-up, but after you pay the shipping charges you get online this would be much cheaper and you have it in your hands as you walk out the door.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-02-18 23:34
    GWJax said...
    Also if you need the Ping))) faster than ordering it online, don't forget Radio Shack sells them as well but with a small mark-up, but after you pay the shipping charges you get online this would be much cheaper and you have it in your hands as you walk out the door.

    Jax

    Do most of your Radio Shacks carry these? In my area, there's one RS that has a nice little stock of Parallax stuff, and the rest have none at all. Needless to say, I'm a regular at the one that does. I was profoundly shocked to see a RS that was actually _increasing_ its supply of useful electronics parts (they're also the one place that always has the blank PC boards I need).
  • GWJaxGWJax Posts: 267
    edited 2009-02-19 01:56
    Yes all of our MANY RS has them in Jacksonville, FL in the the small cabinets that holds their resistors and other misc electronics, I have found them in the IC bin, Resistor Bin, Cap Bin, ect. and even on display at the main office store. I think they really don't know what place they should be in. If your Radio Shack sells the BS2 homework board kit then they have the rest of the I think 5 other components which I now own Yea!!! We also have 2 Radio Shacks in St Augustine, FL that cater to the hobbiest so alot of the old components are still there to be gotten. I got a set of CoCo computer joysticks for FREE and the Q-Cat bar scanner that did not go off too well in the 80's for FREE as well, Well I have 5 of them now and waiting for some hacking to them he he.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
Sign In or Register to comment.