Saturday, May 28, 2005

Controlling hardware with computers 101

A controller (e.g. Labjack) is needed to interface a computer to hardware (e.g. DC motor). A power source is needed for most controllers if the computer port has insufficient power.

The simplest way to control a DC motor is to use a transistor. To control the direction, use an H bridge. Use one of the computer's ports (USB, parallel port etc.) to communicate with the controller. To get feedback from the hardware, use a sensor (e.g. encoder that gives the position of the DC motor).

A controller will have one or more of the following -
  1. Counter - Keeps track (on an internal register) of voltage pulses (e.g. from an encoder). The computer can then query this register (e.g. to find out the position of a DC motor).
  2. Analog input - Converts a voltage level (e.g. from sensors that convert temp into voltage) into a digital value that can then read by the computer.
  3. Analog output - Converts the digital values from the computer to a voltage level which can be used to produce a variable output.
  4. Digital input - Each digital I/O can be configured to one of 3 states - input, output-high or output-low. If the voltage is higher than a threshold value, the computer will read the digital input as high/1, and if it is lower than another threshold value, the computer will read it as low/0.
  5. Digital output - If the computer instructs a high output, the output will produce a voltage (e.g. 5 volts), and if the computer instructs a low output, it produces no voltage.

0 Comments:

Post a Comment

<< Home