Laser Ping operation question
frank freedman
Posts: 1,983
in Propeller 1
Not sure I am doing this right, but here is what I am driving a laserPing for testing:
the for something to do is a place holder for whatever I will do to measure the pulse width. No pulse comes back. Even switched to input so that nothing could be loading the output pin. Same behavior at 3 or 5V
If I plug in a standard PING module, then I see the pulse followed by another which varies with object to ping distance as expected.
Thanks,
Frank
Hopefully someone will say try X and here is what you did wrong rather than a non-functional laserPing.
pub Pulse_Laser dira[12] := 1 outa[12] := 0 repeat outa[12] := 1 outa[12] := 0 dira[12] := 0 waitcnt(clkfreq/1375 + cnt) ' for something to do waitcnt(clkfreq/5 + cnt) dira[12] := 1This gives me a 7us pulse with a .5 second repetition rate. The 1375 value (yes, I know evil magic number. but this is only for testing) gives about a 750us delay after which I should see a pulse out of the laserPing.
the for something to do is a place holder for whatever I will do to measure the pulse width. No pulse comes back. Even switched to input so that nothing could be loading the output pin. Same behavior at 3 or 5V
If I plug in a standard PING module, then I see the pulse followed by another which varies with object to ping distance as expected.
Thanks,
Frank
Hopefully someone will say try X and here is what you did wrong rather than a non-functional laserPing.
Comments
Mike
It works both ways. It does work like a normal Ping AND it can use a serial connection.
The timing i am getting was observed using an AD2 in scope mode.
Thx
FWIW, I jumpered mine for continuous serial and it works fine.
I bought one of these recently and initially tried getting it working and failed, without noticing on the product page that it is supposed to be drop-in compatible with the Ultrasonic PING. I know from above you're aware it's compatible (not when in serial mode), but I was curious if you've tried any existing objects for the original ultrasonic ping? The driver/demo included with the PropTool library worked straight away for me.
Cheers
Mine also worked fine with Ping code before I modified it for continuous serial output.
@"Duane Degn" starting to try the demo you mentioned, but may have to butcher it up a bit to use serial port rather than serial LCD. Still think it's dead though.
I think this could be the code: https://www.parallax.com/downloads/ping-ultrasonic-distance-sensor-propeller-code
Wire this up as explained in the comments at the top of the code file. The two LEDs could be left out for testing, just the LaserPing connections needed; Signal, 3.3V and Ground.
This should work for a Ping or LaserPing. And you should be able to drop either into the same circuit and see the output on the parallax serial terminal set to 9600 baud.
Make sure you power off/on the ping/laserping and propeller board after changing the device. (probably not critical for ping, but laserping only decides it's mode at power-up AFAIK, so if you don't see the output you expect, powercycle everything!)
If the LaserPing fails to output in default PWM mode using unmodified Parallax code sample then it could be faulty- and in that case I'd suggest you contact support@parallax.com with your sales order number to request a replacement. I'm flagging your issue over to the support desk in-case you contact them, so they'll be aware of the details and save you time re-explaining!
Test fixture listed prior entry on this thread works as expected. There is a bit more variation for a fixed distance than I had expected. Not sure why.
Im curious about this, as I do not have a laser ping yet.
Is the variation similar to a accellerometer? where the values fluctuate a bit even if no movement is going on?
Is this variation so small that it will not matter?
(like if you move the target 1cm away from the laser ping, does the change in the pings output change way more than the variation?)
I guess this is the devices hysteresis in a sense?
I am wondering because I was thinking of using a laser ping to read a stream of data from a block of wood with specific notches cut out to represent a serial data stream with start bit, stop bit and data.
https://forums.parallax.com/discussion/168010/laserping-released-details-are-here/p1
You can do some statistic analysis (gaussian fit) on the returned data and get some decent results.
Trying to measure the time of flight of light has got to be a lot less precise than measuring time of flight of sound. It still seems like Voodoo magic a sensor as small as the LaserPing can measure time of flight of light.