Shop OBEX P1 Docs P2 Docs Learn Events
Boebot with SRF01 ultrasonic sensor — Parallax Forums

Boebot with SRF01 ultrasonic sensor

OlaHOlaH Posts: 3
edited 2009-05-22 16:29 in Robotics
Hi,
Does anybody know how to connect and programme·a SRF01 instead of the included IR to my Boebot??
My intension is to have one SRF01 in each corner (front) and avoid objects.

Thanks in advance,

Ola

Comments

  • PrettybirdPrettybird Posts: 269
    edited 2009-05-22 11:38
    Send specs. I am no programming wiz by any means but good with hardware. You should include data sheets to help people help you.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-22 13:34
    Here's a link to the documentation: www.robot-electronics.co.uk/htm/srf01tech.htm.

    There's nothing special about connecting an SRF01 to a BoeBot. You just need to supply power (+5V and ground) and a control signal (I/O pin).

    The HIGH / LOW / INPUT and SERIN / SEROUT statements are all that are needed for controlling it. Unfortunately, the manufacturer doesn't have any Stamp examples of its use. Familiarize yourself with the chapters in the Stamp Manual on these statements.

    Something like this would send a command to the SRF01. You'd follow this with a SERIN to wait for and read a response from the SRF01:

    LOW pin ' Send a 2ms "break"
    PAUSE 2
    SEROUT pin,84,[noparse][[/noparse]command]
  • OlaHOlaH Posts: 3
    edited 2009-05-22 15:17
    Thanks Mike, so far I have only followed the included manual "Robotics with the Boe-Bot" and have not found anything about SERIN/SEROUT.

    Do I need a resistor between the sensor and the I/O?

    Will SERIN be a value (in this case in cm because of "84") or will it be·a signal when you have reached a specific distance (like an IR sensor)???

    /Ola
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-05-22 15:35
    Hi Ola,

    The Robotics with the Boe-Bot text does not cover those commands. However, you can download the BASIC Stamp Syntax and Reference Manual for more information on using these commands. Each page contains a full description as well as example code for applications.

    Hope this helps.

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.

    Post Edited (Jessica Uelmen (Parallax)) : 5/22/2009 3:45:35 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-22 15:41
    You don't have to have a resistor between the SRF01 and the I/O pin, but a 220 Ohm resistor there would prevent damage if the SRF01 were trying to transmit to the Stamp while the Stamp was transmitting to the SRF01.

    The 84 is a constant that specifies the serial I/O Baud and the format of the serial information (true logic, 8 data bits, no parity bit). The Stamp Manual chapter on the SEROUT statement goes into detail on this.

    You have to read the SRF01 documentation. It explains what is sent back and forth between the Stamp and SRF01.
  • OlaHOlaH Posts: 3
    edited 2009-05-22 16:29
    Thanks alot both Jessica and Mike!
    I am sure·I will·find a solution thanks to your guidance and help.

    Best regards,

    Ola
Sign In or Register to comment.