Professional Documents
Culture Documents
machinery at their beckon call. Loss through veins and arteries body. Subtracting this percentage
Seeing into the body brings from 100% gives you the percent-
Loss through tissue and bones
with it the advantage of noninva- age of light absorbed by the body.
sive diagnosis. Luckily for Time
Arteries and veins carry blood
patients, bloodletting pretty much throughout the body. They expand
has been replaced as a cure-all. In Figure 1—Check out how various tissues and bones can absorb light trans- and contract with each heartbeat.
fact, many of today’s medical pro- mitted through the body. As blood flows through the circulatory system, it During the systolic phase, the
changes density because of the heart’s pumping pressure.This change also
cedures don’t require a patient to heart contracts, pushing blood into
changes the absorption rate of light, effectively modulating the light absorp-
be opened up at all. Various endo- tion. The total light absorption is a combination of modulated and constant arteries, capillaries, and veins.
scopic surgical techniques require absorption, which is similar to a small AC noise riding atop a DC voltage. Blood flows back to the heart from
DIGITAL CONNECTION
Unlike Analog sensors, the
TSL230R doesn’t require an A/D con-
verter to get values into a microcon-
troller. The TTL-compatible output
makes a direct interface possible to a
microcontroller without the need for
analog signal conditioning. If the sen-
sor is at any distance from the rest of
the electronics, a shielded cable isn’t
necessary because low-level noise sen-
sitive signals aren’t used. Applying the
sensor’s frequency output to a micro-
controller’s external interrupt input
can simplify period or pulse counting.
Although I hope the final circuit won’t
need any active mode control for the
TSL230R, having total control of the
mode input pins makes experimenting
much easier. A PIC running at 4 MHz
has a 1-µs execution cycle, which is a
Period (microseconds)
timebase can count up to approach uses Timer1’s
3,900
~65 ms before rolling over. overflow (31.25-ms sam-
The timer’s count is 3,800 pling timer) to read the
directly related to the irra- 3,700 accumulated period count
diance level. The smaller 3,600 and then flush it every
the count, the higher the 3,500
sample period. The external
frequency and the more interrupt is always enabled.
3,400
light falling on the sensor. Each rising edge of the
1 33 65 97 129 161 193 225 257 289 321
To make sense of this, you TSL230R’s frequency out-
32 Samples per second
need to grab samples at a put adds one to the num-
fixed rate (at least two ber of periods. The accu-
Figure 5—This Excel chart displays imported sample values over time. Samples of the
times faster than the fre- output frequency (30 samples per second formatted in microseconds) were sent out the mulated count at each sam-
quency of interest – serial port and captured to a file by HyperTerminal. ple time is the sum of all
Nyquist). For 200 bpm, or the periods output during
3.3 bps, that would be approximately light-sensitive array. Although the that sample time. This is essentially a
7 Hz. I used a sample rate of 32 Hz sensor doesn’t produce zero frequency period average for that 31.25 ms.
(31.25 ms) for this project because it output for zero irradiance, the output
fits nicely into this timer’s range. is linear. Using the most sensitive SAMPLING
Timer1’s overflow is set to 31.25 ms mode, the maximum frequency could Next month, I’ll describe the process
by loading the timer’s count with a be 100 kHz (130 µW/cm2 at 640 nm) of choosing the appropriate mode and
constant at each overflow. Because of with a minimum frequency of approxi- making sense out of the samples. In the
interrupt latency and instruction cycles mately 1 Hz. This maximum frequency meantime, study Figure 5, which shows
for the interrupt routine code up to the equals a Timer1 count of 10 with a some TSL230R samples. I used the on-
point where the timer is loaded and Timer1 overflow at a minimum fre- board UART to dump each sample in a
begins counting, the actual value placed quency because the 16-bit timer over- five-digit decimal number (followed by a
in the counter will be less than what’s flows at approximately 31 ms. CR). I imported these into Excel and
required for 31,250 counts. The timer The only way to achieve a minimum used the graphing function to show you
counts up to overflow, so the required frequency is with little or no irradi- what’s going on. I’ll use this to deter-
value of counts must be subtracted ance. A Timer1 overflow can indicate mine how to manipulate the data into
from the rollover count (or the value an error or too little light. Too much an indication of beats per minute. I
complemented). A simulator (with a light is a bit trickier to detect. A count
stopwatch or instruction counter) is of 10 would be impossible to detect in Jeff Bachiochi (pronounced BAH-key-
helpful for determining the exact value this case because the code execution AH-key) has been writing for Circuit
necessary to obtain accurate timing. for the interrupt lasts longer than the Cellar since 1988. His background
The frequency of the TSL230R will 10 µs for a period. So, counting edges includes product design and manu-
increase as more light falls on its (periods) would be missed and the facturing. He may be reached at jeff.
count wouldn’t be accu- bachiochi@circuitcellar.com.
rate.
The instantaneous sam- RESOURCES
pling approach requires
Omimeter.org, “Principles of Pulse
the frequency to be meas-
Oximetry Technology,” 2002, www.
ured once each sample
oximeter.org/pulseox/principles.htm.
period. This is achieved by
enabling the external inter- TAOS, Inc., “Pulse Oximetry,” www.
rupt each time Timer1 taosinc.com/downloads/pdf/pulse.pdf.
overflows (31.25-ms sam-
———“TSL230R, TSL230AR,
pling timer). After the
TSL230BR: Programmable Light-to-
external interrupt is
Frequency Converters,” TAOS048A,
enabled, Timer1’s count is
2004.
sampled twice on each of
the next two rising edges
of the TSL230R frequency
SOURCE
Photo 2—The TSL230R’s frequency output displayed on my oscilloscope
output. The difference in TSL230R Light-to-frequency converter
shows a slow frequency jitter marked by the vertical cursors. The output
frequency shifts with the varying amount of light absorption because of the two counts equals the TAOS, Inc.
the blood pulsing within the light’s path. period of the output in www.taosinc.com