Shop OBEX P1 Docs P2 Docs Learn Events
Using 4 Pin Ultrasonic Sensor with Shield-Bot and IR detection. — Parallax Forums

Using 4 Pin Ultrasonic Sensor with Shield-Bot and IR detection.

surfcrssurfcrs Posts: 4
edited 2013-11-26 06:53 in Robotics
I ordered a 4 pin ultrasonic sensor to add to my shield-bot which is currently set up as the IR detection obstacle avoidance. I am just going to stick it on the breadboard facing straight out. Right now the robot gets stuck "jittering" in corners sometimes. I thought I could use the the ultrasonic detector to tell it do do a 90 degree turn or so before it gets too close to "jitter". Anybody else have a sketch that does something like this? Then I would like to add sounds to trigger when the ultrasonic is triggered. I'm new to arduino and have just been mostly playing around with the numbers in the sketch to change the speed and timing of the turns.

Comments

  • ercoerco Posts: 20,255
    edited 2013-11-23 22:12
    This is regarding the Parallax Robotics Shield ? :)

    Are you using a Sharp IR distance sensor or the stock pair of IR LEDs & 38 kHz receivers?
  • surfcrssurfcrs Posts: 4
    edited 2013-11-24 08:23
    Yes, I'm using the Parallax robotics shield for arduino with stock pair of IR components. I should receive 4 pin ultrasonic sensor from amazon tomorrow.
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2013-11-26 06:41
    There is a project posted for the Shield-Bot that uses our PING))) 3-pin ultrasonic sensor, and an additional servo to rotate a turret. Perhaps you could adapt the concepts to your sensor, if there is an Arduino library for it.
    http://learn.parallax.com/project/shield-bot-roaming-ping
  • ercoerco Posts: 20,255
    edited 2013-11-26 06:53
    Perhaps you could adapt the concepts to your sensor, if there is an Arduino library for it.
    http://learn.parallax.com/project/shield-bot-roaming-ping

    Good call, Steph. As one might assume, the main difference between a 3-pin PING and a 4-pin HC-SR04 is... one pin. Most any program/sketch could be modified to use either sensor by changing a pin number or two. The cheap sensor has seperate lines for trigger and echo, where a PING combines them into a single pin.
Sign In or Register to comment.