Controller Input/Output Overview

In order to be useful, a controller, must control things. DUH! In computer jargon, it is said that the computer has outputs.

In some cases, the controller is just telling the world what to do, and does not care what may be going on in the world. But most of the time, the controller wants to check on a condition - peeking at the condition of the outside world - before doing something. In computer jargon, it is said that the computer has inputs.

This page is an overview of some background that is necessary to discuss input and output.

We have examples of input and output using BASIC Stamp.

skip list of on-page links

Understanding Relative Voltage Levels

In order to hook up the hardware, you must understand relative voltage levels.

Let's say that you have a friend Tom (who is 6' tall), and Mary (who is 5'6" tall). You can say "Tom is taller than Mary." Tom is described in terms relative to Mary. Even if you don't know exactly how tall Tom is (but Mary is nearby), you can envision Tom as being taller.

You can't use a relative description without something to base it on. You can say "My friend Tom is tall", without reference to anybody else. But you can't say "My friend Tom is taller", unless you state or imply some standard against which to measure. Otherwise, one is inclined to ask, "Taller than whom?"

In the same way, signals going into or out of a controller must be described relative to something. That thing is the "ground" of the controller.

So...

Positive Logic - Save Your Sanity

Computers and controller are powerful and flexible. Modern digital computers deal in the binary system of ones and zeroes, so even the math isn't hard.

But humans can easily be confused if they use inconsistent terminology to communicate with computers.

As an example, the horn on an automobile is usually activated with a momentary switch. Left to itself, the switch does nothing and the horn does nothing. But when you press the switch, the horn honks. That's positive logic - you have to do something (press button) to get an effect (horn honks).

But consider an automobile with a different kind of switch - one that makes noise when left to itself and stops when you press the button. That's negative logic - you have to not do something (don't press button) to get an effect (horn honks).

Does negative logic sound far-fetched? Consider a gym treadmill with a safety switch on it. As long as you hold the handlebars, a switch is closed and the treadmill will operate. Take your hand off the handlebars, the switch opens, and the machine assumes that you have fallen and shuts off.

Negative logic can be useful, but is also confusing. Would you like driving a car that required you to keep pressing the horn button just to drive in silence?

We suggest that you use positive logic wherever possible and adhere to the following conventions:
all in this column are equivalent all in this column are equivalent
true false
yes no
1 0
on off
high low
+5 Volts ground (0 Volts)
active inactive
do something do nothing

Perhaps all of this makes good sense to you. You like the idea that 1=yes=on. And you ask yourself why I would even try to warn you about the alternatives.

The PROP-1 operates internally using a nice low 5 Volts. The solenoids and other output gadgets usually operate on 12 Volts or 24 Volts - and they need a substantial amount of current, so the PROP-1's brain chip can't operate them directly.

So the PROP-1 uses an output driver chip that does level shifting to the higher solenoid voltage and can handle the substantial current. Unfortunately, the chip also "inverts" the signal - flipping it upside-down. So, when you send out a 1, the processor brain sends out +5 volts, which the driver chip turns into 0 Volt ground.

In order to get the solenoid to work, you must connect it between +12 Volts and the output pin. And few people really expect this.

Similar confusion can happen on inputs, if you wire a Normally Open switch with a pull-up resistor or Normally Closed switch with a pull-down resistor.

Level Shifting

Computers operate using small voltages inside, often 5 Volts. As far as the programmer is concerned, all he deals with is "true" and "false".

But the real world is seldom directly compatible with small voltages. 5 Volts won't drive a pneumatic solenoid.

The controller needs something, some piece of hardware, that converts the 5 Volt signal from the controller into (for example) 24 Volts to run a solenoid.

This is commonly called "level shifting".

Level shifting happens with input, too, because the various gadgets that provide the controller with trigger input may be operating at different voltage levels.

Related Pages

Skip this list.
You may be interested in these related pages:
privacy policy | write to us | tip us
©Copyright 2005-2006, 2011 by The Wolfstone Group. All rights reserved.
You must read and abide by our terms of service.