The light sensor enables a robot to detect light. Robots can be programmed to have a specific reaction if a certain amount of light is detected. The light sensor uses a cadmium sulfosolenide (CdS) photoconductive photocell. The CdS photocell is a photo resistor, meaning that its resistance value changes based on the amount of incident light.
The light sensor can give the robot vision and make it easier for it to operate autonomously.
The light sensor allows the robot to follow a light source, such as a beam of light from a flash light or similar. The light sensor is placed on the top section of the robot or on a lower section that is not covered. Figure 2 shows the sensor placement. This sensor can be used to help the robot avoid getting stuck under furniture. The light sensor can enable your robot to detect and follow a beam of light, or avoid getting stuck underneath furniture by avoiding shadows. Figure 3 shows Squarebot following a light source placed above it. In conjunction with clever programming, it can be used to conserve battery power by shutting down the robot in the absence of light. In conjunction with filters, the robot can be given color vision to detect various colors
The light sensor can detect distance accurately from 0-6ft away, depending on the intensity of the light source and the intensity of the ambient light. Consider the following example. It is easier to see a flashlight in the dark than it is outside on a sunny day. This applies to light sensors just like it does to humans. Light sensors can only detect visible lights, just like humans. It can see everything we can see, and cannot see things we cannot see as well, such as infrared and ultraviolet light.
- Sensor Type
- Useable range
- 0 to 6 feet
- CdS Photocell
- 500 (Light to 5M (Dark)
- 0.03 lbs
- Black – ground; Red – (+) power; White – control signal
ROBOTC Sample Code
CMU Robotics Academy Resources
easyC Sample Code