Light sensor finished and in use
Showing current light value, the light sensor TSL250R can be seen poking out on the top.

This module measures light intensity and shows it on a scale from 0 to 782 on the LED display. By multiplying that value with 5, and then divide by 127 you get the light intensity in µW/cm2. If the light intensity rises over or falls below (configurable) the set point; the output activates, with a hysteresis of +-25. The module has two outputs; a constant and a pulse. The constant output can be used to drive e.g. a relay, while the pulse can communicate with other equipment. Powered by: 9-24V.

Table of content

Operation

Set points

The set point is adjusted using the (on)-off-(on) switches, when adjusting; the display shows this instead of the real value. It is stored in EEPROM making it non-volatile, meaning that it is not lost if the module is without power.

Formula to calculate light intensity

Value * 5
--------- = uW/cm2 (+- 0.039)
   127

LED display

In reality only one digit is shown at any given time, but by cycling through them in high speed the human eye sees three stable digits.

Light sensor LED display illustration
Three digit LED display (with DP) illustrations for Light sensor.

When DP x is lit:

  1. The set value is shown, not the real value.
  2. Output is active.
  3. Set point has not yet been saved to EEPROM.

I/O

Input pins

  1. PC.0 Light sensor, analog value
  2. PC.1 Set point up
  3. PC.2 Set point down
  4. PC.3 Active when over or under set point

Output pins

  1. PB.0 LED-display digit 1
  2. PB.1 LED-display digit 2
  3. PB.2 LED-display digit 3
  4. PB.3 Output constant
  5. PB.4 Output pulse

LED display pins

  1. PortD.0 LED-display A
  2. PortD.1 LED-display B
  3. PortD.2 LED-display C
  4. PortD.3 LED-display D
  5. PortD.4 LED-display E
  6. PortD.5 LED-display F
  7. PortD.6 LED-display G
  8. PortD.7 LED-display DP
LED display segments and pin-out
Showing the seven segments, DP and pin-out for a LED display.
LED display binary values
Showing the binary values for a seven segment LED display.

D-Sub 9-pin connector

  1. 9-24V +
  2. GND
  3. Output constant
  4. Output pulse

Please leave a comment or tweet if you have any questions or feedback on this project.

Videos

Schematic drawing

Light sensor circuit
Schematic drawing for the light sensor module; with AVR ATmega8, LED display and TSL250R.

Source code

uCtrlHQ/AVR-Light-sensor-with-LED-display

Measures light intensity and shows the value on a LED display, written with BASCOM-AVR.

Master Releases


0 0 0 v1.0 Visual Basic 3 months ago

Image gallery

Parts list

Project: Light sensor with LED display by Thomas Jensen is licensed under CC BY-SA 4.0 with attribution required.

Similar projects


  •   Created Mar 13, 2007
  •   Last modified 1 month ago
  •   Project status: Completed

Comments