Arduino Interfacing TSL230R Light Frequency Converter
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
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
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
View output on I2C lcd Display.
Arduino code for this project: arduino_tsl230r.txt.
- Arduino Projects Revisited Revised
- Schematic for Following Projects
- Programming ADS1115 4-Channel I2C ADC with Arduino
- Arduino uses ADS1115 with TMP37 to Measure Temperature
- Connect Arduino to I2C Liquid Crystal Display
- Arduino Reads Temperature Sensor Displays Temperature on LCD Display
- Arduino with MCP4725 12-bit Digital-to-Analog Converter Demo
- Arduino with ADS1115 4-Channel 16-bit Analog-to-Digital Converter
- Arduino with MCP4725 12-Bit DAC
- Display Time/Date with Arduino, LCD Display, and DS1307 RTC
- Testing the Keyes IR Sensor Module with Arduino
- Arduino with Serially Interfaced MAX7219 Operates 8X8 LED Matrix
- Arduino RTC Clock with MAX7219 8-Digit LED Display
- BCD Conversion with Arduino Displayed on MAX7219
- Connecting the ATMEGA168/Arduino to MCP23016 and LCD Display
- Display Time-Date with Arduino, LCD Display, and DS1307 RTC
- Controlling Low-Voltage Driveway Lights with the Arduino
- Hatching Chicken Eggs with ATMEGA168/Arduino
- TSL230R Light to Frequency Converter and Arduino
- Interfacing Arduino to the MCP23016 I/O Expander
- Arduino with a DS1307 Real Time Clock
- Using a Unipolar Stepper Motor with a Arduino
- Arduino with the TA8050 Motor Controller
- Arduino with a 24LC08 Serial EEPROM
- Hardware Interrupts Demo and Tutorial for Arduino
- Micro-controller AC Power Control Using Interrupts