Ping sensor - apparently not working
Hi folks
This is my first posting and I need some help with the ping sensor. I am using it on an ARobot, BS2.
I downloaded the demo software from Parallax and programmed the uController.· The green light on the ping sensor is on continuously and the debug window shows only 0 for all three measurements.
Anyone have any ideas????
Bob
This is my first posting and I need some help with the ping sensor. I am using it on an ARobot, BS2.
I downloaded the demo software from Parallax and programmed the uController.· The green light on the ping sensor is on continuously and the debug window shows only 0 for all three measurements.
Anyone have any ideas????
Bob
Comments
·· Where is the PING sensor plugged in?· How is it being powered?· Do you have a common ground with the BS2?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I have the expansion output from ARobot plugged into a breadboard.·The 5V and gnd for the ping are connected to these and the signal is pin 15.
I have no scope, so can't tell if a trigger pulse is being sent, however, my voltmeter reads close to 5 volts between the ping ground and 5V pins.
Bob
·· Do you have a Board Of Education, or something similar you can plug the PING into to verify function?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Is there anyway to find out that a trigger pulse is being sent to the ping sensor?
When I get home tonight, I plan to use a·different pin and see if that works.· Naturally I will alter the software to match the pin assignment.
I know the power and other connections to the breadboard are working as I also just experimented with the emic module and it works fine...· Also very nice and easy to use but I need a bigger speaker.
To power the ping modulel,· I am using the ARobots 5 V supply, not one of the stamps pins.· I do measure 5 volts at the 5V pin.· Additionally, duing these tests, no other devices (servos etc.) are being powered.
Bob
From what little I could find in details about the ARobot's primary electrical system, it appears to me that the expansion board has three sources of DC power. One is RAW, incoming power from the prior stage, the second is labelled CLEAN power. The third is REGULATED +5 VDC coming straight from a 7805 right on the expansion board. The input to the 7805 is the RAW power mentioned above. The 7805 should be easily able to handle one amp (1000 mA), IF the RAW power input is also so capable.
Which of these sources of power are you using for the Ping board, or are you getting it from somewhere else?
Just one other thought. In the PBASIC program, place the following line at the beginning of the program, after any compiler directives, but before any executable code:
DEBUG "Starting"
If you see the message "Starting" more than once during any single operation of the PBASIC program, the Stamp is being reset for some reason.
Regards,
Bruce Bates
Thanks for the info... When I get home I will try the software suggestion. Since I am new to the Ping sensor, when it's connected and I run the program, the green led stays on. Is that correct?
However, looking at the schematic, the +5V supply that is made available on the expansion port comes from the regulated output of the 7805. The Raw DC is sent to the H-bridge and the clean DC looks like it powers the BSII at pin 24. The servos, drive wheel encoder and onboard LEDs are also powered by the +5V from the regulator.
As I said earlier though, in the ping test program, there are no other drains on the regulated supply voltage as no drive wheels or servos are active or used.
So, the stamp is not resetting... I even tried placing it in various spots, prior to actual main program with the same results.
I also tried changing the ping pin assignment from 15 to 0 and also to 3 with the same result.
Additionally, I tried stopping the ping demo program at the get sonar subroutine to see if I could get some readout of the "rawDist" variable.· Just after the pulsin command, I get dec 0.· this is before any scaling etc.· I tried it after scaling and again after the divide by 2 expression and all of the report 0.·
It appears the ping module is not measuring the echo pulse.
I did do something else.· Again in the get sonar routine, I changed the pulsin pin to something other than the pulsout pin.· When I run this program, the ACK led on the Ping module proceeds to blink in sync with the Rx light in the debug window.· All the readings are zero though.·
Could there be something wrong with the scaling factors???
Could the Ping module be "bad"?·· and how could I tell???
This is the get sonar subroutine....· Ping is the pin assignment
Get_Sonar:
· Ping = IsLow································· ' make trigger 0-1-0
· PULSOUT Ping, Trigger························ ' activate sensor
· PULSIN· Ping, IsHigh, rawDist················ ' measure echo pulse
· rawDist = rawDist */ Scale··················· ' convert to uS
· rawDist = rawDist / 2························ ' remove return trip
· RETURN