Robot Controller Digital Input

The RC Digital Input is Not active (off) and set at +5V when it is not connected to ground.

The RC Digital Input is Active (On) when It is tied to ground, at 0V.

What happens when I apply an analog signal to this, from ranges from 0 to 5 volts? Does this mean that If I apply a 1.5V signal to the digital input, will the RC still think it is (Off), and thus Not Active? Obviously, If I put a 0V signal this is ground, and this is enough to trip the digital inputs?

The FullSize RC reference manual says, I can’t apply a positive voltage to any of the digital inputs… But I don’t exactly know why they say we can’t.

thanks for any help.

The input circuit has some threshold. If the input is below this voltage, it will be seen as low (active), above it will be seen as high (inactive). I’d have to see a schematic for the RC to know precisely what this threshold is (or run an experiment), but many common logic systems switch at about 1.4V.

It is possible that the input has “hysteresis” where the high>low threshold is lower than the low>high one.

You should also realize that the threshold is not precise, it can vary from part to part and can change with temperature, voltage, etc.

The digital inputs have some pull up circuit, probably a resistor. This could affect the output of your analog circuit depending on its design.

This is very common practice for interfacing unknown inputs to a complex circuit for digital or status inputs. The input circuit is designed to look for a closing contact to ground or common. The input is designed so that no voltage need be applied from the external circuitry and therefore no crosstalk or voltage interaction that could cause the power supply of the robot controller to induce misc data in any input or affect the operation of the controller. For this reason, applying any voltage, even if it is 5 volts or less, runs the risk of causing errors or damage to the controller or it’s power supply.

The inputs are standard TTL or CMOS digital inputs. Their thresholds are listed in Data Sheets on manufacturers websites. No mention has been made (re IFI equipment) of Schmitt trigger inputs, which have hysteresis, and which would change things only a little.

The highest threshold they would have is CMOS’s half of Vdd, with the IFI system, about 2.5 V. TTL and CMOS with TTL-compatibility will switch at around 1.25 to 1.5 V. I haven’t tested which IFI has, as it seems unimportant.

Any of these inputs acts like a high impedance input, with a 1 to 100 kohm resistor (depending on logic family) pulling it up to the +5V rail. Basically, the input voltage is either 5 V (but high resistance) when open, or zero when the switch is closed to ground. If you put a resistance from input to ground that is in the range of the pull-up, the state of the output would be practically indeterminate.

When the input is grounded, the fact is reported in the rc/oi_sw bytes as a one.

Analog (slowly varying) signals cause jittery outputs when near the threshold of non-schmitt trigger inputs, and the output snaps to +5V or 0V when the input voltage is further from the threshold. For large (steep slope) analog signals, the output appears as a square wave. Depending on your analog output impedance and voltage, you could have a low, a high, some jitter, or even a serious oscillation [possibly RF] (at the threshold, where the gate is biased to linearity, the gain of ttl gates is very, very high).

Since the IFI eqipment reads the values only every 26 ms (a value posted by others elsewhere in CD), you would not read the jitter near threshold, but the value would not be reliable.

Feeding a pot or a gyro into such a digital input is a poor substitute for using the analog inputs on the other connector. They have ADCs to read the voltage. Once you have a number, your program can compare to other values.

If you apply a positive voltage, say via a switch connected to +5V, you would be taking an input already pulled up to +5V, and switching it to +5V. You’d see no change, so it won’t tell you about the switch closure.

BUT, if the +5V is more than half a volt higher than the input IC’s +5V, say form a separate (external to IFI) power supply that fails and goes high (eg, to 12V), or a badly adjusted op-amp, you could cause a current flow into the IC’s substrate, which would damage the IC permanently, so DON’T. Yes, there are series input saftey resistors in good practice, but good practice says don’t depend on them.

So… don’t put your daughter on the stage, Mrs Worthington (the outcome is predictably bad), and don’t apply analog signals to digital inputs (the output is unpredictably bad).

Sorry for the length.

*Originally posted by Lloyd Burns *
**If you put a resistance from input to ground that is in the range of the pull-up, the state of the output would be practically indeterminate.
**

Thanks LLoyd,
I should add here for anyone following this thread, if the input circuitry is CMOS and if you were to encounter the above scenario, this logic family has a nasty tendency to go into a linear region (acting like an amplifier instead of a digital IC)and that causes the IC to draw high currents from the power supply.
All in all, we must use the equipment as intended, digital devices to digital inputs.

would anyone mind repeating all that above in a language a poor robotics member (that has played with circuits but hasnt taken electronics and therefore wouldnt know the names for eveything) would understand?

The binary inputs are designed to be used with contact switches and no other external components. They’re actually doing you a favor, but it makes it a little harder to interface TTL level inputs.

If you want to connect a switch to a pin on the stamp (not the RC) you’d need a pull-up resistor so that the pin has a stable value. When the switch is closed, the pin is shorted to ground.

The pin is internally inverted byt the RC so it sees a 0 when the switch is open and 1 when its closed. Since the input is already pulled up to +5V, applying a voltage to it won’t change the value. If you apply more than +5V you’ll fry it.

If you have an external circuit that you want to interface with the binary inputs, you’ll need to use a component that acts like a switch. I’m sure there are other ways to do it, but I know that an NPN BJT (bipolar junction transistor) as an open-collector switch works fine. You connect the binary input to the collector pin, a ground to the emitter pin, and your logic signal to the base. You also need to connect a ground from your external circuit to the emitter pin. When your signal goes high it closes the switch and when its low it opens it. You can get a pack at Radio Shack for a few bucks.

I REALLY want access to the Switch 1/2/3 LEDs on the operator interface.

I have some electronics knowledge, and suspected that the DIs are open collector inputs with a pull up resistor.

I am wondering how involved it would be to use say an NPN (ie current sinking) switching transistor with one of the relay outputs to switch one of the digital inputs?

If possible, I would then use some of my unused relay outputs to control DI 1/2/3 and hence the three LEDs on the OI.

Can any electronics gurus out there suggest a simple circuit?

Thanks

What seanwhite posted just clicked with me…

Questions:

Just the bare NPN BJT transistor?
No current limiting resistor?
No biasing?

Thanks!

*Originally posted by dave_l *
**I REALLY want access to the Switch 1/2/3 LEDs on the operator interface.

I have some electronics knowledge, and suspected that the DIs are open collector inputs with a pull up resistor.

I am wondering how involved it would be to use say an NPN (ie current sinking) switching transistor with one of the relay outputs to switch one of the digital inputs?

If possible, I would then use some of my unused relay outputs to control DI 1/2/3 and hence the three LEDs on the OI.

Can any electronics gurus out there suggest a simple circuit?

Thanks **

The OI Manual (.pdf from IFI) says that the switch LEDs represent the switch inputs on the RC and are not programmable in PBASIC.

On the other hand, if you used sw1 for the input from your pressure switch, for determining when the compressor should be turned on, you could see from the sw1 LED when the compressor was drawing the battery voltage down.

The “relay outputs” that show up on the OI are the signal the RC passed back to the OI. This same pair of bytes (RelayA and Relay B) are passed inside the RC to the bank of output circuits which control the relay outputs. Shorting one of these would short an output, but have no effect on the feedback bytes, nor on the LEDs. If you wish to use the relay LEDs, you’ll have to use Relay1_fwd = 1, or Relay2_rev = 0, to do it

Have you thought of utilizing Out8,9,10 & 11 ? These are low-current outputs to drive your LEDs, and are available from Port1.

dave_l :

Yes just an OC NPN transistor, collector to the input, emitter to ground. Biasing in a digital connection is optional. Every RC digital input has a 10k pull-down resistor to +5V, and all the series resistance it wants, internally. for the sake of your transistor, some series resistance in the base circuit is recommended.

See the IFI site for a .pdf file of the equivalent input circuit.

This is the kind of output you have with the Banner sensors (discussed elsewhere on CD).

I’m already using all 8 of the PBASIC accessable LEDs on the OI. I want PBASIC access to the other three OI LEDS. Since they are hardwired to DI 1/2/3, I seek a way to switch those three DIs under program control. Hence my thought of wiring unused Relay Outputs to those three Digital Inputs. Thus, setting a relay out (under program control) switches the DI, resulting in control of the LED on the OI.

re: “some series resistance in the base circuit” - suggestions? couple hundred ohms?

re: “See the IFI site for a .pdf file of the equivalent input circuit” - which file? I’ve pulled and reviewed most of them, and can’t think what you might be referring to…

re: “kind of output you have with the Banner sensors” - I’ll check those docs out

Thanks again!

Relay o/p are indeed 0V or 5V ! Connecting a relay o/p pin, either W/Y or R, to a digital input pin will indeed give you control of those LEDs.

I relied on the diagram IFI posted, showing the gate with 10k pullup to voltage.

BTW, a 2002 RC input switched the switch LED on the OI at 1V< Vin < 2V, so it is not a CMOS (4000 series or 74HCMOS) compatible input, unless IFI used 3V logic, and against that, the open circuit voltage of the pin is 5V. It could still be 74HCTxxx compatible.