CLICK HERE FOR INDEX PAGE
ADDING HOMEMADE SENSORS - LIGHT/DARK SENSOR
V. Ryan © 2010
|PDF FILE - CLICK HERE FOR PRINTABLE WORKSHEET|
|Homemade sensors can be connected to the inputs of the PIC microcontroller circuit. The drawing below shows a homemade light/dark sensor, being used as an input to the microcontroller circuit. It has been connected to INPUT A/D 0. When the genie microcontroller circuit is programmed, the sensor becomes a type of switch. The light / dark sensor can be used to trigger OUTPUTs, such as LEDs or motors.|
|Homemade light/dark sensors normally
have three wires, that connect to the INPUTS on the microcontroller
Opposite is a simple light/ dark sensor. This can be connected as an input or light / dark switch to another circuit. The sensors has three green wires (1, 2 and 3). Wire 2 should always be connected to one set of the inputs. If wire 1 is also connected then the sensor acts as a dark sensor. If wires 2 and 3 are connected to the inputs then sensor operates as a light sensor.
When used as a dark sensor:
When the light level falls, the resistance of the Light Dependent Resistor increases. This prevents current from flowing to the base of the transistor. Consequently the relay does not energise. In simple terms, the relay switches OFF.
Alternatively, when used as a light sensor:
When the light level rises, the resistance of the Light Dependent Resistor decreases. This allows current to flow to the base of the transistor. Consequently the relay is energised. In simple terms, the relay switches ON.
The PIC microcontroller can be programmed to detect the ON or OFF state of the sensor, as if it is a simple on/off switch.
|CLICK HERE FOR MORE INFORMATION ON LIGHT / DARK SENSORS|
|The diagram below, shows the dark/light sensor, connected to the GENIE E18 PIC Microcontroller’s inputs. This microcontroller has five inputs and the sensor is connected to A/D 0, although it could be connected to any input.|
|SIMPLE PRACTICAL APPLICATIONS:|
|It is quite
easy to program the GENIE E18 PIC microcontroller, to work in the
When the relay of a light / dark sensor, connected to an input, de-energises, the microcontroller turns on a range of lights. The lights remain on for two minutes and then switch off.
|This could have a simple but effective practical application. It could be used as a security device for a house. If an intruder casts a shadow on the dark/light sensor, security lights are automatically switched on by the PIC microcontroller.|
|Alternatively: If the sensor is positioned in the middle of a driveway - when a car passes over it, in order to park on the driveway, security lights come on. This would help the driver to park safely.|
|CLICK HERE FOR PIC-MICROCONTROLLER INDEX PAGE|