.
Further to Clive's discussion on Process control there is a small $40 device that is an educational tool but is quite capable of serious work, on the market. It is the "Arduino Diecimila' and is shown in the picture. A USB port on the left is connected to a computer for programming. By the thumb is a terminal strip that is used for the inputs (switches, sensors etc) outputs (leds, relays, actuators etc) communication (RS232, PWM etc). Once the device has been programmed using a simple instruction set it can then be put in 'Run Mode' and disconnected from the computer. The program should keep running for up to 40 years. As the output signals are tiny a simple amplifier circuit may be required for useful applications. If all inputs and outputs are rated at less than 48 volts there are no safety issues.
More information at Arduino Homepage