Expert Advice!

I am new to robotics but have been very interested for a long time now, I have decided to design and build my first robot, but as I am new need some advice with a few things!
The robot will be a small with a differential drive system, with obstacle avoidance from three sensors positioned on the left, right and front of the chassis, with these rules (I don’t know much about programming but think that this is a start?)

  • If front sensor is activated, but side sensors aren’t, turn in either direction.
  • If front and either side sensors are activated, turn in the opposite direction to the activated sensor.
  • I only a side sensor is activated, do nothing.
  • If all three sensors are activated, stop.
    My questions are:
    Am I going about this the right way?
    If so which microcontroller and sensors would I use?
    How would I program it?
    Any advice would be greatly appreciated!
    Thank you

Hi Potato, and welcome to the world of robotics.

Unfortunately your first question, “Am I going about this the right way,” presupposes there is a “right way” to get started on a robot project. There are lots of mistakes you can make with any approach, but I’m a fan of diving right in, but you’ll have to see what works best for you.

Which microcontroller you’ll want to use will depend on a couple of things, but primarily what (if any) programming experience you have, and how much money you wish to spend. An Orangutan (the line of microcontrollers offered by Pololu) might be a good choice for a small diff-drive robot as they all include dual motor drivers. You will need a separate programmer, like the ones offered by Pololu or from Atmel, the microcontroller manufacturer. If you have less programming experience you might also consider an Arduino board or a Basic Stamp, which have a shallower learning curve, but will probably require external motor controlling electronics.

As for small obstacle detecting sensors, you have a few options, and you can find examples of them in the Pololu sensors page. Small sonar modules are probably overkill (in terms of price and look-ahead range) for a small robot concerned with what obstacles are right in front of it. IR Distance sensors (like this one) don’t have the long range of sonar, but they’re less expensive and can still look more than far enough ahead for a small robot. If you use a few of these on a robot, make sure to mount them with the longer side positioned vertically, and aim them a little apart, to keep them from interfering with each other. If you want to go super-short range and extremely cheap, you can build your own contact-whisker sensors with piano wire and springs from click-pens.

How far you want to try to go with this first project is really up to you.


OK, Thank you very much!
If I was going to go with a micro stamp (The only experience that I have in programming is with creating simple speech recognition rules on my mac etc!) what sort of motor controller would I need? Do you think it is possible for you to describe to me how everything would be set up in a basic circuit for my needs? I am still pretty unclear!
Thanks again.

You should take a look at the Pololu Basic LEGO Robot sample project. It uses a basic stamp, a Pololu micro dual serial motor controller, and long lever switches as obstacle sensors. The lever switches aren’t stocked here any more, but you could easily swap those out for switch whiskers, or less-easily for other kinds of obstacle sensors. Parallax actually stocks the Pololu uDSMC for nearly the same price as Pololu, so you could save on shipping if you order both your stamp and motor controller form there. Depending on the requirements of your motors, you might want to pick out a higher power controller, but some of the other Pololu motor controllers use the same protocol so it wouldn’t even require changing the code.


You might also want to look at these short range IR obstacle sensors that Pololu just started carrying. I haven’t tried one myself yet, but they look pretty nice. Looks like you’ll need a couple of resistors and capacitors to get it working, but that’s Radio-Shack stuff.

They’re about 1/3 the price of the longer-range IR distance sensors, and have a digital output rather than an analog one. These will only tell you IF there is an obstacle in view closer than 10cm, not how far away it is, but it will be a lot simpler to interface with a microcontroller. It might be the perfect thing for your project if you decide to go with non-contact obstacle sensors.