Tutorials | Lumos

Introduction

First of all let us review the problem statement:

“Build one or more autonomous robot(s) that can differentiate between number of light sources of similar intensity kept inside an isolated room (Arena) and turn each one off.”

For making an autonomous robot, that can solve the given problem statement, it needs to have the following abilities:

  • Detect light sources in the arena.

And hence Deactivate all the light source without colliding with any deactivated light source.

  • The robot must have a mechanism to move in the arena using Light Detection.

  • It needs to detect the already deactivated light source in its path so as to avoid a collision with them.

  • It needs to sense when it has deactivated a light source and move on to the next one.

Based on what we require,the following modules will help us solve the problem statement

  • Locomotion- The making and operation of a differential drive.

  • Light Sensing & Obstacle Avoidance- Detection of light sources and deactivated.

  • Microcontrollers- To make the robot work autonomously.

Lets discuss all the above mentioned modules in detail:

  1. Locomotion

  2. Sensors

  3. Sample Algorithm

  4. Microcontroller

  5. Pseudo Code

Locomotion

To traverse the arena, the robot needs a control mechanism for which a differential drive is a simple and  efficient method. A differential drive contains two wheels and two separate DC motors driving them. In this event, DC motors of 60/100 rpm should be ideal for completing the task to be done in this event.

In this control method, the robot is able to traverse in a direction of its choice by rotating each DC motors in a particular direction. The different types of motion that can be achieved using a differential drive have been illustrated in the figure shown below:

 

 

 

For more details on differential drives, visit here.

For details regarding the circuitry involved in making a differential drive, visit here.

If u have any queries u can post them on our technical forum  here.

Sensors

With a differential drive, we have a mechanism which will enable the robot to traverse in the arena but the challenge now is to make the robot move specifically in the direction of the light source. In this event, there would be multiple light sources present in the arena, which the robot has to detect and deactivate. The light sources can be detected by using light sensing and to implement it, the robot must have sensors.

The most apt sensor for solving this problem statement is a Light Dependent Resistor (LDR).

The Resistance of an LDR is inversely proportional to the intensity of light incident on its surface. By suitable placement of LDR’s on a robot, the robot can easily make out the direction in which the light source is located.

LDR sensor are available in the market in two sizes: small and large. For this event, It is better to use large LDR sensors since they are more sensitive to change in the intensity of light incident on them.

For more details, refer to the Sensor section here.

 

Using a large LDR we plotted the values of the resistance at different height at different distances from an 100 Watt bulb. After plotting the readings in 3D we obtained the following graph which idicated to us that the sensor should be placed at a height of around 20 cm.

 

Sample Algorithm

Algorithm 1

For this event, the layout of the sensors would has to be logically driven in order to locate the position of the light source. Here is a possible layout of the sensors which will allow the robot to detect a light source anywhere in front of it:

Fig: The LDRs are place in a semi circular pattern facing the front of the robot.

In this example we are assuming that the sensor output i.e. the potential difference across the LDR is taken in such a way the voltage decreases with increase in the intensity of the light falling on the surface of the LDR. Thus, the maximum voltage drop occurs when there is no light falling on the sensor and vice versa.

Considering the ideal case of a single light source in the vicinity of the robot, we discuss the possible cases(assume, maximum intensity when LDR reads 1V and minimum at 2.5V):

Case 1:

When the light source is directly in front, the LDR at the centre gets the maximum intensity while the others get lower intensity. Hence, it registers minimum voltage drop.


Case 2:

                              

When the light source is at any one side of the robot, the LDR sensor to the side gets the maximum intensity while the others get lower intensity. Hence, it registers minimum voltage drop.

Now we can develop a basic algorithm to lead the robot to the light source.

Left sensor

Centre sensor

Right sensor

Movement

Minimum voltage

-

-

Turn Left

-

Minimum voltage

-

Go straight

-

-

Minimum voltage

Turn right

 

In the above mentioned algorithm, we also have to consider a case when there is no light source present in front of the sensors i.e. the light source is behind the robot. At this moment we must simply instruct the robot to take a simple turn and keep doing so until it detects a light source in front of it.

                                         

Apart from sensing the light source, the robot will also need to avoid colliding with the already deactivated light source. It is recommended to use an IR LED - LDR pair to since the light sources present in the arena would interfere with the white LED-LDR sensor pair. IR LED and detector emit and sense Infrared light. It’s functioning is the same as a normal LED-LDR pair.


 

For detection of obstacles, IR sensors can be mounted on the chassis in a desired position. The IR LED emits IR light which, in the presence of an obstacle ahead, gets reflected. This would bring a change in the resistance of the LDR thereby indicating obstacle/deactivated light source in our path and hence we can change the path of the robot as required.If the output of the sensor is analog, then it is converted to digital using ADC of a microcontroller.For more details regarding ADC, visit here.

 

Algorithm 2:

We can also employ another method for detection of light sources present in different directions. In this method, we will have a single sensor rotating in various directions, with the help of a servo motor. RC servo is a small motor with a integrated gearbox and control electronics. Servos are used for precision positioning. It can be programmed to attain a specific angular position by using Pulse Width Modulation (PWM).


When a servo positioned on the top of our robot chassis is coupled with a LDR sensor, we can measure the resistance of the LDR in different directions, and hence move in the direction which has the maximum intensity of light incident on the sensor. In this way, the position of light source can be ascertained.

However, it should be noted that the use of a servo motor gives optimum and efficient output when the robot has a omni drive mechanism for locomotion control.

For more details regarding Servo control, visit here.

In this algorithm, we can also use a stepper motor. For details regarding stepper motor, visit here.

It is to be noted that the above two mentioned algorithm are just a subset of the multiple algorithms that can be applied to solve this problem statement. For example, a robot made of completely analog circuits can also complete the required task.

 

 

Microcontrollers

 

 

Now we have a drive mechanism to steer the robot, a light sensing mechanism to determine the location of the light sources present in the arena and we also have an obstacle detection system to avoid the objects with which we don’t want the robot to collide. Now to control all these systems simultaneously, we need a microcontroller.The event rules specify that we must use a 16 bit processor or less. Most of the processors available in the market are 8 bit like Atmega16 series or various Arduino boards.

The most generally used microcontroller user interface is AVR. It is quite a good option because it is quite easy to program with the help of the serial/parallel ports of the desktop computer. The programming can be done in most of the common languages such as C. There are several companies which sell fabricated Microcontroller boards. Here is one such link. You can also buy programmer circuits from these robotics shops. An example for a programmer is here.

For more details on microcontrollers, see the processing unit section in this link.

For tutorials regarding arduino, visit here.

Pseudo Code

This pseudo code serves as a guide to one of the many possibilities to approach this problem statement:

 

unsigned char minimum(unsigned char a[], int num)  //Function to find the minimum value of the input taken by the sensors and return the same

int main(void)
{
while(1)
{

for(i=0;i<3;++i)
{
read input of all the sensors into an array
}

unsigned char min=minimum of the sensor values;
unsigned char blackout = a very high value when the light falling on the sensor is negligible;

if(blackout region,i.e. no incident light on any of the sensors)
{
   robot moves arbitrarily until it detects some light in any of its sensor;
}

else if(minimum at left sensor)
{
robot turns left;
}

else if(minimum at right sensor)
{
robot turns right;
}

else if(minimum at center sensor)
{
robot moves straight;
}

}  // End of while loop

}  //End of main function

 

Summary

Taking a look into the tutorial, what we have discussed here is a simple process of making an efficient robot for the event Lumos. The above given modules are just to guide you through the various aspects that are involved in the making of the robot. Now we will discuss just a couple of more point which are important from the robot making point of view.

First of all, the event rules state that a participant can make a robot(s) of maximum dimension 55*55*55 cm (L*B*H). It means that it is not required of us to make a single robot of these dimensions only. We can multiple robot for this event also, with the condition being that they all, when taken together, must fit inside a box of dimensions 55cm*55cm*55cm. A robot of height 25-30cm should be ideal for this event. The length and breadth of the robot are flexible and can be adjusted as per one’s requirement.

Another important point is the position of the sensor on the robot. It would be feasible that sensors are positioned in such a manner that they receive light constantly from the light when the robot is moving towards it. This can be taken care of, if  we can place the sensors at same horizontal level as the bulb of the light source.

Lastly, one should also keep in mind the design of the chassis of the robot. It should be designed in such a way that the robot is able to make contact between the two rings with as little force as possible. A robot tapered in the front would be more effective in case of a head on collision.

So, this brings us to the end to this tutorial. We hope that it was helpful in clearing your doubts and you can now make a great autonomous robot for this event. If you have any further event or technical doubts, you can post them on our forum here.

 

Event Link: www.robotix.in/lumos

Event Video: http://www.youtube.com/watch?v=PBtmdlRySXM&feature=g-user-u

Light Source Deactivation Video: http://www.youtube.com/watch?v=MEsOWZctG6Q&feature=g-user-u