"I think the TC-2000 will be our workhorse, even our calibration engineer hasn't seen anything this accurate. Again, thank you very much." -- Al Raimondi, AMSL-O
register login

 

ELECTRONICS 

Some knowledge of electronics is essential for the research scientist. Sadly, most undergraduate and graduate science curricula include no electronics training. Even when offered, electronics courses are seldom any practical use. We cannot offer a course here, but can point you in the direction of more information. A list of references is found at the end of this topic, any or all of which are a useful addition to a laboratory library. 

A few sub-topics can be covered here: electrical filtration, attenuation, amplification, and buffering; and solid-state relays and solenoid valves. For getting supplies and parts, click on our list of suppliers

ELECTRICAL FILTRATION. The simplest form of electrical filtration is a capacitor across the + and - input terminals of your measuring device. A capacitor does not affect DC levels, but shorts out fluctuations caused by noise. Try a variety of values, starting at 0.1 microfarad and working up to a few hundred microfarads. Suitable capacitors are available from Radio Shack. Note that capacitors above about 1 microfarad are usually polarized, and can only be used for filtering voltage of one polarity. If your inputs could conceivably change polarity, and you are using polarized capacitors, you must connect two of them in series, + terminal to + terminal, to create a "non-polar" capacitor. If you do this, the new capacitor will be half of the old value (eg. 50 instead of 100 microfarads), so you may have to double the capacitors' values. Also note that although filtration reduces noise, it slows response substantially. It is generally best to use digital filtration, if your data acquisition program (like ExpeData) supports it. Remember that smoothing is also available during analysis. For more sophisticated electronic smoothing techniques, see the references at the end of this topic. 

potdiv.gifATTENUATION. You will sometimes need to measure voltages larger than the maximum that your interface can handle. To do so, you need to connect two resistors in series. We will call them R1 and R2. Connect them as shown here. The voltage, Vin, that is applied to this potential divider is attenuated by a factor of (R1/(R1+R2)). Thus, if R1=R2=100K ohms, the attenuation factor is 0.5, and such a divider will double the voltage that a given interface can read (eg. 10V input x 0.5 = 5V at the connector box, assuming the connector box has infinite resistance, which it does not (in ExpeData it's 1 Megohm, which needs to be accounted for; it's easiest to present an accurately measured voltage across the divider, determine what the data acquisition "sees", and use the empirically-determined attenuation = ("seen" or measured voltage)/(actual voltage)). Use 1% or better, 0.25 or 0.125 Watt metal film resistors for long-term stability. Keep the combination of R1 and R2 above about 10K ohms so as not to load your instrument, but keep R2 at or below about 100K ohms. Remember to "tell" the program you're attenuating an input. Specify fractional gain (R1/(R1+R2), or your empirically-determined attenuation) when asked for the gain on that input. You can make an adjustable divider by using a preset ten-turn potentiometer (available from electronics suppliers) in place of R2. Adjust R2 so that the interface receives the largest voltage it can handle when the instrument is at full range. Then calibrate the instrument's attenuated output using the CALIBRATE option of your data acquisition package if, like ExpeData, it has one. The exact attenuation factor is then unimportant. If you do this, remember that any re-adjustment of the potentiometer will necessitate re-calibration. By using a fixed 100K ohm resistor for R1 and a 100K ohm preset potentiometer for R2, you can vary gain from 0.5 down to 0.01 or so (two-fold to hundred-fold attenuation). 

AMPLIFICATION. You should amplify signals that are less than about 10% of the range of your measurement interface. Use a gain (= amplification factor) large enough to yield the maximum input voltage your interface can handle. If you know a little electronics, you can either (a) make a fairly adequate special-purpose amplifier of your own quickly, simply and cheaply (see references), or (b) you can communicate effectively enough with an electronics technician to get him or her to build one for you. If you do use gain on any channel, remember to "tell" the program that you are doing so. Some interfaces have built-in gain that can be used if desired. In such cases, be aware that specifying high gains for boards situated inside your computer is (in terms of electrical noise) like using a stethoscope to listen to a mouse's heartbeat while you're in the middle of a loud, animal house fraternity party. Use external amplifiers for best results. 

BUFFERING. Buffering increases the input impedance of a given input. Generally, it is used when pH or other high impedance ion-selective probes are used directly with a measurement interface (see the pH and Ion-selective Electrode topic). These probes may work directly with some interfaces, but this is not guaranteed. Buffers are commercially available (eg. the PHCV-11 from OMEGA ENGINEERING [see suppliers]), or you can use an old pH meter with a suitable recorder output. Alternatively, you can make a buffer yourself using a high-impedance operational amplifier, eg. the National Semiconductors LF356H, available from any of the listed suppliers. Wired as a non-inverting amplifier with unity gain (see references), it lets a ±5V sensitivity interface measure 0-14 pH at a resolution (at 16 bits) of better than 0.01 pH. Note that offset and gain controls are unnecessary, if a CALIBRATE facility similar to ExpeData's is built into your data acquisition program. A two-point calibration (at any two pH's) is usually fine. Remember that a given calibration is valid at the calibration temperature only! 

SOLID-STATE RELAYS. These invaluable devices employ a voltage input, typically 3-30 V at about 1 mA, to control a much larger voltage and current. Note that they can only be used with AC. Typically, they will be used to control 120 or 220 VAC devices. If you need to control a DC device in the laboratory, use a solid-state relay (SSR) to control a DC power supply, and run the device from the power supply. To use a SSR, first determine the voltage and power requirements of the device you want to control. If it needs 120V, get a 200 V SSR (120 VAC has voltage peaks of about 170 V). For 220 V, get a 400 V SSR. You can use a 400 V SSR in place of a 200 V SSR, but not the other way around! If the device is low-power (< 300 W), you can use a small, standard 6 Ampere SSR. To calculate the required current rating of the SSR, divide the wattage of the controlled device by its supply voltage (120 or 220 VAC). Leave an adequate safety margin - double is best. High-power SSR's may require heat-sinks. When connecting a SSR, observe the polarity on its inputs, and be careful to ENSURE that the high-voltage terminals are well insulated. If you are not experienced in basic electrical safety procedures, leave the wiring to a qualified technician. 

Vendors of solid-state relays include OMEGA SCIENTIFIC INC. and ALL ELECTRONICS CORP. (highly recommended; fast shipment and low prices; good catalog); see our listed suppliers

SOLENOID VALVES. With A SSR (see above) and solenoid valves, you can direct and control gas or liquid flow under program control. The applications are limitless. We recommend using 12 VDC valves and controlling them by controlling a 120VAC to 12 V power supply (eg. a 12 V, 2 A power supply from Radio Shack) with a SSR. You can control 120 VAC valves directly, if you are confident you can connect them safely. Solenoid valves come in many varieties. Some are on-off, others are changeover, with different flow and pressure ratings. We recommend those made by CLIPPARD MINIMATIC at (513) 521-4261 and BURKERT CONTROMATIC CORPORATION at (800) 325-1405. The former are particularly elegant and precise, but don't use them for high (>~1000 ml/min) flow rates or for anything but air. OMEGA ENGINEERING (see our listed suppliers) also carries a range of solenoid valves. 

Back to top... 

PH AND ION-SELECTIVE ELECTRODES. 

These electrodes generally produce a voltage proportional to the logarithm of the ion concentration they are designed to measure. For example, a pH electrode produces about 56 mV per decade of hydrogen ion concentration, depending on temperature, with pH 7.00 producing exactly 0.00V at any temperature. 

Such electrodes are very easy to use. In the case of pH, a simple two-point calibration near the intended measurement range is generally adequate (for example the CALIBRATE option of ExpeData can perform two-point as well as multipoint linear and non-linear calibrations). This will correct both slope and offset error between any two pH's. Note that, unlike in a conventional pH meter, pH 7.0 does NOT have to be one of your calibration points! A similar calibration of mV from the electrode versus the logarithm of ion concentration is easily performed for other electrode types.  

Remember that temperature affects calibration, so do calibrate your electrode at or near the temperature at which you use it. Some pH electrodes (eg. ROSS) are temperature-compensated. For an excellent array of pH and ion-sensitive electrodes and accessories, see the OMEGA ENGINEERING pH and Conductivity catalog (see our listed suppliers). 

You don't need an expensive meter or special adjustable preamplifier to use pH and ion-selective electrodes with ExpeData. This is because of ExpeData's advanced CALIBRATE feature, that renders conventional zero and gain controls unnecessary, because the analogous operations are performed (more accurately!) in software. Some low-impedance electrodes may work if plugged straight into the connector box, though this is not guaranteed, and the electrode may be more sensitive to temperature than usual. Usually, it will be necessary to buffer the electrode (i.e. connect it to a very high-impedance buffer amplifier, which in turn is connected to ExpeData). See the Buffer sub-topic of the Electronics topic screen for more details. If the mV output of the electrode is very low, it may be necessary to amplify as well as buffer the signal; this is easily done (see above topic). Note that physical zero and gain controls on a buffer are unnecessary, for reasons outlined above.  

Back to top... 

TEMPERATURE MEASUREMENT  

Many methods exist for measuring temperature. We will briefly mention a few here. For a wide range of commercial temperature measurement systems, see the OMEGA ENGINEERING temperature measurement catalog (listed suppliers). Below, we discuss temperature measurement devices you can wire up yourself, because the CALIBRATE feature in ExpeData makes temperature measurement very easy and economical. This is because you don't need expensive, very precisely calibrated temperature sensors, if you are going to calibrate them anyway against a primary source such as an accurate mercury thermometer. It doesn't even matter if the temperature sensor's response to temperature is non-linear, because you can calibrate it by using a polynomial transformation with a good data acquisition package such as ExpeData. The response of the temperature sensor simply has to be repeatable, and most, with the exception of the cheapest and raunchiest thermistors, are. 

THERMOCOUPLES. These sensors are tough, repeatable, and can be made very small. They suffer no self-heating problems. On the other hand, the signal they produce is tiny and needs amplification and ice-point correction. See the Thermocouples topic. 

diode.gifDIODES. Yes, diodes. Ordinary silicon diodes, 1N4148, 1N914 or equivalent (as low as $1.99 for 50; see our listed suppliers) are very linear temperature sensors over the range -50 to +150 degrees C. To use a diode as a temperature sensor, connect it as pictured (note that the cathode, denoted by a band, is oriented towards ground). R1 should be about 10,000 ohms. Connect the diode to the end of a length of shielded cable, and protect it with silicone or epoxy cement. The diode will develop about 0.6V, which will fall as its temperature rises. Use the CALIBRATE option of your data acquisition package (if, like ExpeData, it has one) to calibrate it, in the medium (air or water) that it will operate in. Because of self-heating, its calibration will change slightly if its medium changes. Resolution and accuracy are about 0.5 degree C - adequate for many purposes. You can supply the bias voltage from a digital output.  

ad590.gifSOLID-STATE TEMPERATURE SENSORS. These operate on the diode principle (above), but are partly pre-calibrated. The best is the AD590 by ANALOG DEVICES (Norwood, MA; 1-800-262-5645). It passes a temperature-dependent current of 1 µA per Kelvin. If it is connected in series with a 1K ohm resistor (R1 in the diagram), and biased with 5-12V (eg. from a digital output), a temperature-dependent voltage is developed across the resistor that the program can measure. This will have a value of 273 mV at 0 degrees °C, 293 mV at 20°C, etc. The AD590 is available in various grades of linearly increasing absolute accuracy and exponentially increasing price. With a good data acquisition program any grade is equivalent, because each AD590 should be calibrated in the CALIBRATE option anyway. You can get application notes and (sometimes) samples from ANALOG DEVICES (don't tell them we sent you). We have to admit, by the way, that after a period of relative sleepiness and glacial production in the '90s, AD has become one kick-ass company - while Texas Instruments/Burr-Brown, for example, only recently appeared to realize that RoHS compliance was on the radar and is now in a state of flat-out panic, zero availability and 12-week lead times on many products, AD stepped in with several drop-in replacements that are available now  and are RoHS compliant! Heck-dang, yee-hah.

THERMISTORS. These are the "classic" temperature sensors. They are temperature-dependent resistors, often varying their resistance widely over a small temperature range. They are ideal when high sensitivity and resolution - down to 0.001 degree C - are required, but absolute accuracy is not very important. This is because their response to temperature is non-linear, often substantially so. In the CALIBRATE utility of a good data acquisition system such as ExpeData this can be corrected with a polynomial transformation, but note that thermistor calibration tends to shift, especially if they are exposed to mechanical shock, extremes of temperature, or liquids. They should be re-calibrated regularly. 

In fairness, not all everyday thermistors are inaccurate. Especially recently, very accurate thermistors have become available at reasonable prices. For example, careful shopping will reveal thermistors that are accurate to 0.2 or 0.1 degrees C over a 0 to 70 degree range, for under $10.

To use a thermistor, connect it as one "leg" of a potential divider (see "Attenuation" in the Electronics topic for more on potential dividers), and apply about 5V to the potential divider, eg. from a digital output. Keep current low (< 1 mA) to minimize self-heating. Then calibrate the thermistor using the CALIBRATE option, in the medium in which it will be used. Connecting a thermistor in potential divider mode, as recommended here, can produce an almost perfectly linear relation between temperature and the voltage output of the potential divider.

Very high-grade thermistors are available that give a linear output with an absolute accuracy down to 0.1 degree C over the range 0 to 100 degrees C. These have become much more readily available recently. I'm thinking of putting up more information on that subject here; anyone out there interested? Others are very tiny and, if operated at a high enough current to self-heat significantly, are exquisitely sensitive to minute air currents and other changes in local heat conductance such as blood or hemolymph flow. Many, many kinds are available. Good suppliers are FENWALL ELECTRONICS (Framingham, Mass.), ALPHA THERMISTOR (San Diego, CA, 800-235-5445/619-549-4660) and THERMOMETRICS (Edison, NJ, 201-287-2870). 

PLATINUM RESISTANCE DETECTORS. These are the Rolls-Royces of temperature detectors, mainly because they boast repeatability to 0.001 degree C. They can be used in a potential divider as described above, because their resistance varies with temperature, but the variation is small, giving limited resolution. More sophisticated circuitry, with gain and offsetting, makes them give their best (see the references). A typical manufacturer is SENSING DEVICES INC. (Lancaster, PA). 

Back to top... 

THERMOCOUPLES 

Thermocouples provide a consistent and reasonably accurate way to measure temperature. They utilize the Seebeck effect, whereby two junctions between dissimilar conductors produce a voltage proportional to the temperature difference between them. We will concentrate here on copper-constantan thermocouples, which have reasonably high output and are not particularly water-sensitive. For a good discussion on thermocouple theory, and an excellent range of thermocouple wire, plugs and accessories, see the OMEGA ENGINEERING temperature measurement catalog (see suppliers). A good source of ultra-fine thermocouple wire (0.001", copper and constantan combined!) is us truly (see the accessories of our mighty nice TC-2000 thermocouple preamplifier). 

The simplest way to use thermocouples is to purchase thermocouple preamplifiers with built-in electronic ice-point compensators. These preamplifiers typically have outputs of 1 or 10 mV per degree C, and can be fed into any ExpeData interface. Several are available from OMEGA ENGINEERING. A four-channel, high-resolution unit, the TC-2000, is available from Sable Systems. It comes pre-calibrated to 0.2 deg C. For other thermocouple preamps, use the CALIBRATE option of ExpeData or your data acquisition system to calibrate it against a good mercury thermometer. Use a polynomial transformation if you want good accuracy over a wide range, because the Seebeck effect is not completely linear across temperature. In addition, some commercial thermocouple thermometers (being a preamplifier with a display) have a "recorder output" that can be used similarly. The TC-2000 includes four high-resolution analog outputs and a digital (RS-232) output.

For the next options, you must have amplification available. Using that amplification, measure the voltage produced between your sample thermocouple junction and a thermocouple junction at a known temperature. First, and simplest, use an actual ice-bath as your reference. This is inconvenient but accurate. Temperature-controlled ice-point baths are available (OMEGA; see suppliers) but are expensive and bulky. If you use an ice-point reference, do not use the thermocouple transform. Instead, transform your voltage reading to Celsius using a seven- to nine-degree polynomial equation.  

Specifically,  

T = .1009 + .025728 * µV - 7.6735E-07 * µV2 + 7.8026E-11 * µV3 - 9.2475E-15 * µV4 + 6.9769E-19 * µV5 - 2.6619E-23 * µV6 + 3.9408E-28 * µV7

where T is temperature in degrees Celsius and µV is the thermocouple junction voltage in microvolts.

Second, and simpler, use an electronic ice-point compensator to correct the reference junction temperature of the thermocouple(s) before amplifying the thermocouple voltage. These are available from OMEGA, and you can compensate any number of thermocouples with one. Use the above equation (for type T thermocouples).  

Third, using a preamplifier with known gain, measure the reference junction temperature directly (see the Temperature topic) and get the program to do ice-point correction, using a suitable math transform in your data acquisition program. 

Back to top... 

LIGHT MEASUREMENT  

Many commercial, pre-calibrated sensors exist for accurate measurement of light levels. LI-COR INC. (Lincoln, NE; (402) 467-3576) is a good manufacturer. These expensive commercial sensors are recommended for high-accuracy work. They also serve as calibration standards against which inexpensive light sensors can be calibrated with the CALIBRATE option of a good data acquisition system such as ExpeData. These are described below. For less demanding applications, a hand-held light meter will serve as an adequate primary standard. Of course, if relative light levels are of interest, calibration is not required. 

SILICON SOLAR CELLS. SSC's are easy to use and can be purchased from Radio Shack, or EDMUND SCIENTIFIC at (609) 573-6250. The latter sells a bargain-basement calibrated cell (D37,346). The current (but not voltage) output of SSC's is a linear function of light intensity. Spectral sensitivity varies according to manufacturing technique. To use a SSC, connect a small-resistor across it and measure the voltage produced across the resistor. The voltage should be well below 0.4V or serious nonlinearity will result. For example, a cell with 0 to 300 mA output can have a 1.0 ohm resistor across it, yielding 0 to 300 mV output. An amplifier can be used to boost the resulting low voltage for best resolution. Ideally the developed voltage should be zero, a seemingly impossible goal attainable with an op-amp wired as a current-to-voltage converter (consult Horowitz and Hill, listed in the Electronics References). SSC output is slightly temperature-dependent; this could be a problem in some applications requiring very high accuracy in unstable environments. 

LIGHT DEPENDENT RESISTORS. LDR's are usually small, flat resistors with a window on one side. Their resistance varies linearly with light levels over a wide range. Spectral sensitivity varies, but is usually greatest at short wavelengths. LDR's are very useful for measuring light levels in small areas, and they excel as motion detectors. They are available from RADIO SHACK and other listed suppliers. Electrical connection is simple. Measure the LDR's resistance at the light level you will measure, consult the Attenuation section of the electronics topic, and use the LDR as R1 in a potential divider. Choose the value of R2 so that the voltage presented to the interface is within the range it can measure. Or, better, use a 100K ohm variable resistor in place of R2. This allows you to adjust the light-sensitive potential divider to different ambient light levels. To increase directionality, set the LDR in the bottom of an opaque tube, or use a simple lens system (eg. a single convex lens, available from EDMUND SCIENTIFIC; see above). If you need a light source, consider a cool, efficient light-emitting diode or LED for close range work (see below). 

PHOTOTRANSISTORS and PHOTODIODES. These devices exploit the inherent sensitivity to light energy of semiconductor junctions. Because their surface area is small and they are quick-responding, they are excellent motion detectors. They are available in a wide range of spectral sensitivities, ranging from near-infrared through the visible spectrum. Some are available with spectral responses close to photosynthetically active radiation (PAR). Photodiodes are usually operated as current sources, as described for SSC's, above. In fact, a SSC is simply a huge photodiode. Photodiodes are available from ALLIED, NEWARK, MOUSER and DIGI-KEY (see listed suppliers), or - if you wish to pay their grotesquely hyper-inflated, astronomical, scandalous, and unbelievable prices - from Hamamatsu (we're talking $40+ for a photodiode obtainable elsewhere but with lower specs for $2; they're about the best you can get, though. Plus, who else would put a surfing firefly on their home page? Ya gotta love 'em).  Phototransistors are slightly different. In effect, light levels linearly affect their resistance. They can be connected as described for LDR's, above. Note that they will work in one polarity only - if the circuit doesn't work, reverse the connections (yessir, a rigorous treatment). By arranging a phototransistor and a light source such a light-emitting diode (LED) so that an intervening object partially occludes the light path, movements of << 10 microns can be detected. If a near-infrared phototransistor is coupled to a near-infrared LED, the light beam is invisible and scarcely affected by ambient light levels. 

LIGHT-EMITTING DIODES. LED's are cool, efficient, long-life light sources, available in many wavelengths (near-IR to blue) and efficiencies. Light output is narrow-band, almost monochromatic. In general, the longer the wavelength, the higher the efficiency. Use "superbright" or "high output", non-diffused types where possible. RADIO SHACK has a good basic range. To use an LED, first determine the current you wish to pass through it. Light output varies linearly with current. 20 mA is typical, though some LED's can be pushed to 100 mA; consult the specifications of your LED. Exceeding specifications will give your LED a merry life but a short one. Now determine the voltage that you will connect it across (eg. 12V). Subtract 2V (the approximate voltage drop across the LED; this ranges from about 1.5V for near-IR LEDs to about 3V for blue LEDs), and divide by the LED current in Amperes (eg. (12-2)/0.02=500). You therefore need a 500 ohm resistor to run a typical LED at 20 mA off 12V. The closest standard value is 470 ohms. Power dissipated by the resistor is V2/R, where V is the voltage across the resistor of value R ohms. This is 0.2 Watt in our example. Use a resistor with a power rating at least double the calculated dissipation (0.5W in our example). Suitable resistors are available from RADIO SHACK. LEDs are polar devices and can be damaged by wrong connection. One lead (the cathode) is marked by a flat surface on the package, a metal tab, or shorter length. This lead goes to negative (or ground). The resistor is usually connected between the positive voltage and the anode, the other lead of the LED.  

Back to top... 

PRESSURE MEASUREMENT  

Our discussion will center around isometric pressure transducers, because they are the most generally useful. Of these, the most useful for low-pressure applications are pressure-sensitive silicon diaphragms with integral strain gauges. These come in two basic varieties. In the first, one side of the silicon diaphragm is sealed, and the other side is connected to a port to which you can connect tubing. These measure absolute pressure and are referred to as "ABSOLUTE" pressure transducers (no surprise, Virginia). In the second type of pressure transducer - the "DIFFERENTIAL" type - both sides of the silicon diaphragm are connected to ports, and the pressure difference across the membrane is measured. One subspecies of the differential type (just to be confusing) conceals its secondary port, which in practice is connected to the atmosphere. This transducer measures pressure relative to local atmospheric pressure, and is (for some reason) called a "GAGE" type.

Both types of pressure transducer are available in temperature-compensated versions, which are recommended for general laboratory use. A wide range of sensitivities is available, ranging from several atmospheres to a few hundred Pascals (or a few cm of water). With the aid of averaging during data acquisition, resolution to a fraction of a Pa is possible. For best results, you will usually need to amplify the output of the pressure transducer using a differential instrumentation amplifier. If you want to measure tiny fluctuations on a large imposed pressure, you will need to offset the signal as well as amplify it (which the amplifier mentioned above can do). The Sable Systems PT-200 is ideal for this task.  For higher pressures the Sable Systems PT-1000 is ideal for measuring absolute pressure up to, and including, atmospheric. 

A good range of pressure transducers, mostly garnered from other manufacturers and substantially marked up, is available from OMEGA ENGINEERING (consult their Pressure And Flow Handbook; see our listed suppliers). Specially recommended for general-purpose low-pressure work are temperature-compensated sensors made by HONEYWELL's MICROSWITCH division (Freeport, IL; (815) 235-6600) and also available from OMEGA. These can be connected to our low-sensitivity interfaces (5V) with no need for amplification, but note that they do need a reasonably constant 8V power supply. Other sensors, requiring amplification, are available from NOVA SENSOR (Fremont, CA; (415) 490-9100). This company makes a broad range of state-of-the-art pressure sensors, but at prices that aren't particularly competitive with Microswitch, when you consider that the Nova Sensor products need external electronics. 

All pressure transducers should be calibrated for accurate work. An easy-to-use and accurate primary calibration standard is an oil or mercury manometer. 

Back to top... 

HUMIDITY MEASUREMENT  

Humidity is a difficult variable to measure accurately. Various approaches exist, none cheap or simple, as listed below. The best, and most expensive, measure primary physical properties of the airstream such as its dewpoint. Relatively cheap, non-primary sensors mostly share the characteristic that voltage output is a non-linear function of humidity. Fortunately, the CALIBRATE option of good data acquisition packages such as ExpeData takes care of non-linear functions. Because their calibration drifts with time, all non-primary humidity sensors must be calibrated frequently, either against a primary standard (such as our dewpoint generator, the DG-4) or by being placed in atmospheres at equilibrium with various saturated salt solutions or different concentrations of glycerol in water. We also make a versatile humidity sensor (the RH-300) that reads out not only in %RH but dewpoint, water vapor density and Pascals water vapor pressure. OMEGA ENGINEERING (see our listed suppliers) has a wide selection of instruments. Other manufacturers tend to excel in specific areas, as noted below. 

CAPACITANCE SENSORS. These sensors are usually made of aluminum oxide coated with a porous gold film. The capacitance, and hence the complex impedance, of these sensors varies with ambient relative humidity. Because it is impedance and not resistance that varies, these sensors cannot be used in the simple potential dividers described in the Temperature topic. Special and expensive electronics packages are needed, which the vendors will happily supply. It takes these sensors several tens of seconds to equilibrate to a humidity change, making them useless where fast response is needed. They are destroyed on contact with liquid water. VAISALA (Woburn, MA; (617) 933-4500) is the best-known manufacturer. An exotic version of the capacitive sensor which utilizes phosphorus pentoxide rather than silica, and can measure very low humidities, is available from EG&G ENVIRONMENTAL EQUIPMENT (Burlington, MA; (617) 270-9100). 

DEW-POINT HYGROMETERS. These sensors measure the dew-point of the airstream rather than its relative humidity. If the temperature of the airstream is known, its relative humidity can be calculated from its dewpoint via a polynomial transformation (see the HANDBOOK OF PHYSICS AND CHEMISTRY, CRC press). Because they measure a primary physical property, dewpoint hygrometers are "primary standards" in their own right, and can confidently be used for calibrating other humidity sensors. Unfortunately they are bulky, delicate, temperamental and very expensive, especially if low dewpoints (=low relative humidities) must be measured. Respected manufacturers include EG&G (see above) and GENERAL EASTERN (Watertown, MA; (800) 225-3208). 

BRADY ARRAYS. These obscure devices vary in complex impedance with ambient humidity, as do ordinary capacitive sensors, but are semiconductor lattices that interact directly with ambient water vapor levels. They respond very quickly to humidity changes (< 1 s). Their output is very nonlinear with humidity (which is not a problem because their repeatability is good, at least until it isn't, in our experience). THUNDER SCIENTIFIC (Albuquerque, NM; (800) 872-7728) is their sole manufacturer, and can calibrate them on request. Liquid water shorts them out, but they can be dried out and do recover. An "evaluation kit", the PC-2101, is available at comparatively low cost that includes the sensor, cable, filtered sensor housing, and electronics. A flow-through chamber into which the probe can be screwed can be constructed from aluminum by any good machinist. Thunder also makes some industry-standard humidity reference chambers. Paul Bennewitz, the VP of Thunder Scientific, is an interesting guy.

Back to top... 

MAGNETIC FIELD MEASUREMENT  

For measurement of alternating magnetic fields, a variety of inductive sensors are available. These are primarily used for the monitoring of energy consumption in 120 VAC devices such as heaters and lamps. Contact Allied or Newark (see our listed suppliers). 

Measurement of steady magnetic fields is most easily accomplished by using Hall-effect devices. A good range of these are made by HONEYWELL MICROSWITCH (Freeport, IL; (815) 235-6600), with various sensitivities. Several models are especially easy to use. Apply a DC voltage across them, and they produce a voltage output linearly proportional to the strength of the ambient magnetic field. See the applications literature, available from the manufacturer, for more information. In combination with small, powerful rare-earth magnets (available from EDMUND SCIENTIFIC), they can be used for non-intrusive motion or deflection detection. 

Back to top... 

ELECTRONICS AND OTHER SUPPLIERS Here follows a list of suppliers we've dealt with. All are situated in the USA. They are linked if they're on the web. We have included 800 (USA or Canada) or toll numbers (foreign; some still on the way) for your convenience, together with frank comments. If you have recommendations or other feedback, mail us!  

First, electronics suppliers (also called distributors). They re-sell devices made by other manufacturers, most of whom will not deal with you directly unless you want eighty lots of ten thousand identical items. Important note about electronics suppliers: Do not expect any advice or help from any of these firms! When you call, you'll be connected to someone with no electronics training. They won't know a resistor from Pope Joan. They will expect an exact part number from their catalog (for example, not a 100K ¼ Watt 1% resistor but a 743-87105 or a F21-812-1059; not an LF356 but an LF356AKN (the last three letters must be exactly right) or 776-44356 or F54-876-9987), and for that you'll need their catalog. Call and get it first, then order, or order online (Digi-Key's search capability is the best by far).

Our recommendation code: redball.gifExcellent yellow ballGood green ballFair blue ballSorta OK 

red ballALLIED ELECTRONICS (1-800-433-5700). Best combination of value and selection. Their catalog, if thrown with any force, is handy for stunning large mammals. Good web site. Goods are listed by type, then by manufacturer, in enough detail to make an intelligent choice. Be warned that the choice is so wide it can be intimidating at first. You may end up taking an hour to find what you need. Quality is good to excellent.  

red ballDIGI-KEY (1-800-344-4539). Also an excellent but intimidating catalog. Good web site. Good service. Quality ranges from good to very good. Incredibly good online search capability that leaves the others in the dust. Highly recommended!

yellow ballNEWARK ELECTRONICS (1-800-463-9275). Very good catalog, rather like Allied's, but watch out! Unless you're a large business they quote prices 30 - 70% higher than listed in their catalog, leaving a "bait and switch" taste in one's mouth (the others do not do this). At first we also found their service to be poor - until we became quite significant customers of theirs. Then their prices dropped to under their catalog prices and they became very friendly and efficient. O tempora, O mores. Their chief advantage is their excellent working relationship with Analog Devices, the supplier of the ICs we use in our products. In late '96 they finally woke up, smelled the solder, and got a web page going, scandalously late. Quality is good to excellent. 

yellow ball MOUSER ELECTRONICS (1-800-346-6873). Good catalog. Nowhere near as detailed as Allied's and Newark's and therefore less intimidating to the beginner. Good web site. Excellent service. Quality ranges from average to very good (referred to as "Hi-Rel" parts; avoid the others if you're given the choice). 

green ballALL ELECTRONICS CORP. (1-800-826-5432). Fast shipment and low prices; eclectic catalog; a lot of cheap and unusual "surplus specials"; but don't expect those "specials" to be around indefinitely. Good range of low-priced solid-state relays. Surprisingly good web site! Caveat emptor. Quality ranges from poor to good. 

blue ballRADIO SHACK. Local. Their range is limited and their quality tends to be on the low side - sometimes on the VERY low side. Some of their made-in-China parts appear never to have seen hide nor hair of a QC program. They snap when used, they melt when soldered, they suddenly abandon functionality to meditate on the futility of existence. Use your judgment; some parts are OK; Caveat emptor again. At least Radio Shack's open on weekends... 

You might also want to consult a good-bad-and-ugly list of suppliers maintained by Yahoo. Some you'll like, some you won't. We do recommend those listed above, with caveats as listed. 

OTHER SUPPLIERS: 

These suppliers, unlike those above, do know whereof they speak. They are manufacturers or agents who know their products and sell directly to the public or are willing to give advice and direct you to someone who will sell their products to you. 

OMEGA ENGINEERING (1-800-826-6342). They will send you a shelf of hardbound, full-color catalogs free, covering almost every sensor/measurement need. Their catalogs contain good theoretical introductions to many measurement technologies. Omega is industrially-oriented and sells mostly re-branded goods of fair to good quality from a variety of manufacturers, at a substantial mark-up (hey, you thought those fancy catalogs were free)? A dubious source for scientific instrumentation but a good source of thermocouple wire, pH probes, solid state relays, solenoids, specialty sensors and the like. Their service is outstanding in our experience. Like us, they may make mistakes from time to time but will just about kill themselves to set things right. 

Back to top... 

REFERENCES. There are very few good references for laboratory uses of electronics. Some are listed below. We recommend none of them whole-heartedly. Not listed below, because titles continuously change, is a good range of reference books and application notes published by ANALOG DEVICES (Norwood, MA; 1-800-262-5645). They tend to be heavily biassed towards AD devices, and some are getting outdated, but are useful introductions to transducer and signal processing technology nevertheless.  

  1. The Art Of Electronics. P. Horowitz and W. Hill. 1980 and later editions. Cambridge University Press. (Most university bookstores carry this text. While supposedly practical in bias, it tends to be overly theoretical and didactic. Important areas are neglected and minor ones treated in exhaustive detail. The authors leaven their approach with rather wacky low-key humor that adds to, rather than detracts from, the text. Although the book has its failings it's the best there is, and operational amplifiers and active filters are covered well. It also has good sections on precision design, grounding, and noise). 
  2. How To Design And Build Electronic Instrumentation. J.J. Carr. 1986. Tab Books Inc. (Carr's style is alternately sternly didactic and scatological, but he has a useful practical bent. Unfortunately coverage is very patchy, with vital application information often missing. A useful general "idea" text, nevertheless, with a welcome bias towards sensor technology and written from the practical "been-there-done-that" viewpoint of a grizzled electronics technician). 
  3. A Practical Introduction To Electronic Circuits. M.H. Jones. 1981. Cambridge University Press. (This book has a slightly old-fashioned feel (it even has a section on thermionic valves!), but its overall coverage is excellent. It strikes a good balance between exhaustive didacticism and brief treatments such as those here). 
  4. Digital Interfacing with an Analog World. J.J. Carr. 1987. Tab Books Inc. (Another book by the redoubtable Mr Carr. It will prove useful to anyone trying to understand computer data acquisition in greater detail. Of course, the better you understand the subject, the better your work can be. It has useful sections on signal processing, electronic integration and other advanced topics). Stay away from Mr. Carr's other book, on the "scientific method". Gimme a break, Mr. Carr! Stick with what you know.
  5. Don Lancaster's books, such as his "CMOS cookbook", "TTL Cookbook", "OP-AMP Cookbook" and "Active Filter Cookbook" are useful additions to your library if you've already cut your teeth on electronics. They are published by SAMS. Don Lancaster is a species of rascal guru who has a large cult following in the electronics fringe and spends his leisure time (from what I can gather) exploring tinajas near Thatcher, Arizona. An interesting guy. You can even hire his services for a fee (1-602-428-4073). His web site is definitely worth a visit, though you'll have to forgive him for his predilection for presenting most of the interesting material on his site in the form of gi-normous PDF files. Sometimes the best can be the enemy of the good...
  6. Forrest Mimms' books are excellent entry-level hobbyist introductions to electronics and are available from Radio Shack. Forrest is an "amateur scientist" of some renown, thanks to his books and his work on ground-level UV flux measurements that have even uncovered calibration flaws in NASA satellites.

Back to top...

 

DIGITAL CONTROL  

Most data acquisition packages have at least four digital outputs. Any of them, in any combination, can be turned ON or OFF under program control. When ON, they develop about 5 Volts at a few milliamps. When OFF, that voltage falls to less than 0.5 V. These safe, low-power, low-voltage outputs can be used with simple interfaces to control devices such as pumps, stirrers, fans, and heaters.  

Because the digital outputs are low-power, they can't drive fans, heaters etc. directly. They will usually power other equipment via a device called a solid-state relay. A solid-state relay is very simple. It is a 120 or 250 VAC switch that turns on with a small control voltage rather than the throwing of a lever. See the Electronics topic for more detailed information and vendor names for solid-state relays and solenoids. If you connect a digital output from the connector box to the control input of a solid-state relay, the program can control 120 VAC devices such as lamps, heaters, solenoids and instruments directly. Once it can do that, whole new areas of experimentation open out to you. 

BUT BE WARNED. WHEN YOU USE A PROGRAM TO CONTROL DEVICES, YOU AND YOU ALONE ARE RESPONSIBLE FOR THE CONSEQUENCES. IT IS POSSIBLE TO CONTROL DEVICES IN A SAFE MANNER, BUT IF YOU USE A PROGRAM TO CONTROL DEVICES IN A WAY THAT COULD CONCEIVABLY PUT PEOPLE OR PROPERTY AT RISK, WHETHER THROUGH YOUR FAULT OR THROUGH ANY FAULT OF THE PROGRAM YOU'RE USING, THEN YOU AND YOU ALONE ARE RESPONSIBLE FOR THE CONSEQUENCES! 

To use the digital outputs, you must know how to refer to them. Depending on your interface, you will have four or more outputs available. They are numbered from 1 to 4, for example. However, this is not the way the computer refers to them. It regards them as bits 1 to 4 in a binary word, so output 1 is referred to as 2^(1-0) or 1; output 2 is referred to as 2^(2-1) or 2; output 3 is referred to as 2^(3-1) or 4; and so on. If you are controlling a heater from output 4, eg., enter 2^(4-1) or 8 as the output control number. 

When you enter a control number for a digital output, you are shown the output states of your digital outputs symbolically, in a row, with OFF denoted by 0 and ON denoted by 1. If what you see is not what you want, you can change the control number. Note that more than one output can be on at once. For example, entering the control number 5 will turn outputs 1 and 3 on simultaneously. 

Back to top... 

GETTING STARTED IN DATA ACQUISITION 

We assume you want to record data from an instrument. To do that, you must connect a voltage output from the instrument to an input on the connector box (let's say input 1). 

Examine your instrument, and find the voltage output connectors (often nostalgically labelled "RECORDER"). Usually they are "banana plug" or "binding post" connectors. If there are two, they will probably be labelled "OUTPUT" and "GROUND" (or "EARTH"), or they may be coded red and black, meaning as above. If there are three, one will be "+ OUTPUT" (red), one "- OUTPUT" or "SIGNAL GROUND" (various colors) and the third "GROUND" or "CHASSIS GROUND". Using short lengths of cable, connect "+ OUTPUT" or red to the "+" terminal of input 1. Connect "- OUTPUT" (if there are three connections) or "GROUND" (if there are two) to the "-" terminal of input 1. Finally, if there are three connections, connect "GROUND" or "CHASSIS GROUND" to the ground terminal of input 1. If there are only two connections, connect the "-" input and the ground of channel 1 together with a short piece of wire. For connecting instruments to ExpeData, use shielded cable where possible. Adequate shielded cable is available from Radio Shack, or the suppliers listed in the ELECTRONICS section. 

Your instrument may have less standard connections. If so, refer to its instruction book, or contact the manufacturer. You may have to buy a cable, but you can probably make one yourself from easily available (Radio Shack) components. Use the above discussion as a guide when making connections. 

Now use the [MONITOR INPUT] option of the [INPUT] main menu option to examine the voltage output of your instrument. Turn the instrument on, and check that it produces a stable voltage that varies smoothly as you adjust the instrument or change the parameter it is measuring. See the [MONITOR INPUT] help screen if it is noisy or "jumps" suddenly between different constant readings. If the input goes out of range (blinking display) or varies very little over the whole range of the instrument's output, you will need to attenuate or amplify your signal, respectively. Refer to the ELECTRONICS topic for details. 

If you are satisfied with the readings, you may wish to calibrate your instrument immediately. This is quick and easy to do if you have a [CALIBRATE] option such as ExpeData's. 

Now choose a reasonable sampling interval at which to record your data (say 1 second), go to the [GRAPHICS] option and set your display parameters (remember that you can see the range of your measurements with the [MONITOR INPUT] option), and go to [RECORD DATA]. You can then adjust your instrument or change the parameter it measures, and see the results on screen. Finally, if you want to keep your recording for later analysis, [SAVE] it. 

You can record from as many inputs as your measuring interface will handle, with different instruments connected to each, and on up to 16 channels, some of which can combine readings taken from different instruments, or compute integrals or rates of change from data on other channels (see the [MATH TRANSFORM] help screen for details]. You can control instruments with the program, and do many other things. Take the time to read these help and topic screens, and you'll be an expert in computer data acquisition in no time. 

Back to top... 

VOLTAGE MEASUREMENT 

A acquisition program's primary task is to measure voltages, from which it can compute the data of interest to you. Because a good data acquisition package can do so very accurately, it will use DIFFERENTIAL rather than SINGLE-ENDED voltage inputs. What is the difference? 

Differential voltage inputs measure the difference in voltage between the "+" and "-" inputs, referred to as the non-inverting and inverting inputs, respectively. Both of the inputs have to be within a few volts of ground, but as long as they are, the voltage actually measured is purely the voltage at the non-inverting input minus the voltage at the inverting input. Now, in a measurement situation, noise usually is introduced between signal and ground. Often, voltages are induced in ground leads by magnetic fields. In a single-ended voltage measurement system, that noise is added to the signal and measured. In contrast, in a properly designed differential system, the noise appears equally at the inverting and non-inverting inputs; and because only DIFFERENCES are measured, it effectively disappears

Therefore, always connect an instrument in differential mode if it can be connected in that way (see the Getting Started topic for actually connecting instruments). If your instrument has only two outputs (eg. "OUTPUT" and "GROUND", red and black) then try connecting OUTPUT to the non-inverting and GROUND to the inverting inputs. Use the [MONITOR INPUT] option, and see if the measured instrument output is clean and changes smoothly as you adjust the instrument. If not, connect a lead between the inverting input and ground on the connector box. The noise should be reduced. If not, check the [MONITOR INPUT] help screen for suggestions. 

Back to top... 

DATA FILE FORMATS 

Any data file format is a compromise between size, speed and versatility. Sable Systems ExpeData programs can save files in various formats. We recommend that you use either the SSCF (Sable System Compact Format), ASCII or Lotus® file types. These have been provided so that you can load your data into other analysis or graphics systems, including Apple products that can read data from disk in DOS format. SSCF and ASCII file formats are detailed below, with programming examples. Note that the programming examples use the very popular Microsoft QBasic language, available free with IBM-compatible computers. They can be translated into C, Pascal, FORTRAN, or any of the burgeoning tribe of new languages, quite easily. In some language implementations, you may need to re-code for RANDOM file access rather than the more convenient BINARY file type used here. 

SSCF FILES. These files are recommended for general-purpose input to the Analysis program from programs or utilities you have written yourself. It is very important to note right away that SSCF format uses non-ASCII numeric storage formats to the IEEE single-precision (4 byte) standard. Hence, if you are using a language that does not support the IEEE standard *and* random-access, or preferably binary, input/output to disk, you will not, alas, be able to use it. In such a case, opt for the ASCII format instead. 

An SSCF file consists of at least two parts, the header and the main data block. All numeric data in these first two parts are in the IEEE single-precision 4-byte format. 

THE HEADER consists of five numbers. The first is a "magic number" which identifies the file as being, in all probability, a SSCF file. That number is 1003. This is followed by the version number, which must be between 0 and 2. More on this later. These are followed by the number of channels, the number of samples, and the sampling interval (in seconds). 

THE MAIN DATA BLOCK follows the header. It is not affected by the version number. It consists of data from successive channels, ordered by sample number. All of the channels for each sample number are written immediately after each other. For example, a two-channel recording will have the following composition: , and so on. 

If the version number is 1 or less, the SSCF recording ends here. If the version number is between 1.01 and 2, a FOOTER is appended to the file. The footer contains additional information that may or may not be useful in your application. (Incidentally, Sable Systems encourages you to extend the file format if you wish, *provided that* you tell us what you are doing so that we can incorporate the new features in our products for the benefit of all. We welcome constructive suggestions. Service is our only goal). 

THE FOOTER follows the main data block. It consists of the following numbers. (1) For each channel, a beginning baseline value, an ending baseline value, and three reserved numbers to which we have not as yet assigned a use. These are written one after the other, grouped by channel number (see below). (2) The day, month, year, hour, minute, and second at which the recording was terminated. (3) A string of exactly 240 characters, containing remarks. If the remarks are less than 240 characters long, they must be padded with spaces until they are. (4) A 4-byte long integer (IEEE format) containing the number of markers. (5) A series of 4-byte long integers containing marker information. A marker long integer consists of the sample number at which the marker occurred. If you want to add an identifying code that will appear on the analysis screen at the top of the marker line, add the number (1,000,000 * A) where A is the ASCII code of the desired symbol (ASCII range: 65 to 127). 

SAMPLE PROGRAMS - SSCF 

(A) The following program will write data contained in an array d(chans, nsamples) to an SSCF file, where chans = the number of channels and nsamples = the number of samples. Note that the program assumes that all variables are 4-byte IEEE short (single-precision) reals, unless otherwise indicated. Other variable types should be converted to these as appropriate (eg. with the CSNG function in QB). 

INPUT "Enter filename: ", FileName$ 

OPEN FileName$ FOR BINARY AS #1  

c = 1003  

PUT #1, , c ' "magic number" denoting SSCF file 

c = 1.01 

PUT #1, , c ' version number 

PUT #1, , chans  

PUT #1, , nsamples  

PUT #1, , sint ' sampling interval in seconds 

FOR n = 1 TO samples ' write the data block 

FOR m = 1 TO chans 

PUT #1, , d(m, n)  

NEXT  

NEXT  

' The next data block is the FOOTER and is only ' written if the version number is >= 1.01 

FOR n = 1 TO chans  

PUT #1, , sbl(n) ' starting baseline value 

PUT #1, , ebl(n) ' ending baseline value 

w = 0  

FOR m = 3 TO 10  

PUT #1, , w ' reserved variables 

NEXT 

NEXT  

PUT #1, , day  

PUT #1, , month  

PUT #1, , year  

PUT #1, , hour  

PUT #1, , min  

PUT #1, , sec  

PUT #1, , Zrem$ ' Remarks: Zrem$ must be exactly 240 bytes long 

w& = markers ' number of markers 

PUT #1, , w& ' NOTE: IEEE 4-byte long integer 

FOR n = 1 TO markers  

PUT #1, , marker&(n) ' NOTE: IEEE 4-byte long integers 

NEXT  

CLOSE #1 

(B) The following program will read a SSCF file into the array d(channels, samples). 

INPUT "Enter filename: ",FileName$ 

OPEN FileName$ FOR RANDOM AS #1 

GET #1, , magic 

IF magic <> 1003 THEN BEEP: CLOSE #1: END 

GET #1, , version 

GET #1, , channels 

GET #1, , samples 

GET #1, , sint :REM sampling interval 

DIM d(channels, samples)  

FOR n = 0 TO samples - 1  

FOR m = 1 TO channels  

GET #1, , d(m, n)  

NEXT  

NEXT  

DIM sbl(channels), ebl(channels) 

IF version > 1 THEN 

FOR n = 1 TO channels  

GET #1, , sbl(n) :REM starting baseline 

GET #1, , ebl(n) :REM ending baseline  

FOR m = 3 TO 10  

GET #1, , w :REM reserved variables 

NEXT  

NEXT  

GET #1, , day  

GET #1, , month  

GET #1, , year  

GET #1, , hour  

GET #1, , min  

GET #1, , sec  

zrem$ = SPACE$(240)  

GET #1, , zrem$  

GET #1, , markers& :REM long integer 

DIM marker&(markers&) 

FOR n = 1 TO markers& 

GET #1, , marker&(n) :REM long integers 

NEXT  

END IF 

CLOSE #1 

END

ASCII FILES. ASCII files written by this program obey a few simple rules. Such files can be read into almost any statistical or graphics package, spreadsheet or word processor. If you want to write programs that will read these data files, see the end of this section for examples. 

(1) The file contains only characters that are conventional ASCII codes. These are ASCII 10, 13 and 32 to 127 (i.e. alphanumeric characters, spaces, line feeds and carriage returns). 

(2) Optionally, the first file can contain a remark which will be visible when you analyze your data, depending on the software you use. From the second line on, only numerical lines are written. If you do not want a remarks line, press when prompted for a remark. 

(3) Successive fields on a single numerical line are successive channels of data. Each *line* of data (i.e. terminated with a carriage return and linefeed) is treated as a new sample number. 

(4) The delimiter between successive fields is be a comma (","). If you would prefer another delimiter such as a or space, you can load the ASCII file into an ASCII text editor (such as WordPerfect's Program Editor, the Norton editor, or equivalent products) and do a global search and replace. 

(5) Note that when you load an ASCII file into another program, that program does not "know" the sampling interval you used to acquire your ASCII data, and you must supply that information. This information can be obtained automatically by the other program (eg. DAN). If you opt to save the ASCII file with a remarks line (i.e. if you do not simply press when asked for remarks), the following is always appended to your remarks: and, if present, is the first line of the file (see above): 

INTERVAL(n) 

where n is the sampling interval in seconds. 

Note that saving an ASCII file is time-consuming because it is, after all, a slow and bloated and computation-intensive format. 

SAMPLE PROGRAMS - ASCII 

A. This program will write data from an array, d(chans,nsamples) where chans = the number of channels and nsamples = the number of samples. 

INPUT "Enter filename: ",FileName$ 

LINE INPUT "Enter remarks (if any): ",Info$ 

OPEN FileName$ FOR OUTPUT AS #1 

IF Info$ <> "" THEN PRINT #1, Info$ 

FOR N = 1 TO nsamples 

FOR C = 1 TO chans - 1 

PRINT #1, d(C, N);","; 

NEXT 

PRINT #1, d(chans, N) 

NEXT 

CLOSE #1 

END

B. This program will read ASCII data into an array, d(). You must tell it the filename of the file to be loaded, and the number of channels it contains. It assumes comma delimiters between adjacent fields if there is more than one channel, and that there is no initial remarks line. 

INPUT "Enter filename: ",FileName$ 

INPUT "Enter number of channels: ",chans 

DIM d(chans, 1000) :REM second figure should exceed max nsamples 

OPEN FileName$ FOR INPUT AS #1 

nsamples = 0 

DO UNTIL EOF(1) 

nsamples = nsamples + 1 

FOR N = 1 TO chans 

INPUT #1, d(N, nsamples) 

NEXT 

LOOP 

CLOSE #1 

END

LOTUS® 1-2-3 files. These files can be loaded into most commercial spreadsheet, graphics and statistical packages. This program saves files with the .WKS suffix, in the following format: 

Column A, row 1. Remarks, as entered in the [SAVE DATA] option. 

Column A, row 2. Timebase units (always SECONDS). 

Column B onwards, row 2: Channel numbers. 

column A onwards, row 3 onwards: First the elapsed time in seconds since the start of the recording (column A), then each channel for a given sample (columns B on). Each sample (1 to the number of samples that you specified) is on a new row, with all the channels recorded at that sample in successive columns in that row, preceded by the timebase in column A. 

Back to top... 

Sable Systems is a company founded by scientists for scientists. We are certain that you will enjoy doing business with us.

Google-Translate-English to French Google-Translate-English to German Google-Translate-English to Japanese Google-Translate-English to Chinese Google-Translate-English to Spanish Google-Translate-English to Portuguese
Powered by