TS1230a internal schematic
Internal Schematic

Arduino Interfacing TSL230R Light Frequency Converter

by Lewis Loflin


The purpose of this page is to demonstrate the operation of the TSL239R light to frequency converter. The device outputs a 50% duty square wave whose frequency is proportional to light intensity. Not only can the TSL230R be used for detecting light intensity to adjust say lighting levels, it's sensitive enough to be a motion detector by measuring small changes in light level due to the motion of an object.

The program below is very basic in measuring the positive on time of the square wave and calculating the frequency, acting as a crude frequency counter. The same basic setup can be used with any number micro-controllers.

Download spec sheet (PDF)


The TSL230R provides three levels of sensitivity (in addition to an off state) to accommodate the measurement of nearly any light intensity.

This is accomplished by dividing the photodiode array into sections which can be enabled or disabled to provide the needed sensitivity. The sensitivity is set by setting the appropriate levels on control pins S0 and S1.

S1    S0    Sensitivity
0     0     off
0     1     x 1
1     0     x 10
1     1     x 100

Output Frequency Scaling

The raw output frequency can vary from approximately 1 Hz to over 1 Mhz. Since the top frequency output is so high that some micro-controllers, such as the BASIC Stamp, are unable to measure the frequency, two pins (S2 and S3) on the TSL230R are provided as a frequency divider setting making it possible to measure the output frequency with slower micro-controllers.

S3   S2   Divide output by
0     0   1
0     1   2
1     0  10
1     1  100
Arduino connected to TS1230
Basic Schematic

Pin out on TSL230R:
1 S0 Sensitivity select input
2 S1 Sensitivity select input
3 OE Output Enable
4 GND Ground 0 V
5 VCC/VDD +3 to +5 VDC supply voltage
6 Scaled-frequency output
7 S2 Scaling select input
8 S3 Scaling select input

I2C LCD display connections.
Basic Schematic

View output on I2C lcd Display.

Arduino code for this project: arduino_tsl230r.txt.