This next step is optional and depends on your project.
The light sensors connect to two separate (AN0 and AN1) internal 10-bit analogue to digital converters (A2D) within the PIC microcontroller, which measures the voltage levels based on light levels and converts these to a digital reading. Read the PIC datasheet for further details of how this works.
The hight sensors are place on the top left and right side of the PCB we it is marked S_L (= Sensor Left) and S_R (= Sensor Right).
Command 50 is used to probe the A2D circuit and the measurements from the left and right light sensor. The measure details are sent as two separate words to the RS232 serial port for your microcontroller or robot controller to interpret. See command 050 for further details on how to trigger this command.
Showing pads for Light Sensor 1 on the left hand side of the PCB. The Sensor 2
could be used for a left feeler. the same circuit is provided for the right hand side
Additional connecting pads have also been provided on the PCB, so it possible to attach additional sensor or feelers to the board. These are parallel connection and need to work with together with sensor 1. This is explained in more detail in the next section below.
If you want to use the A2D for other projects, then it may be best to fit a pin header to the PCB instead of soldering the light sensors directly into the PCB. This makes it easier to exchange the light sensor with other sensor types. Or perhaps you may wish to add longer leads or cables to the light sensor, so these can be used for line following games or perhaps even attach a completely different sensing device; such as a temperature sensor.
To connect the light sensors, bend the long leg (the emitter) and the short leg (the collector) of the phototransistor in such a way that you can insert them into the PCB (or pin header). Pin headers for the light sensors are not provided in this kit.
For the LEFT sensor, place the collector (short leg) to the LEFT pad on the PCB
For the RIGHT sensor, place the collector to the RIGHT pad on the PCB. These pads are connected to ground and be tested with a multimeter.
The light sensor is a phototransistor in which the conducted current is a function of the amount of light reaching the sensor. The phototransistor looks similar to a LED, but has a different working. To limit the current through the transistor, you always have to use it in combination with a resistor that is large enough, typically in the order of kOhm. The kit provides a 470 KOhm resistor, but other values would also work if you need different sensitivity or other sensors fitted.
Here is a simplified diagram of the A2D circuit, created with the A2D converter connected to Vout:
Picture of feelers and light sensors.