Input Interface Circuits

Input Interface allows sensors (Input Converters) devices and computers to communicate with microcontrollers.

Interface isa method of connecting or connecting one device, especially one computer(PC), single card computer (SBC) or microcontroller with another, allowing us to design or adapt the output and input configurations of two electronic devices so that they can work together.

But interface creation is more than just using the software program of computers and processors to control something.While the computer interface uses one-way and bidirectional input and output ports to operate a variety of peripheral devices, many simple electronic circuits can be used to interface with the real world using mechanical switches as input or separate LEDs as output.

input interface

For an electronic or micro-electronic circuit to be useful and effective, it needs to interface with something.Input interface circuits, op-amps, logic gates, etc. connect electronic circuits to the outside world by expanding their capabilities.

Electronic circuits amplifiers, buffers or processes signals from sensors or switches to control lamps, relays or actuators as input information or for output control.In both cases, input interface circuits convert the voltage and current output of one circuit to the equivalent of the other.

Input sensors provide an input for information about an environment.Physical quantities such as temperature, pressure or ever-changing temperature, pressure or position can be measured using a variety of sensors and switching devices that signal an exit according to the measured physical quantity.

Many of the sensors we can use in our electronic circuits and projects are resistant because their resistance changes with the measured amount.For example, thermists, strain gauges, or light-dependent resistors(LDR).All of these devices are classified as input devices.

Input Interface Circuits

The simplest and most common type of input interface device is the push button switch, that is, the button.Mechanical ON-OFF switches, push button switches and reed switches, etc., are popular as input devices due to their low costs and easy access interface.The operator can also change the state of an input by running a switch, pressing a button, or moving a magnet over a magnetic switch.

Input Interface and a Single Key

input interface

Switches and push buttons are mechanical devices with two or more groups of electrical contacts.When the switch is turned on or disconnected, the contacts are turned on and short-circuit when the switch is turned off or activated.

The most common way of an electronic commissioning interface of a switch (or push button) is through a pull-out resistance to the feed voltage, as shown.When the switch is on, 5 volts or logic "1" are given as the output signal.When the switch is turned off, the output is grounded and 0v or logic "0" is given as the output.

Then a "high" or "low" output is produced, depending on the position of the switch.A tensile resistance to keep the output voltage level at the required value (+5v in this example) when the switch is on, as well as to prevent the switch from short-circuiting the supply when it is switched off.pull-out/pull-up) is required.

Tensile resistance(pull-out/pull-up) size depends on the circuit current when the switch is on.For example, when the switch is on, the current will flow through the resistance towards the V OUT terminal, and this current flow from the Ohm Act will cause a voltage drop along the resistance.

Next, assuming that a digital logic TTL gateway requires an input "HIGH" current of 60 micro amps (60uA), this causes a voltage drop of 60uA x 10kΩ = 0.6V along the resistance, and the input produces a "HIGH" voltage.5.0 – 0.6 = 4.4V is included in the input features of a standard digital TTL gateway.

A switch or push button can also be connected in "active high" mode, where the switch and resistance are inverted to connect the switch between the +5V supply voltage and the output.The resistance, now known as pull-out, is connected between the output and 0v of soil.In this configuration, when the switch is on, the output signal is in V OUT 0v or the logic is in "0".When the button is activated, the output is "HIGH" and goes to the +5 volt supply voltage or "1" logic.

Pull up used to limit current(pull-up) resistance,The main purpose of (pull-out) resistance is to prevent it from fluctuating by connecting the output terminal V OUT to 0v or soil.As a result, a much smaller resistance can be used, since the voltage drop on it will usually be very small.However, a very small pull downUsing a (pull-out) resistance value causes high currents and high power loss in resistance when the switch is switched off or operated.

DIP Key Input Interface

input interface

In addition to providing the circuits with an input interface between individual push buttons and push switches, we can combine several switches in the form of keypad and DIP switches.

DIP or Dual-in-line Packet switches are individual keys grouped into four or eight keys in a single package.This allows DIP switches to be inserted into standard IC sockets or connected directly to a circuit or board (breadboard).

Each key in a DIP key pack normally shows one of two conditions based on on-OFF status, and a four-key DIP packet will have four outputs, as shown.Both sliding and rotary type DIP switches can be connected to each other or in combinations of two or three switches, making them very easy to enter into a wide variety of circuits.

Mechanical switches are popular due to their low costs and ease of input interface.However, mechanical switches have a common problem called the "contact tab".Mechanical switches consist of two pieces of metal contact that are pushed together to complete a circuit when you operate the switch.However, instead of producing a single clean switching action, metal parts touch and jump together inside the body of the switch, causing the switching mechanism to turn on and off very quickly several times.

Since mechanical key contacts are designed to turn on and off quickly, there is a damping name to stop them from jumping when making contacts or breaking.The result is that this leaping action produces a series of pulses or voltage spikes before the key establishes solid contact.

Button Jump

input interface

The problem is that any electronic or digital circuit with the input interface of the mechanical switch can read these multi-switch operations as a series of ON and OFF signals that last several milliseconds, rather than just the intended single, positive switching action.

This multikey shutdown (or on) action is called Switch/Button Jump on switches, and the same action is called Contact Jump in relays.In addition, since switch and contact splash occurs during both on and off actions, the splash and arc that occurs throughout the contacts cause wear, increase contact resistance and shorten the working life of the switch.

However, there are several ways to solve this key splash problem by using some extra circuits in the form of a return circuit for "bouncing" the input signal.The easiest and simplest way is to create an RC bounce circuit that allows the switch to charge and empty a capacitor as shown.

Jump Blocking with RC Button

input interface

With the addition of an extra 100Ω resistance and 1 uF capacitor to the switch input interface circuit, key splash problems can be filtered.The RC time constant, T , is selected so that the mechanical switching action is longer than the jump time.A reversal Schmitt trigger buffer can also be used to produce a sharp output transition from LOW to HIGH and HIGH to LOW.

So how does this type of input interface circuit work? In the RC Charging training, we found that a capacitor charges at a speed determined by the time constant T .This time constant value is measured in T = R*C, where R is the value of resistance in Ohm, and C is the farad value of the capacitor.This then forms the basis of an RC time constant.

First let's assume that the switch is turned off and the capacitor is completely discharged, then let's send a signal with inverter input LOW and output HIGH When the switch is turned on, the capacitor charges through two resistors, R1 and R2, at a rate determined by the C (R1+R2) time constant of the RC network.

While the capacitor charges slowly, any jump in the key contacts is softened by the voltage on the capacitor plates.When the load on the plates is equal to or greater than the lowest value of the drive's upper input voltage (V IH), the drive changes state and output is LOW.In this simple example of key input interface, the RC value is about 10mS, giving key contacts enough time to settle into their last open state.

When the switch is turned off, thethe capacitor quickly discharges from 100Ω to zero at a rate determined by the C(R2) time constant by changing the output status of the inverters from LOW to HIGH.However, the operation of the switch causes the contacts to jump,causes the capacitor to want to charge repeatedly and then quickly ejaculate to zero.

Since the RC charging time constant is ten times longer than the discharge time constant, the input elevation time slows down, so before returning to the final closed position of the switchthe capacitor cannot charge fast enough, so the inverter maintains HIGH output.As a result, no matter how much the key contacts jump during on or off, i.e. jump, you will receive only one output pulse from the inverter.

The advantage of this simple key recoil circuit is that if the key contacts jump too much or bounce for too long, the RC time constant can be increased to compensate.Also note that this RC time delay means that you will have to wait before running the switch again, since if you run the switch too early, it will not generate another output signal.

Although this simple switch recoil circuit will work for input interface single (SPST) switches to electronic and microcontroller circuits, the disadvantage of the RC time constant is that it brings a delay before the next switching action takes place.This delay may be unacceptable if the switching action changes state quickly, or if multiple keys are run, such as on a keypad.One way to overcome this problem and produce a faster input interface circuit is to use cross-linked NAND or 2-input NOR gateways, as shown below.

Preventing Splash with NAND Gate

input interface

This type of key return circuit works very similar to the SR Flip-flop that we reviewed in the Sequential Logic section.Two digital logic gates, two NAND door entrances, two 1kΩ tensile resistance as shown(pull-out) as a pair of cross-connected NAND doors with active LOW inputs forming an SR Latch circuit.

Also, because the circuit operates as a Set-Reset SR latch, the circuit requires a unipolar duplex (SPDT) pass switch instead of the unipolar unicorn (SPST) switch of the previous RC bounce circuit.

When the switch of the cross-coupling NAND bounce circuit is in position A, nand gate U1 is "set" and output logic in Q is HIGH in "1".When the key location is moved, B is the "group" that U2 resets to U1.The output in Q is now LOW in the logic "0".

Running the switch between positions A and B changes output in Q from HIGH to LOW or LOW to HIGH.

In addition to using cross-bound NAND gateways to create a latch input interface circuit with two states, we can also use cross-connected NOR gateways by changing the position of the two resistances and reducing their value to 100Ω, as shown below.

Preventing Splashing with NOR Gate

input interface

The operation of the cross-coupled NOR pass bounce circuit is the same as the NAND circuit, except that the Q output is HIGH when the switch is in position B and low when in position A.

Then, when the input interface switches to circuits that use a NAND or a NOR latch to use as fallback circuits, it is worth noting that nand configuration requires a LOW or logic "0" input signal to change the state, while the NOR configuration requires HIGH or logic.

Interface with Opto Devices

An Optocoupler (or optoizolator) is an electronic component with an LED and light-sensitive device, such as a photodiode or phototransistor coated in the same package.The Opto-coupling, which we examined in a previous tutorial, connects two separate electrical circuits through a light-sensitive optical interface.This means that we can effectively interface two circuits with different voltage or power ratings, one without affecting the other electrically.

Optical Switches (or opto switches) are another type of optical (photo) switching device that can be used for the input interface.The advantage here is that optical switches, microcontrollers, PIC's and other types of digital circuits can be used to detect objects using light, as harmful voltage levels to input pins are for the input interface or because the two components are electrically separate, but combine optically, which provides a high degree.

Optical switches come in a variety of different types and designs for use in a wide range of interface applications.The most common use of opto-switches is the detection of moving or stationary objects.Phototransistor and photodarlington configurations provide many of the features required for photo-switches and are therefore the most widely used.

Corrugated Optical Switch

input interface

A DC voltage is usually used to drive a light-emitting diode (LED) that converts the input signal into infrared light energy.This light is reflected and collected by the phototransistor on the other side of the isolation range and recycled into an output signal.

For normal opto-switches, the forward voltage drop of the LED is about 1.2 to 1.6 volts at the normal input current of 5 to 20 milliampers.This gives a series resistance value between 180 and 470Ω.

Corrugated Opto-switch Circuit

input interface

Rotary and corrugated disc optical sensors are widely used in positional encoders, shaft encoders, and even on the rotary wheel of your computer mouse, creating excellent input interface devices.The rotary disk has a series of slots cut from an opaque wheel with the number of evenly spaced slots representing resolution per rotational degree.Typical encoded disks have a resolution of 256 pulses or 8 bits per turn.

During a rotation of the disk, the infrared light from the LED hits the phototransistor from the slot, and then the disc is blocked as it rotates, making the transistor "ON" and then "OFF" each time the slot passes.Resistance R1 adjusts led current and tensile resistance (pull-out) provides R2 supply voltage, Vcc is connected to the input of the Schmitt inverter, which produces LOW, logic "0" output when the transistor is "OFF".

When the disc turns to an open segment, the infrared light from the LED hits the phototransistor and shorts the Collector-Transmitter terminals into the ground, producing a LOW input to the Schmitt inverter, which in turn gives a HIGH or logic "1".If the inverter output is connected to a digital counter or encoder, it will be possible to count the number of spindle revolutions in unit time to determine the position of the miles or to give the rotations of the miles per minute (rpm).

In addition to using corrugated opto devices as input interface switches, there is another type of optical device called a reflective optical sensor that uses an LED and photo device to detect an object.The reflective opto switch can detect the absence or presence of an object by reflecting the infrared light (hence its name) of the LEDs of the detected reflective object.The basic layout of a reflective opto sensor is given below.

Reflective Optical Switch

input interface

The phototransistor has a very high "OFF" resistance (dark) and a low "ON" resistance (light), controlled by the amount of light that hits the base from the LED.If there are no objects in front of the sensor, the infrared light of the LEDs will glow forward as a single beam.When there is an object near the sensor, the light of the LEDs is reflected back and detected by the phototransistor.The amount of reflected light detected by the phototransistor and the degree of saturation of the transistor will depend on how close or reflective the object is.

Other Types of Opto Devices

In addition to using slit or reflective photo switches for the input interface of circuits, we can also use other semiconductor light detectors such as photo resistant light detectors, PN connection photodiode and even solar cells.All these light-sensitive devices use ambient light, such as sunlight or normal room light, to activate the device, making it easy to interface with any electronic circuit.

Normal signal and power diodes have PN connections in a plastic body to prevent both safety and light photons from crashing.When a diode is inverted, it acts as a highly resistant open switch, blocking the flow of the current.However, if we shed light on this PN connection, the light photons open the connection and allow the current to flow depending on the intensity of the light in the connection.

Photodiodestake advantage of this by making the photodiode extremely light sensitive, having a small transparent window that allows light to hit PN connections.Depending on the type and amount of semiconductor doping, some photodiode react to visible light and others to infra-red (IR) light.In the absence of incoming light, the reverse current is almost nonexistent and is called "dark current".An increase in the amount of light intensity causes an increase in reverse current.

Then we can see that a photodiode allows the reverse current to flow only in a direction that is the opposite of a standard rectifier diode.This reverse current flows only when photodiode receives a certain amount of light, which acts as low impedance devices under very high impedances and bright light conditions under dark conditions, and therefore photodiode can be used as a high-speed light detector in many applications.

Interface Photodiode

input interface

In the two basic circuits on the left, the photodiode is simply inverted through the resistance with the output voltage signal received along the serial resistance.This resistance can usually be between the range of 10kΩ to 100kΩ or, as shown, a constant value as a variable 100kΩ ponciometer.This resistance can be connected between photodiode and 0v soil or between photodiode and positive Vcc feed.

Photodiodes such as BPX48 can react very quickly to changes in light level, while they may be less sensitive than other photo-devices such as the Cadmium Sulfide LDR cell, so there is a form of amplification in the form of a transistor or op-amp. We then found that photodiot could be used as a variable resistant device controlled by the amount of light falling on its connection.Photodiode can switch from "ON" to "OFF" and sometimes return very quickly in nanoseconds or frequencies above 1 MHz, and is therefore widely used in optical encoders and fiber optic communication.

In addition to PN connection photo devices such as photodiode or phototransistors, there are other types of semiconductor light detectors that operate without a PN connection and change resistance properties with changes or variations in light intensity.These devices are called Light Dependent Resistors or LDRs.

Also known as cadmium sulfur (CdS) photocell, LDR is a passive device with resistance that varies according to visible light intensity.When there is no light, their internal resistance is very high in the order of mega-ohm (MΩ).However, when illuminated, their resistance drops below 1kΩ in strong sunlight.Then light-dependent resistors work similarly to ponciometers, but the light intensity controls the resistance values.

Interface of LDR Photodireners

input interface

Light-dependent resistors change resistance values in proportion to light intensity.LDRs can then be used with a series of resistance R to create a voltage dividing network throughout the feed.The resistance of LDR in the dark is much greater than the resistance of resistance, so it can be used as a light detector or a dark detector, as shown, by connecting the LDR to the ground without feeding or resistance.

LDRs such as NORP12 can be used for analog input interface circuits, as they produce a variable voltage output according to resistance values.However, LDRs can also be connected as part of a Wheatstone Bridge arrangement as input to an op-amp voltage comparator, or as a Schmitt trigger circuit to generate a digital signal to interface digital and microcontroller input circuits.

Simple threshold detectors for light level, temperature or voltage can be used to produce TTL-compliant outputs suitable for interfaceing directly to a logic circuit or digital input port.Light and temperature level threshold detectors based on an op-amp comparator produce a logic "1" or a logic "0" input when the measured level exceeds or falls below the threshold setting.

Home Interface Summary

As we have seen in this training section on input and output devices, there are many different types of sensors that can be used to convert one or more physical properties into an electrical signal that can then be used and processed by a suitable electronic, microcontrolling or controller.

The problem is that almost all measured physical features cannot be connected directly to the rendering or upgrade circuit.Next, a type of input interface circuit is required to interface a wide range of different analog input voltages and currents into a microprocessor digital circuit.

Today, with modern PCs, microcontrollers, PIC's and other microprocessor-based systems like this, input interface circuits allow these low-voltage, low-power devices to communicate easily with the outside world, since most of these PC-based devices have built-in input-output ports.

We found that sensors are electrical components that convert some kind of feature into an electrical signal, thereby act as input devices.Adding an electronic commissioning sensors can expand their capabilities by providing information about the surrounding environment.But sensors cannot function on their own, and in most cases an electrical or electronic circuit called an interface is required.