Hi guys im new in robotics and i bought parallax sumobot yesterday from online store ,i just want to ask if can i replace the IR sensor by Ultrasonic sensor and what do i need to change about the codes about the changes of sensor.
Hi genetix , for better vision, ultrsonic is a good sensor than IR. Can you help me how can i replace it, i do not know where to connect does pins of ultrasonic
You can mount a ping sensor on the breadboard and use a I/O Pin that is not used. It looks like P0 through P4 are unused. You can turn the IR on and off through software. I have never programed the Sumo, so I do not know how much memory is left to use the PING.
Programming the Sumobot should be the same as with a BASIC Stamp 2 with PBASIC so the BS2 Ultrasonic example should get you started. You should be able to substitute one of the IR sensor ports for the Ultrasonic sensor, but that is just a guess. https://parallax.com/downloads/ping-ultrasonic-distance-sensor-bs2-example-code
The IR sensors are on Pins P4, P11, P14 and P15. No need to disconnect them. Just use P0 or P1 or P2 or P3. They are not used by anything else. The Ping only requires one I/O pin plus VCC and VSS.
Using the attached Basic Sumo Competition BS2 program, there is 75% of the EEPROM available for PING code. Open I/O pins for the PING are P2, P3, P5 and P6. Only one is needed.
Plenty of I/O pins on that robot, can you run both IR and an ultrasonic, since a PING only uses one pin? If possible, use another pin to drive a servo to rotate the PING for more directional input. The sensors have complementary strengths & weaknesses, running both for "sensor fusion" is the best of both worlds.
OK, if it's a class project then naturally you don't want us to do the work for you! Fortunately for you, Andy Lindsay did most of the legwork for you in his fabulous book "Robotics with the Boe-Bot". It gets even better. That's a free download from Parallax. All you have to do is read through that (great coursework) and it will tell you everything (and more) that you need to know about using the PING sensor. A win-win if ever there was one!
Comments
What wrong with IR sensors that you need to replace them?
IR sensors are simple, small, cheap, and don't consume much power.
Something like a Ping is a lot more expensive, bulkier, and takes a lot more power.
https://parallax.com/downloads/ping-ultrasonic-distance-sensor-bs2-example-code
Our professor require us to use Ping sensor.
Anyway Thank you for response
Thank you for that, it will help me more
Thank you for that, much appreciated
Here is the Basic code for the PING.