Multiple PING)) Sensors
In my project, I'm using 6 PING)) directed NW-NE-W-E-SW-SE. After a while I realized that they somehow stop receiving signals. When I connect them to power, the lights on top of them still work, but I only get furthest distance.
The possibilities that I thought of are;
1 - Too much power: my source gives 5V all the time, so I don't think that's the case... Also the last one stopped working while it was connected to 5V-out of BS2.
2 - They jam each other: I don't know if this is possible...
3 - Something got wrong with the receivers or signals: I don't know how to check that...
So what could it be? Any of the reasons that I thought of or something else? Also is it possible to fix them somehow?
PS: This is getting costly since I've trashed 7 sensors up until now...
The possibilities that I thought of are;
1 - Too much power: my source gives 5V all the time, so I don't think that's the case... Also the last one stopped working while it was connected to 5V-out of BS2.
2 - They jam each other: I don't know if this is possible...
3 - Something got wrong with the receivers or signals: I don't know how to check that...
So what could it be? Any of the reasons that I thought of or something else? Also is it possible to fix them somehow?
PS: This is getting costly since I've trashed 7 sensors up until now...

Comments
If you connect them to a higher voltage (much above 6V), it's possible to burn them out.
2) If you pulse more than one at a time, they can interfere with each other. Usually that would cause a false "close" reading.
3) They're pretty reliable. How do you have them connected?
I’ve never heard of anyone damaging the PING))) Sensor except for when connecting too much voltage to them (usually using VIN for power). Which BASIC Stamp and development board are you using?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
2 -·Can that cause a permanent damage? Now even if I try them one by one, all I get is
Time (uS)......9751
Inches ........132
which is supposed to be
Time (uS)......1207
Inches ........16
3 - What do you mean by how I connected them? They are soldered to the board on a line, and the 5V is applied to the line. I checked if they all get 5V and I'm positive on that too.
BS2 for sensors right now.
Switched to another BS2 to check if the problem was with the stamp, it's all the same.
I'm running the single working one throught the 5V-out of the stamp, right now, and there seems to be no problem (scared to plug the other ones, but I'll plug them one by one... Hope they'll be fine...)
Post Edited (bgul) : 5/29/2007 6:10:37 PM GMT
Each one has a three-pin connector. That's +5 DC, Ground, and Signal. You can connect the Grounds together, and the +5 together. But each 'Signal' pin has to go to a separate pin of the BS2. And the 'Ground' of the Pings MUST be tied to the ground of the BS2. The +5 of the PINGs does not have to be tied to the BS2. Putting a 10 to 100 uF capacitor between Ground and +5 is also a good idea to filter out noise.
You then use "PULSOUT" followed by a "PULSIN" for each one -- you can't interleave these, or the sound from one Ping will be recieved from another Ping, and your distances won't be accurate.
You can't power the Ping from a BS2 I/O pin -- I hope that's not what you're doing.
I think that was the problem with first 4. But it still happened after I tied all the grounds together.
About the schematic... For signals I had different cable for each. I just draw the first sonar. Think it as there were 6 of them... (Everything is pretty basic.)
I think the code is straight forward.
' {$STAMP BS2} ' {$PBASIC 2.5} ' {$PORT COM1} 'Set Pins to input i VAR Byte DIR0 = 1 DIR1 = 1 DIR2 = 1 DIR3 = 1 DIR4 = 1 DIR5 = 1 DIR6 = 1 DIR7 = 1 Sonar1 PIN 2 'Front right Sonar2 PIN 3 'Front left Sonar3 PIN 4 'Back right Sonar4 PIN 5 'Back left Sonar5 PIN 6 'Back left Sonar6 PIN 7 'Back left Trigger CON 5 'trigger pulse = 10 uS Scale CON $200 'raw x 2.00 = uS RawToIn CON 889 '1 / 73.746 (with **) RawToCm CON 2257 '1 / 29.034 (with **) IsHigh CON 1 'for PULSOUT IsLow CON 0 rawDist1 VAR Word 'raw measurement of the front right sonar rawDist2 VAR Word 'raw measurement of the front left sonar rawDist3 VAR Word 'raw measurement of the back right sonar rawDist4 VAR Word 'raw measurement of the back left sonar rawDist5 VAR Word 'raw measurement of the back left sonar rawDist6 VAR Word 'raw measurement of the back left sonar First_inches VAR Word 'distance in inches of the front right sonar Second_inches VAR Word 'distance in inches of the front left sonar Third_inches VAR Word 'distance in inches of the back right sonar Forth_inches VAR Word 'distance in inches of the back left sonar Fifth_inches VAR Word 'distance in inches of the back left sonar Sixth_inches VAR Word 'distance in inches of the back left sonar Reset: DEBUG CLS, "Parallax PING))) Sonar", CR, ' setup report screen "======================", CR, CR, "Time (uS)...... ", CR, "Sonar1 ........ ", CR, "Sonar2......... ", CR, "Sonar3 ........ ", CR, "Sonar4......... ", CR, "Sonar5......... ", CR, "Sonar6......... ", CR MAIN: GOSUB Get_Sonar1 'new 'running PAUSE 50 'GOSUB Get_Sonar2 'new 'running PAUSE 50 'GOSUB Get_Sonar3 'old 'not working PAUSE 50 'GOSUB Get_Sonar4 'old 'not working PAUSE 50 'GOSUB Get_Sonar5 'new 'not working PAUSE 50 'GOSUB Get_Sonar6 'new 'running PAUSE 50 First_inches = rawDist1 ** RawToIn ' convert to inches Second_inches = rawDist2 ** RawToIn 'convert to inches Third_inches = rawDist3 ** RawToIn ' convert to inches Forth_inches = rawDist4 ** RawToIn 'convert to inches Fifth_inches = rawDist5 ** RawToIn 'convert to inches Sixth_inches = rawDist6 ** RawToIn 'convert to inches DEBUG CRSRXY, 15, 3, ' update report screen DEC rawDist1, CLREOL, DEC rawDist2, CLREOL, DEC rawDist3, CLREOL, DEC rawDist4, CLREOL, DEC rawDist5, CLREOL, DEC rawDist6, CLREOL, CRSRXY, 15, 4, DEC First_inches, CLREOL, CRSRXY, 15, 5, DEC Second_inches, CLREOL, CRSRXY, 15, 6, DEC Third_inches, CLREOL, CRSRXY, 15, 7, DEC Forth_inches, CLREOL, CRSRXY, 15, 8, DEC Fifth_inches, CLREOL, CRSRXY, 15, 9, DEC Sixth_inches, CLREOL GOTO MAIN START: PAUSE 100 IF IN0 = 1 AND IN1 = 1 THEN BOTHDETECT IF IN0 = 1 THEN LEFTDETECT IF IN1 = 1 THEN RIGHTDETECT IF rawDist1<25 THEN RUN90LEFT IF rawDist2<25 THEN RUN90RIGHT IF rawDist3<25 THEN RUNLEFT IF rawDist4<25 THEN RUNRIGHT GOTO START 'BA98 '0000 CLEAR (GO STRAIGHT) '0001 LEFT DETECT (OBSTICLE) '0010 RIGHT DETECT (OBSTICLE) '0011 BOTH DETECT (OBSTICLE) '**************************** '0100 RUN 90 LEFT (PREDATOR RIGHT) '0101 RUN 90 RIGHT (PREDATOR LEFT) '0110 RUN LEFT (PREDATOR BACK RIGHT) '0111 RUN RIGHT (PREDATOR BACK LEFT) CLEAR: DEBUG "STRAIGHT", CR LOW 8 LOW 9 LOW 10 ' LOW 11 PAUSE 25 GOTO START LEFTDETECT: DEBUG "LEFT DETECT", CR HIGH 8 LOW 9 LOW 10 ' LOW 11 PAUSE 25 GOTO START RIGHTDETECT: DEBUG "RIGHT DETECT", CR LOW 8 HIGH 9 LOW 10 ' LOW 11 PAUSE 25 GOTO START BOTHDETECT: DEBUG "BOTH DETECT", CR HIGH 8 HIGH 9 LOW 10 ' LOW 11 PAUSE 25 GOTO START RUN90LEFT: DEBUG "RUN 90 LEFT", CR LOW 8 LOW 9 HIGH 10 ' LOW 11 PAUSE 25 GOTO START RUN90RIGHT: DEBUG "RUN 90 RIGHT", CR HIGH 8 LOW 9 HIGH 10 LOW 11 PAUSE 25 GOTO START RUNLEFT: DEBUG "RUN LEFT", CR LOW 8 HIGH 9 HIGH 10 ' LOW 11 PAUSE 25 GOTO START RUNRIGHT: DEBUG "RUN RIGHT", CR HIGH 8 HIGH 9 HIGH 10 ' LOW 11 PAUSE 25 GOTO START 'SUB FUCTIONS Get_Sonar1: Sonar1 = IsLow ' make trigger 0-1-0 PULSOUT Sonar1, Trigger ' activate sensor PULSIN Sonar1, IsHigh, rawDist1 ' measure echo pulse rawDist1 = rawDist1 */ Scale ' convert to uS rawDist1 = rawDist1 / 2 ' remove return trip 'rotate 90 left RETURN Get_Sonar2: Sonar2 = IsLow ' make trigger 0-1-0 PULSOUT Sonar2, Trigger ' activate sensor PULSIN Sonar2, IsHigh, rawDist2 ' measure echo pulse rawDist2 = rawDist2 */ Scale ' convert to uS rawDist2 = rawDist2 / 2 ' remove return trip 'rotate 90 right RETURN Get_Sonar3: Sonar3 = IsLow ' make trigger 0-1-0 PULSOUT Sonar3, Trigger ' activate sensor PULSIN Sonar3, IsHigh, rawDist3 ' measure echo pulse rawDist3 = rawDist3 */ Scale ' convert to uS rawDist3 = rawDist3 / 2 ' remove return trip 'make left RETURN Get_Sonar4: Sonar4 = IsLow ' make trigger 0-1-0 PULSOUT Sonar4, Trigger ' activate sensor PULSIN Sonar4, IsHigh, rawDist4 ' measure echo pulse rawDist4 = rawDist4 */ Scale ' convert to uS rawDist4 = rawDist4 / 2 ' remove return trip 'make right RETURN Get_Sonar5: Sonar5 = IsLow ' make trigger 0-1-0 PULSOUT Sonar5, Trigger ' activate sensor PULSIN Sonar5, IsHigh, rawDist5 ' measure echo pulse rawDist5 = rawDist5 */ Scale ' convert to uS rawDist5 = rawDist5 / 2 ' remove return trip 'make right RETURN Get_Sonar6: Sonar6 = IsLow ' make trigger 0-1-0 PULSOUT Sonar6, Trigger ' activate sensor PULSIN Sonar6, IsHigh, rawDist6 ' measure echo pulse rawDist6 = rawDist6 */ Scale ' convert to uS rawDist6 = rawDist6 / 2 ' remove return trip 'make right RETURN▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I updated the file with labels, it's better this way. Anyways, I connected 5 together on the breadboard and they are working fine right now. They get the power from +5V of the BS2. I checked them all and they are getting enough power (4.94 average).
I guess the problem was not connecting them to the ground of BS2 (the last one is still a mystery though).
Thanks to everyone that helped me to figure it out.
It's also possible for the Ping sensor to 'brown-out' the BS2 briefly (for a millisecond or so), by briefly pulling too much current and 'drawing down' the output voltage. There's a voltage comparator on the BS2 which will reset the BS2 in that case.· Note you can't measure this 'brown-out' voltage with a multi-meter, it would take an oscilloscope to see it.
If this is true, it's very simple (and inexpensive) to add an additional LM7805 linear regulator (the TO220 package will provide 1.0 amps) for the Ping sensors, with one input and one output capacitor (as called out in the LM7805 documentation).
I don't really understand this type of stuff, so I have no idea about "100uF 6-10V electrolytic capacitor" or "LM7805 linear regulator." As a quick solution I connected PING)))s to 4AA bateries now, putting out 5.1V. They share the same ground with everything else. Might that cause a problem too, or do I really need to read some about capacitors and regulators?
My problem is not with the BS2 btw. The biggest problem is I have 7 not working PING)))s. And by not working I mean they are not measuring anything. I didn't want to believe that they were completely dead since I can see the light on top of them blinking, but apparently they are dead...
You actually must have the common ground (Vss), if things are going to work. You must NOT have 'common Vdd', or the BS2 is not going to work right.
And a battery makes a wonderful power source, so you probably don't need additional capacitance for that.
The 7 dead Pings are a symptom of something you're doing wrong. We're trying to help you fix what you're doing that's killing Pings, before you kill 7 more. Maybe Parallax can help you with the 7 dead ones.
Oh, and "I don't know too much" about stuff is why Google is around.· Google for LM7805, and read the manual.· As I see it, you have a choice.· You can learn by reading, or you can learn by blowing stuff up.· Either way, there's stuff you'll learn.· One way is cheaper.· So far, if you've really 'killed' those PING's, at $30 each you've spent $210 on your education.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Sorry for the confusion.
And thanks again for suggestions.