You are on page 1of 15

Rev B

TSL230EVM
Users Guide
An Evaluation System Interfacing the TSL230/TSL235/TSL245 Light-to-
Frequency Converters to a Microcontroller

DESCRIPTION
INTRODUCTION
The hardware portion of the TSL230
The TSL230/235/245 family of Light-to- evaluation module consists of a TSL230,
Frequency Converters has greatly simplified the TSL235, TSL245, a microcontroller (MCU) , an
problem of getting light intensity information into LCD module, RS-232 interface, power supply
a digital system. This evaluation module and support components mounted on a printed
illustrates simple hardware and software circuit board. The system is self-contained with
techniques for interfacing the light-to-frequency two on-board N-cell batteries, or it may be
converters to a microcontroller and processing the powered from an external 3V supply (with on-
information. With the built-in serial PC interface board batteries removed). The module has several
the TSL230EVM provides a hardware and operating modes which are controlled by five
software platform for evaluation of the devices in push-button switches. Software in the MCU
several light measurement applications. performs period, frequency and ratiometric
measurements on the output from the three on-
PURPOSE board sensors. Output is displayed on the LCD
and can be transmitted to a PC via an RS-232
The evaluation module shown in Figure 1 connection provided by an RJ11 modular jack.
illustrates the use of the TSL230, TSL235, and
TSL245 devices in ambient, transmissive, and The TSL230 programming pins (S0, S1, S2
reflective light measurement applications, and S3) are controlled by the microcontroller
respectively. The output of the sensors can be parallel port pins PA0 - PA3 (refer to schematic
monitored on the LCD display, or interfaced to a in Appendix). The logic state of PA2 and PA3
personal computer via the serial port. Windows determine the input sensitivity and the logic state
software is provided for demonstration of several of PA0 and PA1 control the output scaling. The
light sensing applications. This platform provides output of the TSL230 is connected directly to the
the hardware and software necessary to evaluate timer capture (TCAP) pin of the MCU. The
the light-to-frequency converters in a variety of TSL235 and TSL245 outputs are multiplexed
applications and configurations. through the 74HC126 (quad bus buffer) to the
TCAP pin. The MCU parallel port pins PA6 and
PA7 are used to select either the TSL235 or the
TSL245 outputs. A logic high on PA6 selects the
TSL235 output; taking PA7 high selects the
TSL245 output.
LIGHT-TO-FREQUENCY CONVERTER EVM

TSL235 TSL230 TSL245

3V POWER SUPPLY

Tx / Rx
ON
MPU
1 2 3 4 5

OFF
S0 S1 S2 S3 MODE

Figure 1. TSL230EVM

The LCD (DMC16117) is interfaced to the TSL245 reflective configuration. The current
MCU via 8 data lines connected to ports PC0- through each LED, and thus the amount of light
PC7, and three control lines connected to ports emitted by each LED, is controlled via a simple
PB5-PB7. Port PB7 provides the read/write digital-to-analog converter comprised of resistors
signal (R/W) to the display. PB6 provides the and MCU-controlled digital outputs. Resistors
register select signal (RS), and PB5 provides the R2, R9 and R10 along with ports PB0, PB1, and
enable signal (E). output 3 of the HC126 control the current
through D3. Resistors R11 and R6 along with
There are two light sources on the EVM. D3, port PB3 and output 4 of the HC126 control the
a red LED operating at a wavelength of 660nm, is current through D4. MCU ports PB2 and PB4
the source for the TSL235 transmissive enable outputs 3 and 4 of the 126,
configuration. D4, an infrared (IR) LED
operating at 880nm, provides the IR light for the

2
Rev B

OPERATION
Table 1b. TSL230 Output Scaling Options The TSL230 EVM may be powered either by
S3 S2 OUTPUT SCALING two N-cell alkaline batteries on the board, or by
L L 1 an external 3VDC power supply (with the
L H 2 batteries removed from the EVM). Turn on the
H L 10 EVM by moving the slide switch to the up
H H 100 position. The display will read TSL230EVM
Ver1.0. The TSL230EVM may be operated
Table 1a. TSL230 Sensitivity Options stand-alone or in a slave configuration under
S1 S0 SENSITIVITY control of a PC running the TSL230EVM
L L Power Down software. Both types of operation are described.
L H 1x
H L 10x
H H 100x
Stand-alone Operation
The TSL230EVM has three modes of stand-
alone operation. Each mode is associated with
respectively . The quad bus buffer is used in one of the three on-board sensors. Mode 1 utilizes
conjunction with the lower-valued resistors the TSL230, Mode 2 utilizes the TSL235, and
because of its higher current sinking capability. Mode 3 utilizes the TSL245. The three modes are
accessed by pressing the MODE button. When
The MAX218 (dual RS-232 transceiver) the EVM is first turned on, it is in an idle state; no
provides the RS-232 interface to a PC via the mode is selected. Pressing the MODE button
RJ11 jack (JP1). In addition to generating the once puts the EVM in Mode 1 (TSL230).
nominal 6V for the RS-232 lines, the MAX218 Pressing the MODE button again puts the EVM
is used to power the LCD module, which requires in Mode 2 (TSL235), and pressing it a third time
a 5V supply. The MCUs on-board serial puts the EVM in Mode 3 (TSL245). Pressing the
communications interface (SCI) provides the MODE button from Mode 3 puts the EVM back
serial communication function via receive input in Mode 1. Buttons 1 through 4, also labeled S0,
PD0 and transmit output PD1. Port PA4 is used S1, S2, and S3, perform different functions
to shut down the MAX218s switch-mode power depending on the current mode (see Table 2).
supply (disabling the transmitter and the LCD
module) to save power when the EVM is idle. Fluorescent Lights
Fluorescent lights are the most common source of
The TPS7248 is a low-dropout regulator AC light noise (flicker) in transmissive (Mode 2)
used to regulate the nominal 6V provided by the and reflective (Mode 3) measurements, and can
MAX218 down to 4.8 volts for the LCD module. cause erratic readings when making ambient light
measurements in Mode 1. Since this type of
lighting is common in office and lab
environments, it is difficult to avoid these
problems when using the TSL230EVM. A
common technique to minimize these effects is to
sample the sensor at an interval which is an exact
multiple of the period of the fluorescent light
flicker (120Hz or 8.33ms), so that the readings
are taken at the same point of the AC waveform
each time. This reduces the problem to that of a
DC offset. The problem is that even a small
deviation in this sampling interval results in a
beating effect with the flicker, showing up as a
Table 2. TSL230EVM Push-button functions
Mode 1 Mode 2 Mode 3
Button 1 Toggle S0 Ambient reject Ambient reject
Button 2 Toggle S1 Set reference Set reference
Button 3 Toggle S2 - -
Button 4 Toggle S3 LED boost (1-7) LED boost (on/off)
Button 5 Next mode Next mode Next mode

slowly changing ambient light reading. The first TSL230 Filter Cap
precaution is to shield any transmissive or The TSL230EVM is shipped with a filter
reflective experiments from ambient light as much cap fitted over the top of the TSL230. The filter
as possible. The alternative is to synchronize the is Hoya CM500 infrared-blocking glass used to
sampling interval with flicker frequency. This approximate the photopic human eye response.
technique is incorporated into the PC software This filter is used in conjunction with the
(see Ambient Light Synchronize in the Software Photometer demonstration in the included PC
section for more information). software package. It can be removed or replaced
as desired for TSL230 evaluation.

Sleep Mode
The TSL230EVM will automatically enter Mode 2 - TSL235 Evaluation
power-saving sleep mode if the buttons are not Mode 2 allows evaluation of the TSL235 in a
pressed for 3 minutes. Press any button to wake transmissive light measurement mode. The
up the EVM. Note that although power TSL235 is mounted directly across from a 660
consumption is lower in sleep mode, the power nm red LED. The TSL235 senses the amount of
switch should be turned off to conserve batteries light directly emitted by the LED, or passed
when the EVM not being used. through some transparent or translucent medium.
In application, the TSL235 measures the
Mode 1 - TSL230 Evaluation transmittance of a translucent medium by
Mode 1 allows evaluation of the on-board measuring the amount of light that passed through
TSL230 device in general light measurement the medium.
situations. Buttons 1 through 4 toggle the state of From Mode 1, press the MODE button to
the programming lines S0 through S3 put the EVM in Mode 2. The display will read
respectively. The display indicates the current TSL235 nnnnn b, where nnnnn is the period
programmed state of the TSL230. On power-up, measurement of the output of the TSL235 in
the EVM defaults to 1x sensitivity and divide-by- counts (each count equals 4us), and b is the
100 output scaling. This corresponds to the states current LED boost setting (1-7). The count
H, L, H, and H for pins S0, S1, S2, and S3, ranges from about 8-10 counts to over 65000.
where H represents a logic high and L
represents a logic low. Refer to Table 1 for
information on the TSL230 programming options. Ambient Light Rejection
Pressing each of the buttons 1 through 4 (S0 - S3) Since the TSL235 is not optically shielded,
will toggle the state of the associated line. The the output signal represents a combination of
resulting change in the TSL230 configuration is direct light from the LED and interference from
displayed using the leftmost nine characters of the ambient light. The TSL230EVM can eliminate or
display. The rightmost five digits indicate the at least reduce this effect using ambient light
TSL230 output frequency in hertz. subtraction. This is accomplished by first
sampling the sensor with the LED off. This gives
a reading of the ambient light level. Then the

4
Rev B

LED is turned on and the sensor output is emission from the LED is shielded by a black
sampled again. The reading taken with the LED plastic sleeve over the LED, so during operation
off is subtracted, leaving just the component of the bulk of the signal would come from light
light from the LED. Note that if the ambient light reflected off of a surface in front of the sensor and
is brighter than the light from the LED, then the emitter. This configuration would be used for
reading will be erratic or zero. measuring the reflectance of a surface, or to
Pressing button 1 toggles the ambient light measure proximity of an object.
subtraction function on and off. An A appears
in the next-to-right-most position on the display Ambient Light Rejection
when the EVM is in ambient subtract mode. As in the transmissive configuration, ambient
light can have a significant effect on the sensor
output signal. Note that if the ambient light is
LED Boost brighter than the light from the LED, then the
Button 4 sets the LED boost level, or LED reading will be erratic or zero.
intensity. Pressing button 4 increases the LED To automatically subtract background light
intensity by one level. The highest boost level is from the reading, press button 1. Press button 1
7. The boost level setting is denoted by the again to disable the ambient light subtraction. An
number in the far right of the display. The boost A appears in the next-to-right-most position on
function is accomplished by using the boost level the display when the EVM is in ambient subtract
value to drive a simple DAC which controls the mode
LED current.
LED Boost
Transmittance Measurement Pressing button 4 turns the infrared LED
To measure transmittance of a medium, the boost on and off. When boost is turned on the
measurement system must first be referenced to a EVM puts more current through the LED by
standard for comparison. Reference calibration is placing a smaller value resistor in parallel with the
accomplished by measuring the light directly from existing one. The boost level setting is denoted by
the LED either with no media present, or with a the B in the far right of the display.
transparent or translucent reference medium in
place between the sensor and LED. To calibrate Reflectance Measurement
the EVM to a reference, first set up the reference As in transmittance measurements, reference
condition by placing the reference medium calibration must first be performed before a
between the TSL235 and the LED, as close to the reflectance measurement can be made. To
TSL235 as possible. If the period reading is high calibrate the EVM in Mode 3, first position the
(more than a few thousand counts) press button 4 EVM and reflectance standard as shown in Figure
to increase the boost setting until a lower reading 2 below. Press button 2 to calibrate to the
is obtained. Press button 2 to calibrate to the reference standard. After calibration the display
reference. After calibration the display will read will read REFLECT. nnn % where nnn is a
TRANSMIT. nnn% where nnn is a percent percent value between 0 and 100 representing the
value between 0 and 100 representing the ratio of ratio of the latest reading divided by the
latest reading divided by the reference reading. calibration reading.

Mode 3 - TSL245 Evaluation


Mode 3 allows evaluation of the TSL245 in a
reflective sensing configuration. The TSL245 is
mounted flat on the board, looking up, and
mounted next to a 940nm infrared LED. Side
"4800,N,8,1". All of the EVM commands are
single characters, which simplifies the
handshaking requirements between the host
(sending the command) and the EVM. Table 3
lists the EVM commands, and Table 4 lists the
EVM responses and data formats. The EVM
continuously sends the string *p every 5
seconds as a handshake signal. If idle, this tells
the host PC that the EVM is still connected and
operating. Once the EVM has received any serial
command, the EVM self-power-down function
will be disabled (until the next power-up). This
prevents the EVM from powering down during
TSL230EVM Reflective Object
serial communications. The EVM can still be
powered down via a serial command.
Figure 2. TSL245 Reflective Operation

Slave Operation Modes 1-3 - TSL230, TSL235, TSL245


The TSL230EVM automatically enters slave In Modes 1-3, the EVM transmits the period
operation when communication with the host PC count reading (each count corresponds to 4us)
is established. Normally when in the slave from the TSL230, TSL235, or TSL245,
configuration all user interaction with the EVM respectively, at regular intervals. The information
takes place via the graphical-user-interface (GUI) is transmitted in the normal format if the ambient
on the PC screen. Since the PC software controls light subtraction function is off, and in the
the EVM, and may rapidly change the EVM from background format if the ambient light subtraction
one mode to another, the EVM LCD will not function is on (see Table 4 for data formats).
always indicate the current operating state of the Note that in ambient light subtract mode, the
EVM and data displayed will not always match subtraction is not performed on the transmitted
that shown on the PC screen. data. Both LED and ambient readings are
transmitted and the subtraction is left to the
control program. This data packet is transmitted
Connecting the EVM to a PC at the interval set by the Update interval
A modular-to-female DB25 adapter and commands J - M (power-up default is 0.5s,
modular telephone-style cable are provided for see Table 3).
connecting the EVM to a PC. Insert one end of
the cable into the jack on the EVM, and insert the Modes 4-6 - Data Dump
other end of the cable into the adapter. Plug the Three additional modes, Modes 4-6, are
adapter into the male 25-pin serial port connector available on the EVM in the slave configuration.
on the PC. If the PC has only 9-pin serial port Modes 4-6 are referred to as data dump modes
connectors, then a user-supplied 25-pin to 9-pin and are used to transmit a predetermined number
adapter will be required. of period readings (data points) in rapid
succession via the serial port. The data dump is
Serial Communication very useful for analyzing transient or slowly
All functions of the TSL230EVM can be varying light signals. Modes 4-6 can be entered
accessed via the serial port with a dumb via the EVM Mode switch only when the EVM is
terminal or a PC running a terminal program operating in slave configuration, but may be
(such as Windows terminal) or application- entered at any time via serial command. The
specific software. Communications settings are: EVM automatically assumes slave configuration

6
Rev B

Table 3. TSL230EVM Commands The number of data points transmitted and the
sample period of the data can be set only through
COMMAND DESCRIPTION commands (A - G, see Table 3) transmitted to
0 Toggle S0 state in Mode 1
1 Toggle S1 state in Mode 1 the EVM via the serial port, and are not
2 Toggle S2 state in Mode 1 adjustable directly on the EVM. Commands E,
3 Toggle S3 state in Mode 1 F, G, and I set the time between data
4 Set EVM to Mode 1, TSL230
5 Set EVM to Mode 2, TSL235
points, or sample interval, to 0.015, 0.03, 0.06, or
6 Set EVM to Mode 3, TSL245 0.1s, respectively. Commands A - D set the
7 Set EVM to Mode 4, TSL230 Data dump number of datapoints sent before pausing to 128,
8 Set EVM to Mode 5, TSL235 Data dump
9 Set EVM to Mode 6, TSL245 Data dump
256, 512, or 1024. Note that the number of
A Data dump samples = 128 datapoints is always a multiple of two to simplify
B Data dump samples = 256 processing with algorithyms such as the FFT.
C Data dump samples = 512
D Data dump samples = 1024
There are data dump modes for each of the
E Dump sample interval = 0.015s three sensors: Mode 4 for the TSL230, Mode 5
F Dump sample interval = 0.03s for the TSL235, and Mode 6 for the TSL245. A
G Dump sample interval = 0.06s data dump can be started from the EVM by
H Starts and stops data dump
I Dump sample interval = 0.1s pushing button 1, or by sending an H command
J Update interval = 0.1s (Modes 1 -3 ) to the EVM. Once the predetermined number of
K Update interval = 0.5s (Modes 1 -3 ) data points is transmitted, the data dump is
L Update interval = 1s (Modes 1 -3 )
M Update interval = 10s (Modes 1 -3 ) automatically repeated after a short delay.
O Enable LED Boost Bit 0 Pressing button 1 again (or sending the EVM an
P Check EVM (Returns verxx; xx = revision ), H) will halt the transmission of data after the
NR
Q Mode inquiry (Returns a - g for Modes 0 - 6)*, currently active dump is complete. The data
NR dump can be stopped (interrupted) by sending the
R Set Mode 1 state to 1x, Divide-by-100 EVM the ! command. Note that Modes 4-6 are
S Enable LED Boost Bit 1
T Enable LED Boost Bit 2 not available when operating standalone.
U Enable IRED Boost
V Enable ambient subtract EVM Responses
W Disable ambient subtract
X Disable LED Boost1 and 2 In addition to sending data, the EVM sends
Y Disable IRED Boost certain characters to the host PC in response to
Z Shutdown EVM (sleep mode), NR events occuring on the EVM. The responses are
+ Increase update interval by approx. 4s
- Decrease update interval by approx. 4s preceded by an asterisk, *, to distinguish them
[ Decrease update interval by approx. 40s from data. The EVM acknowledges receipt of
] Increase update interval by approx. 40s most commands (see Table 3) by sending the
_ Reset update interval to default value
! Abort data dump (interrupts current dump),
ampersand @. The EVM sends a z just
NR before it powers down after about 3 minutes of
| (Pipe character) Pod reset to power-up state inactivity. A p is sent at approximate 5 second
(Mode 0), NR
* Mode 0 is the mode the EVM enters on power-up.
intervals as a handshaking signal to let the PC
NR - EVM does not acknowledge these commands with @ know that the EVM is connected. Responses are
also sent as a result of pushing the buttons on the
EVM so that the PC is aware of changes in the
when the PC responds to the handshake request,
settings made by the user (see Table 4).
*p, by sending a P or any other command.
DESIGN CONSIDERATIONS Table 4. TSL230EVM Responses

Description Format
Data Acquisition with the TSL230EVM Command acknowledge @
Primary considerations of a digital data Start of data dump #
End of data dump $
acquisition system, of which the main component Precedes EVM response *
is typically an A/D converter, include sampling EVM checking for PC *p
rate, sample resolution, and dynamic range Switch S0 pressed *0
Switch S1 pressed *1
(usually defined by the available resolution). In
Switch S2 pressed *2
the specific case of a system using the TSL-series Switch S3 pressed *3
light-to-frequency converters, the analog-to-digital EVM in Mode 0 *a
conversion function is performed by a current-to- EVM in Mode 1 *b
EVM in Mode 2 *c
frequency converter (on the chip) and the EVM in Mode 3 *d
conversion to digital data is completed by a EVM in Mode 4 *e
counter (usually on-board the microcontroller). In EVM in Mode 5 *f
EVM in Mode 6 *g
this situation the sampling rate depends on two LED Boost level 1 *q
things: the counting method and the signal LED Boost level 2 *r
amplitude (light intensity). Faster sampling rates LED Boost level 3 *s
LED Boost level 4 *t
are achieved by using period measurement LED Boost level 5 *u
techniques (measuring time between pulses); LED Boost level 6 *v
slower but typically higher resolution sampling LED Boost level 7 *w
Ambient subtract on *V
can be achieved by frequency counting (counting Ambient subtract off *W
number of pulses over a fixed time period). In IR Boost on *U
both cases, the sampling rate is limited by the IR Boost off *Y
light intensity, which determines the frequency Entering sleep mode z
Data format, normal <m>12345<cr><lf>
output of the converter. In the case of period where:
measurement, the maximum sampling rate is the <m> = mode ID (a,b,c,d,e,f,g)
12345 = 5 digit timer count or
inverse of the period of the output of the light-to- >>>>> if overrange
frequency converter, since at least one period <cr> = carriage return (ASCII 13)
must be measured to get a data point. <lf> = line feed (ASCII 10)
Data format, ambient <m>12345|67890<cr><lf>
Resolution in the case of the frequency subtract on where:
output converters is determined by the speed of <m> = mode ID (a,b,c,d,e,f,g)
12345 = 5 digit timer count (LED on)
the measurement clock (for period measurement) 67890 = 5 digit timer count (LED off)
or the frequency counting period (for frequency or >>>>> if overrange
measurement). Dynamic range is determined by <cr> = carriage return (ASCII 13)
<lf> = line feed (ASCII 10)
the output frequency range of the light-to- Notes: 1) Each timer count represents 4s
frequency converter and the counting range of the
counter. the frequency measurement technique in order to
In the design of the TSL230EVM, two utilize the timer capture function. Dynamic range
system-level constraints governed the hardware of this system is determined by the hardware timer
design and dictated the ultimate performance and is 65535 (maximum number of counts)
limitations of the system: the board must operate divided by 10 (approximate minimum number of
on two 1.5V batteries, and component count must counts due to software overhead latency in the
be minimized. timing loop) or 6553:1, approximately 72dB, or
These constraints placed several limits on the equivalent of a 12-bit A/D converter.
hardware choices. An eight-bit microcontroller The 3-volt operation constraint places an
with a 16-bit on-board timer with an input-capture upper limit of 2MHz on the microcontroller clock.
function was chosen for frequency measurement This translates to a 4s resolution (due to internal
and system control. Period timing was chosen as divide-by-8) for period measurement, with an

8
Rev B

lower limit of 65535 * 4s, or 262ms (3.8Hz) and


an upper limit of 10 * 4s, or 40s (25kHz).
Note that in contrast to typical data acquisition Hardware Design
systems which utilize an A/D converter, with the The design of a light measurement system
period measurement technique the best accuracy using the light-to-frequency converters is
is obtained at the lower end of the input range relatively straightforward. As with most
(where the number of counts per period is high) embedded systems, most of the power and
rather than the upper end (where the number of functionality lies in the software. The main
counts is low). Thus for greatest measurement constraints on the EVM design, as mentioned
accuracy, signals should be kept out of the upper above, were simplicity and three-volt operation.
end of the input range. For example, for the For simplicity, only the required components
TSL230EVM to maintain a measurement were used on the EVM design. Functions
accuracy of 1% or better, the signal must be kept necessary or desirable on a real-world application
below 2.5kHz (100*4us = 0.4ms, 1/0.4ms = such as power supply regulation, voltage
2.5kHz). supervisor, and dedicated LED drivers were
Measurement time in this system is the omitted from the EVM.
period of the input signal plus an additional One issue that had to be addressed during the
constant amount of time for software overhead development of the EVM was the use of low-
and transmission of the data through the serial dropout regulators with a current-limited source.
port. In order to maintain a constant sampling Since the LCD module requires 5 volts, and the
rate, the period of the signal must be kept well battery supplies only 3 volts, the higher voltage
under the sampling period thus limiting the low must be obtained from the MAX218 RS-232
light measurement level of the system. driver. Since only one of two transmitters is being
Another data acquisition issue worth noting used, the 6.5 volts for RS-232 transmission is
here is that of signal aliasing. Conventional DA available at low-current from the V+ line on the
systems utilize low-pass filters on the input of the MAX218. A conventional low-dropout regulator
A/D converter to eliminate frequency components was originally specified in the design to generate 5
above one-half the Nyquist frequency (the volts for the LCD. On power-up, however, the
sampling rate). This eliminates the phenomenon LDO regulators pnp pass transistor generated a
known as aliasing, in which frequency transient high-current load which exceeded the
components at greater than 1/2 the sampling rate supply capability of the MAX218. The TPS7248
appear as lower frequency components in the micropower LDO voltage regulator eliminates this
recovered data. In the case of TSL-family light- problem through the use of a PMOS pass element.
to-frequency converters, addition of an anti-
aliasing filter is not possible since the circuitry is
contained on the chip. If the waveform of a
modulated light source is to be recovered PC SOFTWARE
accurately, the Nyquist criteria must be observed.
This implies that the sampling rate (1 / (output System Requirements
period + overhead)) must be at least twice the
frequency of the highest frequency component in Due to the real-time operating requirements and
the light signal. This imposes a constraint on the graphical nature of the EVM software, a
maximum period and, thus, the lowest acceptable 486/33MHz or better PC running Microsoft
light level. In cases where this requirement cannot Windows and DOS 3.1 or later is recommended.
be met the signal of interest may be recoverable
Installation
only if certain aspects of the signal, such as its
frequency range and amplitude relative to the To install the TSL230EVM software:
other frequency components, are known. 1. Insert the disk in drive A: (or B:).
2. From Program Manager, choose File, Run.
3. Type a:setup (or b:setup) and press Enter. compensating filter (Hoya Optics CM-500) used
to block infrared light above about 700nm (see
After installation, go the TSL230EVM group and Figure 3). This corrects the TSL230 sensors
double click the TSL230EVM icon to run the spectral response to approximate that of the
program. human eye. This type of response, also known as
From the main screen, there are six buttons, the photopic response, is useful in applications
one for each of the applications within the such as camera exposure control, lighting control,
TSL230EVM software. The six applications are and display contrast control, where a
described below. measurement of the perceived brightness ambient
light is required.
Help
Launches the help system.
Spectral Response
Photometer TSL230 with Hoya CM500 Filter Cap
Simulates a basic hand-held photometer 1

0.9
instrument using the TSL230 and the supplied

Normalized Response
0.8
filter cap. 0.7
0.6
0.5
Datalogger 0.4
Logs data collected from the EVM to a disk file 0.3

and displays it on the screen. 0.2


0.1
0
TSL230 Demo 300 400 500 600 700 800 900

Demonstrates the various features of the TSL230 Wavelength (nm)

on a graphical user interface.


Figure 3. TSL230 Response with Filter Cap
Heart Rate Monitor
Recovers pulse waveform and determines heart
rate by passing light through the fingertip.

Proximity Detector Operation


Indicates relative distance of an object from the To start the photometer application, click the
EVM by reflecting infrared light off of the object. Photometer button from the main screen. To quit
the Photometer application, click the Close button.
For detailed information on the individual Please note that the purpose of the photometer
applications, consult the on-line Help system. application is to demonstrate the use of a color-
correcting filter with the TSL230; it is not
Photometer Application intended for use as a measurement instrument.
Accuracy of the readings obtained are influenced
Description by the TSL230 absolute output frequency
The photometer application simulates the tolerance (5%), and the fact that the filter provides
operation of a simple hand-held-type photometer. a reasonable, but not exact, approximation the
To run the photometer application, first place the photopic response curve.
filter cap (included with TSL230EVM kit) firmly
over the TSL230 device on the EVM. Make sure
the cap is centered over the square chip inside the
TSL230 by sighting through the hole in the cap.
The filter is a commercially available color

10
Rev B

Datalogger Application frequency is displayed in real-time in the on-


screen counter display.
Description
Operation
The main function of the datalogger
application is to collect data from one of three To run the TSL230 Application, click the
sensors (TSL230, TSL235, or TSL245) on-board TSL230 Application button on the main screen.
the EVM, and save the data to a disk file. The The application form will appear, and will begin
datalogger also provides a real-time graphical running automatically. Press the red Stop button
display of the signal on a simulated chart in the lower-right corner of the screen to exit the
recorder. The number of datapoints to be application and return to the main screen.
collected and the time interval between the
datapoints is user selectable. Depending upon the ambient light level, the
The datalogger application is useful for TSL230 may cause the counter to go overrange or
monitoring a light source over a period of time, or underrange with the default sensitivity and output
for monitoring a process optically using the EVM scaling setting. Click the toggle switches to
sensors. change the state of the programming lines to
change the mode of the TSL230 and observe the
Operation resulting output frequency changes.
To start the Datalogger application, click the
Datalogger button on the main screen. When the
Heart Rate Monitor Application
Datalogger form appears, select the sensor,
number of datapoints, and interval. If you are
logging data from the TSL230, you should first Description
set the sensitivity and output scaling so that the The Heart Rate Monitor application
operating range will be appropriate for the demonstrates the use of a TSL235 in a highly-
lighting conditions (100-5000 counts as indicated demanding transmissive-sensing application. The
in the Sensor Output window). Click the Start TSL235 is used to recover a low-level, frequency
button to begin datalogging. To exit the modulated light signal (the heart rate) through a
Datalogger choose Exit Datalogger from the File transmissive medium (the flesh of the finger).
menu. This commonly used technique is based on the
fact that the amount of light passed through the
TSL230 Application flesh is modulated by the pulsating blood flow
through the capillaries. The frequency of this
Description modulated signal is the heart rate. The waveform
The purpose of the TSL230 Application is to of this pulsatile signal is called a plethysmograph.
demonstrate the operation of the TSL230 Light- This AC waveform rides on a DC level (the light
to-Frequency converter. The application does this which passes through the tissue without being
through the use of a graphical representation of a absorbed or scattered) and can vary in magnitude
circuit breadboard, in which a TSL230 is from less than 0.01% to greater than 10% of the
connected to a counter with toggle switches DC level.
providing the input voltage levels to the The Heart Rate Monitor application uses the
programming lines. Toggling the switches on- Fast Fourier Transform (FFT) and digital filtering
screen (with the exception of the OE switch) techniques to determine the frequency of the heart
changes the logic state of the corresponding line of rate component of the signal, filter out unwanted
the actual TSL230 device on-board the EVM. signal and noise, and display the resulting pulse
On-screen displays depict the current operating waveform on the screen. This operation does not
mode of the device, and the actual output occur in real-time, since the FFT requires a large
number of datapoints to accurately determine the
frequency of the signal.
Menu selections are provided for adjusting
the number of datapoints collected for the FFT
(256, 512, or 1024) and the sampling rate
(66.7Hz, 33.3Hz, 16.7Hz, or 10Hz). Default is
256 data points at 33.3Hz. Graphical controls
provide adjustment of the low-pass and high-pass
filter cutoff frequencies applied to the input
signal. The threshold control provides a means to
eliminate low-level noise in the signal.

Note: This heart rate monitor application is


meant to be used only as an example of a
transmissive light sensing application. It is
not suitable for use as a medical diagnostic
instrument. Making the Measurement
Click the Start button to start the data
Operation collection. Data collection time will range from
about 2 to 8 seconds depending upon the selected
To run the Heart Rate Monitor application,
number of datapoints and sampling rate.
click the Heart Rate button on the main screen.
Note that several physical factors will affect
To exit the Heart Rate Monitor application, click
the results of this demonstration. These include
the Exit button.
finger position, skin pigmentation, vascularity,
etc. Generally some experimentation is involved
Setup
in getting a good result. Along with slightly
To perform the heart rate test, extend your
varying the finger position and applied pressure,
finger and place it in front of the TSL235,
using a different finger can give a different result.
pointing down to the EVM, fingernail facing the
pink-colored LED (see Figure 3). Without flexing
Processing the Data
your finger, apply a light pressure on the board
After the data is collected, the data is
with your fingertip, and gently push your
processed and displayed on the screen. The
fingerprint into the face of the TSL235. Once in
software calculates the power spectrum, the time-
position, cover your hand and the EVM with a
domain pulse waveform, and the heart rate, if
dark cloth, or perform the experiment in a dimly
possible, in beats-per-minute. The fundamental
lit environment in order to reduce the interference
harmonic of the pulse waveform is used to
from ambient lights. You must hold extremely still
determine the pulse frequency, and is located by
while the data is being taken since any movement
finding the peak among the power spectrum
will interfere with the pulse signal.
components in the heart rate frequency range. If a
peak is not identified, then the heart rate is not
calculated and a message is displayed indicating
that the signal amplitude was too low to be
distinguished from noise and other extraneous
signals.
Once the data is displayed, additional
processing may be performed manually by
adjusting the low-pass and high-pass filter cutoff
frequencies, and by adjusting the threshold
control. Each time one of these controls is

12
Rev B

changed, the power spectrum is recalculated and multiple of the flicker frequency can reduce the
the new time-domain waveform is displayed. effect on the data by sampling the same place on
the flicker waveform each time, thus reducing the
interference to a DC level. Although the EVM
Proximity Detector Application uses this technique, slight variations in timing
from unit-to-unit make complete cancellation of
Description the flicker impossible. The Ambient Light Sync
The proximity detector application function allows the user to adjust the EVM
demonstrates the use of the TSL245 in a reflective sample frequency to provide almost complete
sensing mode. The TSL245 measures the light cancellation of flicker effects.
from the LED that is reflected off of an object in
front of the EVM. The relative amount of
reflected light is used as an indication of distance Operation
between the EVM and the object. A reference To activate the Ambient Light Sync form,
position can be set so that the proximity detector double-click on a blank area on any of the
gives and indication of how near or far the object application forms, but the Datalog application is
is from the reference position. This type of most effective for making this adjustment since it
function is useful in applications such as allows you to view the flicker effect (the beat
automatic faucets, safety shields, and process frequency between the flicker rate and the
controls. sampling rate) graphically.
Call up the Datalog application and use the
default settings (TSL230 source, 100 datapoints,
Operation 0.1Hz data rate). Expose the EVM to the ambient
To run the Proximity Detector application, light, start a datalog and observe the graph.
click the Proximity Detector button on the main Ambient light flicker will show up as a sinusoidal
screen. pattern, or just a slight undulation in the signal (a
When the application form appears, click flat line would indicate no interference). Double-
start to begin operation. The proximity indicator click a blank area on the form to invoke the Sync
will behave erratically until calibrated. To form. The Sync form allows you to adjust the
calibrate, place a reflective object within 3 to 12 EVM sample rate to synchronize with the ambient
in front of the EVM and click the calibrate button. light flicker. The double-arrow buttons increment
The proximity indicator should center itself. As (and decrement) by 10 and the single-arrow
the object is brought closer, the indictor will move buttons by 1. Click the double-arrow button to
up; as the object is moved away, the indicator will adjust the time by 10, then start a datalog.
go down. To exit the application and return to the Observe the graph for any change (reduced
main screen, click the Close button. pattern). Stop the datalog and repeat the process
until a change is observed. Note that the ideal
Ambient Light Sync adjustment could be positive or negative. Once
the graph becomes flatter, use the single-arrow
Description buttons to make fine adjustments until a
satisfactorily smooth graph is obtained. This will
As mentioned earlier, fluorescent lights with
be an interative process and may require a bit of
their flicker rate of 120Hz can be a significant
experimentation. Once a good result is obtained,
source of interference when using the
click the middle button (||) to close the Sync form
TSL230EVM. Since the light level is varying, the
and save the adjustment. The adjustment value
EVM sees a different ambient light level each time
will be saved to disk and will be used each time
it samples one of the sensors, causing erratic
the program is run, or until it is changed. The
output and making ambient light rejection
difficult. Sampling the sensor outputs at an exact
sync value may have to be readjusted over time or
if the EVM is moved to a different location.

14
LIGHT TO FREQUENCY CONVERTER EVM
VDD

U1
U2

44
4
R6 2 31 7 2
1 IRQ PC0 30 8 DB0 VDD
R7

1
1
RESET PC1 29 9 DB1 R3

VPP
+ C10

VDD
43 PC2 28 10 DB2 8.2K 4.7

1
+ OSC1 PC3 27 11 DB3
C1 Y1

1
2
4.7 2 R1 PC4 26 12 DB4 3
S0

2
1 2 2MHz 1M PC5 25 13 DB5 VO

2
1
PC6 24 14 DB6
R4

2
1 42 PC7 21 5 DB7 300 U7

3
VDD OSC2 PB7 20 4 R/W 1
S1

1
1 2 PB6 19 6 RS 1 7 SE
PB5 E GND 8 OUT 5
2 U3

2
5 1 10 4 OUT IN 6
R2 H2570
VCC SO 2 9 PA2 13 1 2 3 EN IN
S1 7 12 PA3 PB0 GND
S2 1.8K
1 2 3 S2 8 11 PA0 D3 TPS7248Q
4 OE S3 6 41 PA1 14 1 R9 2 2 1
GND FO TCAP PB1 VDD
3 820 SL
TSL230
1 R10 2
S3
1 2 R1 34 160
35 PD2
4 R2 D4
36 PD3 16 1 R11 2 2 1
R3 VDD
37 PD4 PB3
MODE R4 110
1 2 39 PD5 VDD IR
R5 R6
2 1 PD7 1 2 15uH
5
R12 L1 DS1 MMBD5060LT1
56
VDD 10K U8 1 21 3
C3
2 3

1
1

1A 1Y 6 4.7
U5 + + C2
2 5 2Y 1 6 8 1.0
19

VDD 2A 1G PA6 PA4 U4


1 3 14 4 5 32
GND OUT VDD VDD 2G PA7 PD0
10 15 33 18

1
2
2

LX
V+

C14 3G 13 17 PB2 PD1 6 C+


TSL235
1
Appendix

VDD .1 9 4G 8 PB4 4 VDD + C4

VSS
12 3A 3Y 11 3 EN .47

2
7 4A 4Y 68HC705C8 9 SHDN 16
U6
GND R1OUT C1-

22
2 8 JP1
2

1 VDD 3 5 T2IN
74HC126 Tx/Rx
GND OUT 17 GND 12
1

R13 20 GND R1IN 13 5 1


TSL245
10K 7 GND T2OUT 15 3 2
T1IN V- 6
2
4

C5
1.0
2

MAX218
BT1 PS1 +
2 1 1 2 VDD
1

VDD
R5
3V POWER 1 MIXED SIGNAL PRODUCTS
R1 2
VDD R2 3 13532 N. Central Expressway
R3 4 S/C Bldg. M/S 93
R4 5 Dallas, Tx. 75265
C8 C9 R5 6 Draftsman Tim Flanigan

1
1
1
1
1
1
1
C6 C7
.1 .1 .1 .1 + C11 + C12 + C13 R6 7
6.8 6.8 6.8 R7 8 Size Document Number Rev
A LIGHT TO FREQUENCY CONVERTER EVM A

2
2
2
2
10Kx7

2
2
2
Date: Thursday, August 03, 1995
Rev B

You might also like