Let's Make Robots!

Cerberus v2

Auto Navigate using SRF05 Sensors
Cerberus.pde4.03 KB

Parts List

2 x 15cm 5mm Perspex Circles

2 x 100:1 MFA Como Drills 3-9V Motors

1 x Arduino Mega

2 x SRF05

1 x PP3 Battery Holder and Battery  to power the Arduino

1 x 3xAA Battery Holder and Batteries to power the motors through Motor Driver Shield (using PWM)

2 x Mecano Wheels

1 x Piezo Transducer

2 x LED

Various Nuts and Bolts.

Any Comments Welcome.



Comment viewing options

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

Cool looking bot, and an Arduino Mega should give you lots of room to experiment.

One suggestion: Your code is all full of formatting gobbledygook. Instead of cut and pasting it into the post, you can attache it as a file. Much cleaner.

Any chance you can post some video of it in operation?

Sure i have some in 3gp from my phone i will convert and upload, also change the code to be in file format. :-)



New video of robot in action uploaded.

Thanks for posting the video. Looks like pretty solid navigation. I was surprised by the orientation of your SRF05s. What made you decide to have them pointed across each other's path? I assume based on your results that there is no interference between them.

Also, nice socks. ; j

Morning IgnobleGnome,


The navigation is pretty decent it will coast around all day and not bump into a single object unless its below its eye level of course. Also I programmed in so that the distance at which the bot recognises an obstacle is also changeable.

I first though upon using 3 SRF05's for the navigation, left, center and right. But then decided upon the cross eyes approach. In doing this I am able to scan both left, right and center using only two censors. please refer to the truth table below. The cone shape of the censors does pose a slight problem when they are so close together, but I have managed to calibrate them so that where they are now they are both just out of scan range of each other. I also leave 65ms between each send and receive echo sequence to allow the previous echos to die out, this eliminates any interference.


Left SensorRight SensorStatusAction
No ObstacleNo ObstacleClearMove Forward
ObstacleNo ObstacleRight ObstacleSlight Left Turn
No ObstacleObstacleLeft ObstacleSlight Right Turn
ObstacleObstacleCenter ObstacleBroad Turn (Left or Right)

Also, cheers for the sock compliments :-)

This looks great! Are you using an arduino motor shield? I'm curious about your motor pins. You've got 2 pins per motor but you only define one per motor. Then I notice you're using a digitalWrite to the defined pins and an analogWrite to the undefined pins. Clearly this is working but I don't understand why. I'm new to C, though. Can you explain that to me? 




Morning DDibling,

Yes, I am using a Motor Shield from DFRobot, the shield uses an external 3 x AA battery pack to power the motor's and takes its power for the other components from VIN.

The reason there are 2 pins per motor is to facilitate PWM, the digitalWrite to M1/2 sets the pin to be high (+v) and the analogWrite to E1/2 specifies the speed that the motor should rotate.

Small update:

Spent a few hours optimizing the script today to iron out a few issues, all is now well, and quicker I must say!

Added a Piezo for audio output at start up and when an object is detected.

Balanced the wheels better to stop the slight left drift.

What next.....?

SRF05's in a cross-fire pattern. Perfect. Best set-up for small robots, in my opinion. Quality.

Yep it works perfect, I would have stayed with that idea on my new bot but wanted to experiment with a servo to pan the SRF05, so far it is proving alot harder!