# Difference between revisions of "Tutorials/Arduino Projects/Mobile Robotics/BoeBot/Connecting a Light Sensor Module"

(→Understanding the Circuit) |
(→Understanding the Circuit) |
||

Line 3: | Line 3: | ||

{{tl|1|}} | {{tl|1|}} | ||

== Understanding the Circuit == | == Understanding the Circuit == | ||

− | We are going to connect two phototransistors to the BoeBot, as two | + | We are going to connect two phototransistors to the BoeBot, as two phototransistors provide many more options when navigating. We are going to connect the phototransistors to analog ports 0 and 1. |

[[image:BoeBot_light_sensor_schematic.png|thumb|c|center|300px|Schematic for the connection of two phototransistors]] | [[image:BoeBot_light_sensor_schematic.png|thumb|c|center|300px|Schematic for the connection of two phototransistors]] | ||

Line 18: | Line 18: | ||

[[image:BoeBot_Light_Sensor_Vout_Equation_1.png|noframe]] | [[image:BoeBot_Light_Sensor_Vout_Equation_1.png|noframe]] | ||

− | However, since we have a variable | + | However, since we have a variable resistor in the place of R<sub>1</sub>, we need to expand the equation to make plugin in the value of the phototransistor easier. |

[[image:BoeBot_Light_Sensor_Vout_Equation_2.png|noframe]] | [[image:BoeBot_Light_Sensor_Vout_Equation_2.png|noframe]] |

## Latest revision as of 15:03, 16 October 2012

## Understanding the Circuit

We are going to connect two phototransistors to the BoeBot, as two phototransistors provide many more options when navigating. We are going to connect the phototransistors to analog ports 0 and 1.

We have already explained how a phototransistor acts like a variable resistor. Since the resistance varies with the amount of light hitting the sensor, we can place it in a circuit that converts the changes in resistance to changes in voltage. The circuit used is called a voltage divider. It operates on the principals of Ohm's Law and Kirchhoff's circuit laws.

Kirchoff's circuit laws dictate that for such a circuit, the total resistance (R_{T}) of the circuit is the sum of the resistance of the individual components. As such, for voltage dividers R_{T}=R_{1}+R_{2}. Thanks to Ohm's Law and Kirchoff's Current Law, we also know that each component has the same current flowing through it, and that it is the same as the total current. So I_{T}=I_{1}=I_{2}. Then using Ohm's law we can find the voltage drop across each component. So V_{n}=I_{n}*R_{n}.

By combining all of the above equations we arrive at the voltage divider equation.

However, since we have a variable resistor in the place of R_{1}, we need to expand the equation to make plugin in the value of the phototransistor easier.

So for this setup we find the equation is:

## Making the Connections

The parts you will need are all included in the BoeBot kit. For this project, you will need 4 colored wires, two 2kΩ (red-black-red) resistors, and two phototransistors.