Let's Make Robots!

How to connect a SRF05 to a SPIDER controller

Standard ultrasound sensor connection to a Red Back Spider robot controller

Hello everyone!

This is my very first tutorial on LMR. I have spent a lot of time trying to connect a SRF05 to a Red Back Spider robot controller but in vain. But finally with the help of Dan M and ignoblegnome I got it working. Trust me for a begginer like me using a SRF05 on an arduino was a major achievement.

Okay now coming back to the tutorial, here is how the Spider controller looks like:


And this is a SRF05:


There are two ways of connecting a SRF05 to a board but I will show you the simplest one.

Turning the sensor back you will see a total of 10 pin holes , 5 on either sides:


Firstly I want you to solder 5 male headers to the bottom 5 holes of the SRF05 but be careful the solder of one pin should not touch another one!


Now comes the "connecting the wires to the SRF05 and the Spider" part.

First connecting the wires to the SRF05, here goes:


or as a schematic representation for any arduino including the Spider(dont look at this now it will only confuse you)


Now for the connecting the wires from the SRF05 to the Spider:

Now for the programing part using Arduino, you can just use the File>>Example>>Sensors>>Ping program where you have to just run the program without any changes if you have connected it to digitalpin 7 or if you have connected it to a different pin you can just change that 7 in the program to the pin which you have connected the yellow wire to.

Or you can use this program:


Arduino example for SRF05
Using a single pin for both trigger and echo.

int duration;                          // Stores duratiuon of pulse in
int distance;                          // Stores distance
int srfPin = 7;                        // Pin for SRF05

void setup()

void loop()
  pinMode(srfPin, OUTPUT);
  digitalWrite(srfPin, LOW);           // Make sure pin is low before sending a short high to trigger ranging
  digitalWrite(srfPin, HIGH);          // Send a short 10 microsecond high burst on pin to start ranging
  digitalWrite(srfPin, LOW);           // Send pin low again before waiting for pulse back in
  pinMode(srfPin, INPUT);
  duration = pulseIn(srfPin, HIGH);    // Reads echo pulse in from SRF05 in micro seconds
  distance = duration/58;              // Dividing this by 58 gives us a distance in cm
  delay(50);                           // Wait before looping to do it again


Even after going through this tutorial many times if you still aren't getting it then ask me or any other LMRer.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Cool stuff.

Can't wait to get my hand dirty on this dagu spider board.

I've ordered this dagu spider board and some motors and 2 sensors from robotgear. Used express option but it hasn't show up my door for almost 5 days.

Australia Post said it was delivered 2 days ago, but it hasn't. I hope someone didn't steal it.

I'm now contacting robotgear about the issue.

Good one! Thanks for sharng. I believed such tutorial will helps.

Looks like you have it figured out.  Glad to see it.

It is also probably a wise decision to put a resistor in series in the Trigger/Echo line. that will limit the current pulled from the processor.  The paperwork recommends 470 to 1000 ohms, but also notes that it is not essential, only recommended..


Trigger/Echo pin -----------------------resistor------------------------Arduino digital pin 7



   Dan M.

Thanks a lot Dan , will seriously considering putting up a resistor. 

To answer your shoutbox question:

The power supplied on the board is all 5V. Many miniature and standard servos run happily at 5V. This means you can power your sensors safely from the outer pins as you have shown.

To run servos that need more than 3A or higher voltages then you need the "High power servo shield".

I made a remake of your quadbot but with a SRF05 :D 

So if I use 5-7V batteries the SRF05 wont be hurt, okay time to go battery holder shopping!

The switchmode regulator needs 8V minimum according to the datasheet although I have tested them as low as 7V with a 3A load.

6xAA or 6xAAA batteries should be fine depending on your load. A two or three cell LiPo battery would also work well and reduce the weight.

Thanks will let you know once its working, by the way your quadbot design is awesome!!!!!!!

Works like a charm :)

Nice work, DTB. I'm glad to see you sharing your knowledge.

Haha actually its your's and Dan's knowledge that I am sharing :)

Anyway Thanks :)