How to turn the 'head' in different directions


#1

Hi Guys

I have a makeblock starter robot and would like to add some bits to enable it to navigate the house in a smarter way. I was hoping someone could advise which parts I need. What I want to do is as follows:

I want to add a motor to the head so that it can perform two tasks:

  1. When the robot is moving forward I want the IR sensor to constantly swivel a little from left to right so it reliably misses obstructions
  2. When the robot meets a head on obstruction, I want to motor to turn the IR sensor 90 degrees to the left and take a reading, then 180 degrees to read the other way, then 90 degrees back to center. At this point it will know whether to turn left or right based on whichever reading is the longest.

I am not sure whether the servos can be programmed to turn a specific number of degrees. If they can then I dont need the angular sensor. If they cant, then how can I fit the angular sensor to a servo…or do I need a different motor to do that?

Thanks for any assistance!


#2

A servo can be used in one degree increments, so 90 will be find.
Check out the main site for a servo kit and check out some example on YouTube.
I use one, I set it to read at 0, 90, 180, and back to 90 until it an object is detected in close range.


#3