KRAIG 107 107 KRAIG
WWW.ROBOTIX.IN
TOPICS
1. Sensor Circuits 2. Comparators
SENSOR
One of the most widely used sensors is the Light Dependent Resistor. An LDR (Light Dependent Resistor) is a small resistor, the resistance of which depends upon the intensity of light incident on it. More the intensity of light falling on it, lesser is its resistance. The resistance usually varies in the range of about 10k ohms.
WORKING The LDR basically consists of a metal surface containing cadmium sulphide tracks. When light is incident on the track, electrons are released from the track which aid in the transmission of current. That is why the resistance of the LDR decreases with increase in intensity of the light.
USING AN LDR One of the major uses of an LDR is in LINE FOLLOWING. • The sensors come into the picture here. For detecting a white line on a black surface the robot must be able to distinguish between the colors. • In an electric circuit distinguishing a difference in any field is achieved using difference in voltages. The sensors basically provide this voltage difference, if the correct circuit is made. • We will consider an example of a line follower using LDR sensors at the end of the class
COMPARATOR
COMPARATOR ICS • LM339, LM393 and LM311 are some integrated circuits that consist of one or more comparators (LM 311 has one comparator) • Like the motor driver ICs which had H-bridges built in them, these ICs have comparators inside • As we shall see from the pin diagrams, the inputs given consist of the voltage to be checked and the threshold voltages against which they are to be compared, besides the power supply • The outputs are taken from particular pins, and they are either 0 or 1 depending on the input given to that comparator
LM393
LM339
LM339
LM339 PIN DIAGRAM
A SENSOR CIRCUIT
The end result of the above circuit is that it when the LED-LDR sensor is over a white line, the voltage across the LDR is low due to low resistance, which gives an output of 0 if the threshold for the comparator is chosen correctly. Over a black line, the output given by the sensor circuit is 1.
AN EXAMPLE – LINE FOLLOWER
• A line follower is a robot capable of tracking a line drawn on a surface • Optical sensors capture the line position at the front end of the robot • The robot is steered to keep it always over the line
BLOCK LAYOUT
Optical Sensor Array
Steering Controller
Left Motor
Right Motor
LINE FOLLOWING ALGORITHM
• Step 1: All the sensors are assigned some weight such as Sensor 1 = a1 = 3 Sensor 2 = a2 = 2 Sensor 3 = a3 = 1 Sensor 4 = a4 = -1 Sensor 5 = a5 = -2 Sensor 6 = a6 = -3 • Step2: Let b1 – b6 denote the state of each sensor(0 for white line and 1 for black line) • Step3:
Line Position = Σaibi
• Step 4: Based on the value of position, the motor will turn accordingly
A SIMPLE EXAMPLE WITH 2 SENSORS
HANDS-ON ASSIGNMENT
DESIGN AN LED-LDR SENSOR CIRCUIT ON A BREAD BOARD. OBSERVE THE OUTPUT VOLTAGE WHEN IT IS EXPOSED TO WHITE AND BLACK SURFACES