What is the best way to drive a solenoid or LED using a digital output card?
The TTL outputs on many digital output cards are designed to sink much more current than they are capable of sourcing. This current is usually denoted by IOL (current, output low) in the specifications. For example, the IOL for a Keithley PIO-24 card is -64mA. This means that when the output line is low, it can have up to 64mA flowing into the output terminal. If we look at the IOH (current, output high) specification for the same card, it is only 15mA. This means that when the output is high, it can deliver only 15mA of output current. When driving devices such as LEDs, opto-isolators, or solenoids, it is better to take advantage of the IOL specification by connecting the device between the +5 volt supply and the output terminal. To turn the device on, the output would be set low. Also, when driving inductive devices such as solenoids, it's advisable to connect a flyback diode across the coil so that the spike produced by the solenoid when it is de-energized is absorbed by the diode, not by the digital I/O card.
常见问题 ID 70576