8 Non-NI Hardware Alternatives

This section is guaranteed to rile you readers who have been working at NI, as it mentions many direct competitors to NI. But I’m keeping this section in the book at the risk of getting evil looks from my NI contacts, as LabVIEW can be used with any sort of hardware. However, you are going to spend the least amount of time with DAQ in LabVIEW if you stick to NI hardware products. The obvious reason is that one company, NI, makes both the hardware and the software, and they’re designed to work together. If you choose hardware from another company for use with LabVIEW, you are well advised to make sure the hardware has LabVIEW drivers. Unless you have lots of spare time, you don’t want to write your own DAQ drivers!

In this chapter, we discuss non-NI hardware that could be used for DAQ. We discuss homemade hardware, including sound cards, relay interfaces, and using the parallel port for DAQ. Finally, we mention PLCs.

8.1 NON-NI DAQ HARDWARE COMPANIES

Check out www.LCtechnology.com/daq-hardware.htm and see the DAQ Companies section for current information. These companies change all the time, so the above link should help. There are many other companies that make DAQ products, however. For unbelievably low-cost DAQ products, get the current copy of Circuit Cellar magazine. I cannot vouch for these companies’ technical support, so be wary. Table 8.1 provides a listing of some of the more popular DAQ device suppliers.

Table 8.1. DAQ Device Device Suppliers

Image

There are a number of DAQ-related publications, such as Test And Measurement World. See www.LCtechnology.com/daqpubs.htm for a current list of these publications.

8.2 HOMEMADE DAQ HARDWARE

Are you the do-it-yourself type? I sure am! If so, this section is for you.

8.2.1 Sound Cards (Analog I/O)

A common sound card can be used for limited analog I/O. Sound cards have built-in DACs and usually ADCs, and as a bonus, they can use DMA for both input and output! Sound cards work in the 20 Hz to 20 kHz range, which is the frequency range of human hearing. Sound cards vary widely in quality, but with the advent of MP3, they went from low quality to high quality right away. Signal-to-noise ratios are now commonly above 90 dB (15 bits), which is good enough for most DAQ work. LabVIEW has VIs in its Functions»Graphics & Sound palette that can interact with sound cards. Another option is shown in Figure 8-1, the current version of a free function generator that works very well with common sound cards.

Figure 8-1
A freeware function generator.

Image

LabVIEW’S functions can be used with the sound card’s inputs, and there are usually two such inputs: line in and microphone. There is usually one output, and this actually works better than many of NI’s simpler DAQ boards, in that DMA is used so you will get an accurate waveform out, not to mention the greatly decreased cost. The disadvantages are (1) that the amplitude is usually limited to about three volts peak-to-peak, and (2) you will need to come up with your own wiring and connections scheme.

As luck would have it, my HP function generator just died about two days ago (it’s older than I am), so I’m using a sound card as a function generator for one of my circuit design projects right now! Figure 8-2 is a graph of the sound card’s actual output (a sine wave), being generated as I type by the software shown in Figure 8-1.

Figure 8-2
Actual output from a standard sound card.

Image

Dell has high-quality refurbished sound cards; you can probably find some on their Web site, www.dell.com. Concerned about signal quality? As a rule (all these numbers are close approximations), every 6 dB of signal-to-noise ratio (SNR) corresponds to one bit of accuracy; 84 dB gives you 14 bits, 90 dB gives you 15 bits, 96 dB gives you 16 bits, 102 dB gives you 17 bits, and so on.

8.2.2 Parallel Port (Digital I/O)

A PC’s parallel port can be used as a digital I/O DAQ device. It has TTL-level digital I/O lines—eight output lines and five input lines. Using the parallel port can be very tricky, especially if your printer driver is already using this port. The printer driver may do its own reading and writing in the background, thus interfering with your DAQ! For this reason, and to avoid frying your computer’s built-in parallel port if you make a wiring mistake, you should buy a separate parallel port board. They are incredibly cheap, especially if you shop around. Accessing the parallel port can be quite tricky, but once you do access it, it’s very easy to use. For useful information on this topic, see the Parallel Port section of www.LCtechnology.com/daq-hardware.htm.

8.2.3 Relay Interface

There are two general types of relays, solid state and mechanical. Solid state relays have the advantage of having no moving parts, so they typically last longer. The mechanical relay is an electromagnet with a coil that opens or closes a mechanical switch. Often, solid state relays require more current than many DAQ devices can provide from their digital outputs. Even more often, mechanical relays pull too much current for a standard DAQ device’s digital output line, but worse, they can produce very high reverse voltages that could fry your DAQ device!

NI makes many relay boards, using either solid state or mechanical relays. Quite often you will find these economical. But if you want to build your own, Figure 8-3 provides a schematic.

Figure 8-3
A very inexpensive, homemade relay driver is shown here; the diode is needed for mechanical relays with a coil, but may be omitted for solid state relays.

Image

The relay’s contacts are not shown, as they will vary from relay to relay. The 1N914 diode protects your circuitry against the high reverse voltage that can be generated by a mechanical relay. Your 12 volts can be unregulated, coming from a “wall wart”; just make sure it has enough current ability to drive your relay, especially if you’re driving multiple relays. You could substitute other NPN transistors—just make sure their voltage rating is well above 12 V and their current-driving ability is enough for your relay. The circuit in Figure 8-3 will also work if you supply 5 volts to a 5-volt relay.

If you really want to build a cheap relay-driving system, you could use the parallel port pins to drive up to eight relays by using eight of these drivers! I have built such systems for testing motherboards.

8.2.4 Microcontrollers

If you are a real digital hardware hacker, you are already familiar with microcontrollers. If not, you may want to skip this section. If you want to learn about microcontrollers, you’ll need an understanding of digital hardware. Microchip is the best company for learning microcontrollers at www.microchip.com. You can get a starter kit from Microchip, and with the help of a good book like Easy Pic’N: A Beginners Guide to Using Picl6/17 Microcontrollers, by David Benson, published by Square 1 Electronics, you will be on your way. Microcontrollers allow real-time, fast manipulation of digital signals, and with a bit of work, you can acquire analog signals and communicate with the computer’s serial port.

Figure 8-4
A PLC component.

Image

8.2.5 Industrial Automation

A different type of DAQ has been traditionally used in industrial and manufacturing environments. One of the more popular devices is the PLC (Programmable Logic Controller). PLCs are very rugged and reliable devices used in industrial environments for process control. Two of the larger industrial automation manufacturers are Allen Bradley (www.ab.com) and GE Fanuc (www.gefanuc.com). Figure 8-4 is a photo of an Automation Direct PLC controller (www.automationdirect.com).

These modules are usually stacked together side by side in a rack so that you can configure the PLC however you like. You can have industrial-strength analog and digital outputs that are compatible with nearly all devices used in an industrial or manufacturing environment. If you were to get an Ethernet module, you could use LabVIEW, along with NI’s IA Server software, to communicate to the PLC via a standard network. The PLC has its own microprocessor inside, so you could program it as a standalone control system if you wanted. This way, a PLC can operate in a fairly real-time and reliable fashion without the insane overhead and tendency towards crashing found in a certain popular operating system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.179.48