Tuesday, February 26, 2013

                  IR Sensor Panel For A Line Following Robot.


                       Most of the time we use IR(infra red) to detect the line which the robot should follow.There are some IR sensors with IR LED in a single package specially made for robotics.They normally costs around Rs.50.And we can easily make a sensor panel using those modules.
         


       There are two types of sensors in those packages.
                     
                       1.Resistor type
                       2.Transistor type

                      In the resistor type, the sensor works as a resistor.It changes the resistance through the sensor with the color.So,we can detect the line using that fact.But the voltage through the sensor changes by a very small amount with the color.And that difference is not enough to take as an input to a PIC.Because it needs at least 3.3v to identified by the PIC as an input.So as a solution we use a set of op-amps to amplify that small voltage difference.LM324 is an IC which contains 4 op-amps in it.we can use that one or any other op-amp IC to this circuit.below is the circuit diagram for a single sensor.But in the diagram the sensor is shown as a Diode.

         we can use 8 or more number of sensors as we wish.Because more sensors is better to build a very sensitive sensor panel.We can change sensitivity by changing the value of the 20k variable resistor.And can see if the input pin of the PIC is ON or OFF from the LED1.

                    In the Transistor type the sensor is a photo transistor.It acts as a normal transistor without a base pin.The current through the collector-emitter junction changes with the color.


          we can use an op-amp circuit for these sensors also.But these transistors give a large voltage difference for colors like Black and White.So,if we don't like to use a op-amp circuit, we can use the emitter out directly as an input to the PIC.Here is the circuit,
       You can use any type of sensors as you wish.But remember the more sensors is better for a very sensitive sensor panel.Normally we use about 8 or 10 sensors for a panel.But this can be changed with the task to complete.

       This is a ready made sensor panel you can buy.But it is more valuable if you make it by yourself.

Thursday, February 21, 2013

Drive Your Robot



Drive Your Robot


You can build a  simple mobile robot using two DC motors and two wheels. And now I am going to explain you how you can drive your robot. The driving mechanism now I am going to explain is differential drive.
The differential drive design has two DC motors in left and right which are attached  to two wheels. And since we need three ground contacts we need extra castor wheel.
Here by changing the speeds of the two motors we can make robot to go on different paths.


Differential Drive



So using differential drive we can achieve movements as follows
         Driving straight forward : VLeft = VRight
         Driving a right curve :        VLeft > VRight
        Spot turning : Vleft = -VRight
So by adjusting the speeds of two motors we can move the robot as we need. So to control the motor speeds we need a motor controller circuit. If you don't know about motor controller you can view the article about the motor controller in this blog.         DC Motor Control Circuit For Your Robot

So we can change the motor speed by changing the given voltage to it, otherwise we can change the voltage given at enable pin of the motor controller to change the speed.  

 This could be achieved by using the PWM output pins in your micro controller. So let's see what is Pulse Width Modulation

Pulse Width Modulation
           
            In order to control the motor speed we can generate a voltage signal that is proportional to the motor speed. In other words we can generate an analog voltage signal to control the speed. But instead of generating analog signals we can use pulses of digital signal to achieve this. By changing the width of pulse we can generate the analog voltage signal to control the motor. This method is known as Pulse width modulation. And in most microcontrollers there are PWM output pins to control DC motors, or drive servo motors etc.

Pulse Width Modulation


So by changing the voltage at enable pin of the motor controller we can drive our robot.
So next our target is to drive the robot according to its environment, for example following an line, or avoiding obstacles etc. So in my next post I will explain how to control the robot motion according to its environment.   There I will discuss about the PID control theory to move robot.