ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > On/off inputs > An introduction to on/off inputs

An introduction to on/off inputs

Introduction

Although ANY-maze can use the video image of your apparatus to determine the location of an animal, there may be situations when you wish to use some type of electronic input to detect things which the analysis of the video image simply can't provide.

For example, your apparatus might include a lever which the animal can press to receive a reward (perhaps a food pellet). Clearly, video tracking will not be able to determine when the animal presses the lever, so to overcome this you could connect a switch to the lever and use the switch to detect the presses - this is exactly the kind of thing that ANY-maze On/off inputs are designed to do. Of course, in this example, you'd not only want to register the lever press, you'd also want it to cause a pellet to be dispensed. This could be done by using an on/off output to control the pellet dispenser, and a procedure to instruct ANY-maze to dispense a pellet when the lever is pressed.

On/off inputs aren't limited to detecting lever presses - they can also be used to detect activation of other types of inputs. For example, a touch switch connected to the spout of a water bottle could be used to detect when the animal licks the spout, or a photobeam placed across a hole could be used to detect nose-pokes.

The full list of supported on/off inputs is:

 Physical switches, such as push button switches and microswitches 
 Digital (TTL/CMOS) inputs  
 Touch switches 
 Photobeams 
 Photobeam arrays   

Connecting the device to ANY-maze

Clearly, if ANY-maze is going to sense the state of a switch, photobeam, etc. then the device will have to be physically connected to your computer. Connecting these types of inputs is actually quite simple, and is done using a special piece of equipment called an Input/Output device (usually abbreviated to 'I/O device') which acts as an interface between your PC and the actual switch, photobeam, or whatever.

You'll find full details about the I/O devices which can be used with ANY-maze in the I/O devices supported by ANY-maze topic - suffice to say that there are a range of devices available to suit most situations and budgets.

Using on/off inputs

Having connected an input - such as micro-switch - to your computer, you then need to add two elements to your protocol in order to use it: an I/O Device element, for the physical I/O device to which the switch is connected, and an On/off input for the switch itself.

In fact, most I/O devices support multiple inputs, so you only need to set up the I/O device element once to make all of its inputs available within the protocol. For example, the ANY-maze Interface device has 16 inputs, so you could connect 16 switches to it - but you would only need to add the device itself to the protocol once. The process of adding an I/O device to your protocol is described in detail in the Setting up an I/O device topic.

It doesn't matter what type of On/off input you want to include in your protocol (it can be any of those listed above). In all cases, you simply add an 'On/off input' element. Doing so will mean that ANY-maze can actually detect when the device is on or off, and the system will then be able to:

 Report a range of measures for the input, including such things as: the number of activations, the total time active, the activation frequency, etc. These measures will all be available both for the apparatus as a whole and also for each zone individually. See On/off input measures for full details. 
 Use the on/off input in a procedure so as to perform some action when the input is activated. For example, you could set up a procedure which would detect when the animal activates a lever twice within a period of 5 seconds and perform some action because of this - perhaps to dispense a food pellet, activate a shocker or play a sound.  

Using multiple physical inputs with a single 'On/off input' item

In some situations, you might find that you want to use more than one physical input to control a single logical 'On/off input' in ANY-maze. This is best explained using an example: Imagine you have a box divided into two parts with a pair of swing doors between them. The animal can push through the doors to get from one side to the other. As there are two doors, you connect two micro-switches, one to each door, to detect the door being opened. Of course, from your point of view it doesn't actually matter which switch is activated, so you'd include an 'On/off input' which would be active when either switch is activated.

This type of situation requires that multiple inputs are logically ORed, i.e. the overall input is active if Switch 1 is active OR Switch 2 is active.

ANY-maze allows you to use multiple inputs in this way - you simply have to specify which physical inputs you want to OR together.

In fact, ANY-maze will also allow you to AND inputs together. As you'd expect, this simply means that the input will only be considered active if ALL the selected inputs are active.

See also:

 An introduction to I/O devices 
 An introduction to Procedures 
 Setting up an On/off Input 

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0134