Sensors and actuators
Switches provide a digital input and can be hooked up in the configurations shown on the right. The active low configuration (the switch makes a connection to the ground if it is pushed – the figure on the left), is the preferred method for connecting switches. If you are using a normally open (N.O.) push-button switch, when the switch is pressed, it will send a low level (0V) to the terminal (thus the term “active low”).
A potentiometer (or “pot”) can be used to provide an analog input to a IpsonLab/Microlab terminal. Using the configuration in Figure 3, a pot will vary the input voltage to the terminal from 0-5v – in other words, the full input range of the terminal. 10k is a typical value for use in this configuration, but anything from 1k to 1M should work fine.
Resistive sensors, such as photo-resistors, force sensing resistors (FSRs) or flex sensors, can be wired in either configuration shown in Figures 4 and 5. Using the Figure 4 configuration, the terminal voltage
will decrease with increasing resistance. Using the Figure 5 configuration, the terminal voltage will increase with increasing resistance. Use whichever configuration is most convenient for your application.
You will also need to select an appropriate value for the fixed resistor R based on the resistance range of your sensor. In general, it is best to select a value for R that gives the largest voltage range for the sensor. The optimal value is R = sqrt(Rmin * Rmax); that is, the square root of the sensor’s minimum
resistance times the sensor’s maximum resistance. Once you compute the optimal value, select a standard resistance value that is closest to it. This will give the maximum voltage range for your sensor and thus the best resolution. Use the input min. and max. adjustments for the terminal to compensate for voltage offsets, as described above in the section Analog input mode details.
Digital and analogue output: LEDs
LEDs can be driven by terminals in either digital or analog output modes. Digital output provides on/off, whereas analog output provides for dimming. For digital output, using the configuration in Figure 6, the LED will turn on when the terminal goes high (5v) and off when it goes low; the opposite is true. For analog output, the LED will get brighter with increasing analog values; again, the opposite is true for Figure 7. For digital output, you can use to polarity setting to compensate for either wiring configuration, so that
received MIDI commands will have the effect you desire. In general, you will probably want to use positive polarity for active high configurations and negative polarity for active low. Historically, active low was the preferred configuration due to microprocessor electrical capabilities.
Digital output: Relays, solenoids and motors
Digital outputs can be used to switch DC electromechanical devices such as relays, solenoids and motors using the circuit in Figure 8. The device is represented as a coil in the circuit. When the terminal outputs a high level (5v), it will switch on the NPN transistor, which will allow current to flow through the coil and turn on the device. Vcoil is dependent on the device’s voltage requirements (i.e. it does not need to be 5v). The transistor type is dependent on the device’s voltage and current requirements.
The diode is required because devices with coils will kick back current when they switch off. A diode wired in this way will protect the transistor and power supply from damage. A 1N4001 will work well for many applications. It is best to wire the diode as close to the device’s terminals as possible. Be aware to wire the diode in the right direction (it has a + and a -).