ANY-maze Help > I/O devices supported by ANY-maze > The ANY-maze interface device family > The ANY-maze Digital interface > The ANY-maze Digital interface switch output ports

The ANY-maze Digital interface switch output ports

Contents

This topic contains full details about ANY-maze Digital interface switch output ports and covers:

 An introduction to switch outputs 
 Configuring a switch output port 
 Connecting to a switch output port 
 Testing a switch output port 
 Switch output port specification  

An introduction to the switch output ports

The ANY-maze Digital interface switch output ports allow ANY-maze to control equipment which is activated using a logical 1 or logcal 0 signal - for example, a pellet dispenser with a 'dispense' input.

The 'pin-out' of the ANY-maze Digital interface ports is as follows (counting left to right, looking into the port):

 Pin 1Digital port N
 Pin 2GND
 Pin 3Digital port N+1
 Pin 4GND

A switch output simply connects to a digital port and GND. So it could be connected to pins 1 and 2 or pins 3 and 4.

Internally, ANY-maze Digital interface digital ports are 'pulled-up' to 5V via a 15K resistor and include a 160 ohm series resistor - these resistors have no effect when connecting directly to equipment with a switch input but the 160 ohm resistor is critical when using a TTL output port to drive an LED.

  

  

Figure 1. Conceptual internal circuit of an ANY-maze Digital interface switch output port. The same circuit applies to pins 3 and 4 as well.

Configuring a switch output port

To configure a port as a switch output, you should open the ANY-maze Digital interface configuration window, select the appropriate port and then select Switch output from the Use this port as a drop down list. This is described in detail here.

When a port is configured as a switch output, some additional options are available in the configuration window - see figure 2, below:

  

  

Figure 2. The switch output port options.

Changing the port's active state

As you'd probably expect, the ANY-maze Digital interface will output a HIGH signal when it is active and a LOW signal when it is inactive. This is usually correct, but you may find that the equipment that you're connecting to has 'active low' inputs, that's to say that to activate it one needs to output a LOW signal. In this case, you can use the port's Active state options to change the output's configuration accordingly.

Connecting devices to a switch output port

The 'pin-out' of the ANY-maze Digital interface ports is as follows (counting left to right, looking into the port):

 Pin 1Digital port N
 Pin 2GND
 Pin 3Digital port N+1
 Pin 4GND

Connecting to equipment that has a switch input

You should connect the output signal to either pin 1 or 3, and GND to either pin 2 or 4. The two GND pins (2 and 4) are the same, so you can connect to either of them (this is important if you change Pin 2 to be 5V). Note that you MUST connect BOTH the signal line and the GND line to the equipment that you want to control.

Connecting an LED

To connect to an LED you should connect the LED's anode (usually the longer leg of the LED) to Pin 1 or 3 and the LED's cathode (usually the shorter leg of the LED) to pin 2 or 4. If you connect the LED backwards it won't work, but it won't be damaged either, so if you're not sure which is the anode and which the cathode just try connecting it both ways.

Usually LEDs require what's called a current-limiting resistor - as the name implies this limits the current that will flow through the LED to the level the LED is designed for. The ANY-maze Digital interface switch output ports include a built-in 160 ohm resistor, so you usually won't need to add a current-limiting resistor yourself. However, it's still a good idea to check the current won't exceed the LED's maximum, which you can do by using the following formula:

Current (amps) = (5 - LED forward voltage) / 160

The LED forward voltage can be found in the LED datasheet, but usually it's around 2V for red and orange LEDs and around 3.5V for green and blue. So for red and orange the above formula tells us the current will be around 20mA, and for green and blue around 10mA. Most LEDs are designed to work at a current of around 20mA or less, so red and orange LEDs will be at their ideal current while green and blue will be less, which means they'll be a bit dimmer, but usually still bright enough to make a good cue lamp.

If you apply the above formula and find that the current will exceed the maximum forward current of the LED you want to use, then you should add your own current-limiting resistor to reduce the current. Use this formula to calculate the resistor to use:

Resistor in ohms = ((5 - LED forward voltage) / (Max forward current in amps)) - 160

As an alternative to using your own LED, you can just buy an LED cue light from us. We supply a range of colours in sealed assemblies which mount directly into a drilled hole - check out our web site to learn more.

Testing a switch output port

After you have connected your equipment to a switch output port, you will of course want to test it. This is easily done using the I/O page.

 1.Open the ANY-maze Digital interface in the list on the left side of the I/O page. 
 2.Select the interface's Output switches, again, in the list on the left side of the page. 
 3.The right hand side of the page will show all the ports that are configured as switch outputs; they will all be shown as inactive (red). 
 4.Click on one of the ports to activate it - it will turn green (like Port 2 in figure 3, below) and the output will change to the 'active' output signal (which will normally be HIGH). The equipment connected to the output should then activate.  

  

  

Figure 3. Testing the ANY-maze Digital interface on the I/O page. Here the equipment connected to port 2 has been activated.     

If you find that the equipment does not activate when you activate the port then:

 Check the wiring 
 Check the port you're activating is indeed the port you've connected the equipment to 
 Check the port's active state and alter it if necessary.     

If all else fails, then contact ANY-maze Support who'll be happy to help.

Switch output port specification

 Maximum update frequency200Hz
 Maximum output current±30mA
 Output series resistor160 ohm
 Power output5V (available on Pin 2, if so configured)
 Max power current300mA (USB powered), 900mA (DC powered)

See also:

 An overview of the ANY-maze Digital interface 
 Setting up the ANY-maze Digital interface 
 Configuring the ANY-maze Digital interface 
 Connecting the ANY-maze Digital interface to your equipment and testing it 
 Using the ANY-maze Digital interface in tests 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T1439