Abstract
A measuring medical pocket calculator is presented. The hardware is built around a BASIC-Stamp microcontroller and includes a keyboard, a liquid crystal display, a dual analogue-to-digital converter, digital outputs and a serial port for data exchange with a personal computer. The software is based on a generic programmable calculator and can be adapted to suit specific applications. As an example, a dedicated audiologic calculator is presented. It features one-key conversions between different measures of acoustic levels, a hearing aid battery tester, automated calculation of percent hearing loss, and frequency specific, age-corrected comparisons (percentiles) to hearing thresholds of the general population.
Keywords
Introduction
Since their humble beginnings [1] pocket calculators have become ubiquitous accessories of everyday live. As mass products, they tend to be cheap and it is not usually considered sensible to build or to develop a calculator for a specific application.
Despite desktop and laptop computers and personal digital assistants (PDA), pocket calculators are used frequently in medicine to calculate formulae of low to intermediate complexity like the body-mass-index [2] or the percentage hearing loss of an ear from its hearing threshold [3]. Advantages include virtually no start-up time and no time to select the necessary software application, high portability, and no need to look at or to place a large computer screen between the physician and the patient. In settings where oral communication with patients is often difficult, such as in an audiologic department, sharing numbers and calculated results with patients can often be facilitated by showing the patient the calculator's display. This is usually easier than pointing out single numbers in small fonts on a complex computer screen.
Specialized medical calculators do exist for some medical areas and commercially available programmable calculators can be turned into medical calculators. However, we found that medical personnel may be wary of calculators with too many keys and functions, which they do not need and the meaning of which they may not fully understand.
With the advent of cheap and powerful microcontrollers, it has become possible to build your own pocket calculator meeting the needs of your specific medical field. As some of these controllers have substantially more capabilities than needed in normal calculators, useful additional functions can be implemented surprisingly easy.
We present a prototype of a pocket calculator based on a flexible design [4] optimized for its application in audiology, which eliminates the need of look-up tables and error prone calculations even when a personal computer is not readily available or the right software is not currently running. It has the additional benefit of performing simple yet useful measurements.
Basic Design
A pocket calculator, based on BASIC-Stamp microcontroller system (Parallax Inc., Rocklin, CA, U.S.A.) was built [4]. Figure 1 shows a block diagram of the hardware. Besides the keyboard and a 2-line alphanumeric liquid crystal display, a dual A-D converter (12 Bit resolution, type LTC1298, Linear Technology, Milpitas, CA, U.S.A.), a 4 bit digital output (TTL-level) and a serial port for data exchange with a personal computer are included.

Block diagram of the calculator.
The type of BASIC-Stamp microcontroller chosen (BS2p24) features 8k Bytes of EEPROM for program and/or data storage and can be programmed conveniently in a Basic dialect called PBASIC. If more memory or higher speeds are needed, adequate pin compatible devices are available.
First, a basic programmable calculator was programmed [4]. This basic calculator comes in two versions: one featuring reversed polish notation (RPN) and one with algebraic data entry. As an example, to add 3 and 5, the key sequence would be [3] [ENTER] [5] [+] for the first version and [3] [+] [5] [=] for the latter. A limited set of higher mathematical functions (e.g. square root, logarithm), 14 independent memories and a basic programmability with up to 1024 program steps, conditional and unconditional branching are part of the basic design. All of these features combined take up approximately 66% of the available memory, leaving sufficient room for application specific additions.
A Pocket Calculator for Audiology
Starting from this basic design, a dedicated pocket calculator for the use in audiology was built and programmed. To free keys for frequent audiologic calculations, some mathematical functions considered less important for the task at hand such as absolute values, or the integer part of a number, were removed. Other functions, including a basic programmability were kept. The following specialized calculations for audiologists were added:
Calculation of percentage of hearing loss from hearing thresholds according to the method proposed by the American Medical Association, Council of Physical Therapy (CPT-AMA) Table [3, 5, 6].
Percentage of population with poorer hearing thresholds as a function of frequency and age [7]
Conversion of linear amplitude to decibel (dB) and vice versa.
Conversion of dB Sound Pressure Level (dB SPL, i.e. reference is 2.10−5 Pa) to dB Hearing Level (dB HL, reference is hearing threshold of young normal hearing adults) and vice versa as a function of frequency.
Measuring the voltage of batteries for hearing aids and speech processors for cochlear implant battery under 1 kOhm load and unloaded.
Figure 2 shows an internal view of the prototype, Figure 3 an external view. The complete prototype measures 14.4 cm x 8.5 cm x 3.0 cm (front) or 5.5 cm (rear end) and works from a 9V battery with the option to use a mains adapter.

Internal view of calculator with BASIC-stamp (centre of right-hand-side).

External view of the prototype calculator.
Figure 4 shows typical displays for the calculation of the percentage of hearing loss from hearing thresholds according to the method proposed by CPT-AMA and for the percentage of the general population with poorer hearing thresholds as a function of frequency and age. Note that the displays differ considerably from the normal calculation mode depicted in Figure 3. One advantage of the flexibility using PBASIC rather than off-the-shelf programmable calculators, to define the functions of each and every key as well as the exact appearance of the display and still maintain very fast responses of the calculator.

Examples of display in special audiologic modes: calculation of hearing loss (top) and calculation of percentile of hearing threshold for a 50-year old male (bottom).
Example: Calculation of the Percentage of Hearing Loss
The table provided by the American Medical Association, Council of Physical Therapy (CPT-AMA) [3, 5, 6] is frequently used to derive the percentage of hearing loss from a measured hearing threshold. This table provides a percent value for each combination of 4 frequencies (500 Hz, 1000 Hz, 2000 Hz, and 4000 Hz) and each hearing threshold between 0 and 95 dB in steps of 5 dB. Summation of the values found at the listed frequencies and at the actual hearing thresholds for a given ear results in the percentage of hearing loss between 0% and 100%. The table is rather complex and takes into account e.g. that frequencies around 1000–2000 Hz are more important for speech understanding than lower and higher frequency bands, or that patients are affected less by an increase from 5 to 10 dB than an increase from 50 to 55 dB. As an example, a sloping hearing threshold of 25 dB at 500 Hz, 30 dB at 1000 Hz, 44 dB and 55 dB at 4000 Hz correspondents to the table entries of 1.8%, 5.4%, 17.3%, and 9.7%, or a total percentage hearing loss of 32.2%.
These calculations can be conveniently performed with the audiologic calculator with only a few keystrokes, e.g. for the hearing thresholds mentioned above, as follows:
This key sequence results in the display shown in the upper half of Figure 4, showing the correct result of 34.2% in the lower left. When the key [CPTAMA] is pressed the again, the calculator returns to the normal mode, displaying just the result in percent (in this case 34.2), which can be shown to the patient or directly used for further calculations.
Discussion
Clearly, all of the functions of the presented calculator can be obtained with other means. A battery tester and a desktop or laptop computer, a conventional programmable calculator, or even a very simple low-cost calculator complemented with a set of tables can all perform the same basic tasks, although it is known that with the last solution, more errors occur [8].
However, the approach using a dedicated application-specific calculator can give the desired information faster, with virtually no time between switching on the calculator and the start of the calculations, and using only one single device. As the function of each and every key can be defined separately by software, keyboards cluttered up with functions that may not even be understood by the end user can be easily avoided or be reprogrammed as 2nd functions, thus minimizing errors. A relatively small size and portability were found to be useful assets for routine work. Even the battery tester, as simple as it is, was found to be of considerable practical value. While doing nothing out of the ordinary, the application specific measuring calculator was found to be helpful in everyday routine work. Besides routine work, the calculator has also proved useful for audiologic research [9].
The audiologic calculator is just one example of a specific application. Other areas of medicine will require other calculations and/or use different tables. Such examples for other applications might be calculation of the Body-Mass-Index (BMI) or similar measures or percentile curves and tables detailing the growth of children. It is relatively easy to implement more complicated calculations than the one used in the audiologic calculator. In the present application, the analogue inputs are clearly under-used, the digital outputs are not used at all. Currently, a new function allowing the calculator to be used as a audio-frequency oscilloscope to test the electrical outputs of wireless receivers for hearing aids for classroom use is being developed. This function might also be useful for calculators used in other areas of medicine.
The combination of the serial-port, the analogue inputs and a BASIC-stamp with more memory (e.g. BS2pe) opens the possibility of data-logging and a download e.g. to a spread-sheet program using routines which are readily available in the internet.
Summary
A measuring medical pocket calculator was presented. The hardware is built around a BASIC-Stamp microcontroller system and includes a 42-key keyboard, a 2-line alphanumeric liquid crystal display, a dual analogue-to-digital converter, 4 independent digital outputs and a serial port for data exchange with a personal computer. The software is based on a generic programmable calculator and adapted to the specific application at hand. As an example, dedicated audiologic calculator was presented. It features conversions between several measures for acoustic levels used in audiology, a tester for hearing aids batteries, and automated calculations of percent hearing loss, and an comparison to the age corrected hearing loss from given hearing thresholds. All keys can be associated by software to any of the basic or application specific functions, facilitating the design of calculators specific to other areas of medicine. With its capability to measure electrical parameters directly and to download data via the serial interface to a personal computer, special function outside the scope of commercially available calculators can be realized.
