Skip to main content

In this Lab, the Optical Sensor as well as three Line Trackers are used to trigger different movements of the conveyors. To be able to code the sensors, you need to gain a better understanding of the Line Trackers. This better understanding includes their limits and outputs in order to record the upper and lower threshold values that will be used in your project.

The outputs of the Line Trackers are the percentage of light that is being reflected back from the Line Tracker. There is a high and low threshold value with the Line Trackers.

If there is no object in front of the sensor, there is nothing for the light to reflect off of and thus, no light is detected as received. This would produce a low value, anywhere from 0 - 12% depending on the amount of light in the environment. In this project, when there is no disk in front of the sensor, a low value will be reported.

no disk detected

If there is an object in front of the sensor, there is something for the light to reflect off of and thus, light is detected as being received. This would produce a higher value, anywhere from 12% or higher, depending on how close that object is to the sensor. In this project, when there is a disk in front of the sensor, the value will spike and a higher value will be reported.

detect the disk

These threshold values can be used to code the sensors to trigger certain movements of the conveyors, diverter, and the arm. Once the sensor detects a value above or below a threshold value, the conveyors can be triggered to stop or begin moving. You will need to record the high and low value for each of the three Line Trackers on the Workcell to use in your project.

Download and run the project and then view the Brain's screen. 

The coordinates of the arm, the values of the Line Trackers, and the values of the Optical Sensor are displayed.

The first group of values to be displayed are the arm's x, y, and z-coordinates. This will be used in the Lab to obtain the pick up and drop off locations for the green disk.

Arm values

The second group of values to be displayed is if a disk is detected by the Optical Sensor and if so, what color the disk is (red, blue, or green). 

Place a red disk in front of the Optical Sensor. Notice that the ‘Disk Detect’ value reports ‘TRUE’ and R for ‘Red’ also reports ‘TRUE.’ Once you have seen 'R: TRUE,' remove the red disk from in front of the sensor.

Only one of the three colors can report ‘TRUE’ at one time. Thus, when detecting a disk, one color should be ‘TRUE’ and the two other colors should report ‘FALSE.’

Red true

The third values to be displayed are the outputs of the Line Trackers. Each of the three Line Trackers can display different values.

This can depend on different conditions such as how close the disk is to the sensor or the amount of light in the environment.

Ensure there are no disks in front of the Load, Pickup, and Exit sensors and record the three low values in your engineering notebook. 

These low values will be used later in the Play section when you further edit your project.

Record your sensor values and not the ones shown in this image.

Low values

The Line Tracker value will report as a higher reflectivity value when a disk is in front of the sensor. 

Place one disk in front of each of the three Line Trackers to see how the value increases when there is a disk present. 

Record these three high values in your engineering notebook.

Once you have recorded all three high values, stop the project.

Record your sensor values and not the ones shown in this image.

High values