TECHNOLOGY INSPIRATION
Technology-People-Innovation

Articles by "INPUT OUTPUT Devices"

Input Interfacing Circuits

Input Interfacing to the Real World

Interfacing is the method of connecting or linking together one device, especially a computer or micro-controller with another allowing us to design or adapt the output and input configurations of the two electronic devices so that they can work together. But interfacing is more than just using the software program of computers and processors to control something.

While computer interfacing uses the unidirectional and bidirectional input and output ports to drive various peripheral devices, many simple electronic circuits can be used to interface to the real world either using mechanical switches as inputs, or individual LEDs as outputs.

pushbutton switch

Pushbutton Switch

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

Electronic circuits amplify, buffer or process signals from sensors or switches as input information or to control lamps, relays or actuators for output control. Either way, input interfacing circuits convert the voltage and current output of one circuit to the equivalent of another.

Input sensors provide an input for information about an environment. Physical quantities such as temperature, pressure or position that vary slowly or continuously with time can be measured using various sensors and switching devices giving an output signal relative to the physical quantity being measured.

Many of the sensors that we can use in our electronic circuits and projects are resistive in that their resistance changes with the measured quantity. For example, thermistors, strain gauges or light dependant resistors (LDR). These devices are all classed as input devices.

Input Interfacing Circuits

The simplest and most common type of input interfacing device is the push button switch. Mechanical ON-OFF toggle switches, push-button switches, rocker switches, key switches and reed switches, etc. are all popular as input devices because of their low cost and easy of input interfacing to any circuit. Also the operator can change the state of an input simply by operating a switch, pressing a button or moving a magnet over a reed switch.

Input Interfacing A Single Switch

input interfacing a single switch

Switches and push-buttons are mechanical devices that have two or more sets of electrical contacts. When the switch is open or disconnected, the contacts are open circuited and when the switch is closed or operated these contacts are shorted together.

The most common way of input interfacing a switch (or push button) to an electronic circuit is via a pull-up resistor to the supply voltage as shown. When the switch is open, 5 volts, or a logic "1" is given as the output signal. When the switch is closed the output is grounded and 0v, or a logic "0" is given as the output.

Then depending upon the position of the switch, a "high" or a "low" output is produced. A pull-up resistor is necessary to hold the output voltage level at the required value (in this example, +5v) when the switch is open and also to prevent the switch from shorting out the supply when closed.

The size of the pull-up resistor depends on the circuit current when the switch is open. For example, with the switch open, current will flow down through the resistor to the VOUT terminal and from Ohms Law this flow of current will cause a voltage drop to appear across the resistor.

Then if we assume a digital logic TTL gate requires an input "HIGH" current of 60 micro-amps (60uA), this causes a voltage drop across the resistor of: 60uA x 10kΩ = 0.6V, producing an input "HIGH" voltage of 5.0 - 0.6 = 4.4V which is well within the input specifications of a standard digital TTL gate.

A switch or push-button can also be connected in "active high" mode where the switch and resistor are reversed so that the switch is connected between the +5V supply voltage and the output. The resistor, which is now known as a pull-down resistor, is connected between the output and the 0v ground. In this configuration when the switch is open, the output signal, VOUT is at 0v, or logic "0". When the witch is operated the output goes "HIGH" to the +5 volts supply voltage or logic "1".

Unlike the pull-up resistor which is used to limit the current, the main purpose of a pull-down resistor is to keep the output terminal, VOUT from floating about by tying it to 0v or ground. As result a much smaller resistor can be used as the voltage drop across it will usually be very small. However, using a too small a pull-down resistor value will result in high currents and high power dissipation in the resistor when the switch is closed or operated.

DIP Switch Input Interfacing

dip switch input interfacing

As well as input interfacing individual push-buttons and rocker switches to circuits, we can also interface several switches together in the form of keypads and DIP switches.

DIP or Dual-in-line Package switches are individual switches that are grouped together as four or eight switches within a single package. This allows DIP switches to be inserted into standard IC sockets or wired directly onto a circuit or breadboard.

Each switch within a DIP switch package normally indicates one of two conditions by its ON-OFF status and a four switch DIP package will have four outputs as shown. Both slide and rotary type DIP switches can be connected together or in combinations of two or three switches which makes input interfacing them to a wide range of circuits very easy.

Mechanical switches are popular because of their low cost and ease of input interfacing. However, mechanical switches have a common problem called "contact bounce". Mechanical switches consist of two pieces of metal contacts which are pushed together to complete a circuit when you operate the switch. But instead of producing a single clean switching action, the metal parts touch and bounce together inside the body of the switch causing the switching mechanism to open and close several times very quickly.

Because the mechanical switch contacts are designed to open and close quickly, there is very little resistance, called damping to stop the contacts from bouncing about as they make or break. The result is that this bouncing action produces a series of pulses or voltage spikes before the switch makes a solid contact.

Switch Bounce Waveform

switch bounce waveform

The problem is that any electronic or digital circuit which the mechanical switch is input interfaced too could read these multiple switch operations as a series of ON and OFF signals lasting several milliseconds instead of just the one intended single and positive switching action.

This multiple switch closing (or opening) action is called Switch Bounce in switches with the same action being called Contact Bounce in relays. Also, as switch and contact bounce occurs during both the opening and closing actions, the resultant bouncing and arcing across the contacts causes wear, increases contact resistance, and lowers the working life of the switch.

However, there are several ways in which we can solve this problem of switch bounce by using some extra circuitry in the form of a debounce circuit to "de-bounce" the input signal. The easiest and most simplest way is to create an RC debounce circuit that allows the switch to charge and discharge a capacitor as shown.

RC Switch Debounce Circuit

switch debounce circuit

 

With the addition of an extra 100Ω resistor and a 1uF capacitor to the switches input interfacing circuit, the problems of switch bounce can be filtered out. The RC time constant, T is chosen to be longer than the bounce time of the mechanical switching action. An inverting Schmitt-trigger buffer can also be used to produce a sharp output transition from LOW to HIGH, and from HIGH to LOW.

So how does this type of input interfacing circuit work?. Well we saw in the RC Charging tutorial that a capacitor charges up at a rate determined by its time constant, T. This time constant value is measured in terms of T = R x C, in seconds, where R is the value of the resistor in Ohms and C is the value of the capacitor in Farads. This then forms the basis of an RC time constant.

Lets first assume that the switch is closed and the capacitor is fully discharged, then the input to the inverter is LOW and its output is HIGH. When the switch is opened, the capacitor charges up via the two resistors, R1 and R2 at a rate determined by the C(R1+R2) time constant of the RC network.


When the switch is closed, the now fully charged capacitor will quickly discharge to zero through the 100Ω at a rate determined by the
 C(R2)time constant changing the state of the inverters output from LOW to HIGH. However, the operation of the switch causes the contacts to bounce about resulting in the capacitor wanting to repeatedly charge up and then discharge rapidly back to zero.As the capacitor charges up slowly, any bouncing of the switch contacts are smoothed out by the voltage across the capacitors plates. When the charge on the plates is equal too or greater than the lower input voltage ( VIL ) of the inverter, the inverter changes state and the output becomes LOW. In this simple switch input interfacing example, the RCvalue is about 10mS giving the switch contacts enough time to settle into their final open state.

Since the RC charging time constant is ten times longer than the discharge time constant, the capacitor can not charge up fast enough before the switch bounces back to its final closed position as the input rise time has been slowed down, so the inverter keeps the output HIGH. The result is that no matter how much the switch contacts bounce when opening or closing, you will only get a single output pulse from the inverter.

The advantage of this simple switch debounce circuit is hat if the switch contacts bounce too much or fr too long the RC time constant can be increased to compensate. Also remember that this RC time delay means that you will need to wait before you can operate the switch again because if you operate the switch again too soon it will not generate another output signal.

While this simple switch debounce circuit will work for input interfacing single (SPST) switches to electronic and micro controller circuits, the disadvantage of the RC time constant is that it introduces a delay before the next switching action can occur. If the switching action changes state quickly, or multiple keys are operated as on a keypad, then this delay may be unacceptable. One way to overcome this problem and produce a faster input interfacing circuit is to use a cross coupled 2-input NAND or 2-input NOR gates as shown below.

Switch Debounce with NAND Gates

switch debounce with cross coupled nand gates

 

This type of switch debounce circuit operates in a very similar way to the SR Flip-flop we looked at in the Sequential Logic section. The two digital logic gates are connected as a pair of cross-coupled NAND gates with active LOW inputs forming a SR Latch circuit as two of the NAND gate inputs are held HIGH (+5v) by the two 1kΩ pull-up resistors as shown.

Also, as the circuit operates as a Set-Reset SR latch, the circuit requires a single-pole double-throw (SPDT) changeover switch rather than a single-pole single-throw (SPST) switch of the previous RC debounce circuit.

When the switch of the cross-coupled NAND debouncer circuit is in position A, NAND gate U1 is "set" and the output at Q is HIGH at logic "1". When the switch is moved to position BU2 becomes "set" which resets U1. The output at Q is now LOW at logic "0".

The operating the switch between positions A and B toggles or switches the output at Q from HIGH to LOW or from LOW to HIGH. As the latch requires two switching actions to set and reset it, any bouncing of the switch contacts in either direction for both opening and closing are not seen at the output Q. Also the advantage of this SR latch debounce circuit is that it can provide complementary outputs at Q and Q.

As well as using cross-coupled NAND gates to form a bistable latch input interfacing circuit, we can also use cross-coupled NOR gates by changing the position of the two resistors and reducing their value to 100Ω's as shown below.

Switch Debounce with NOR Gates

switch debounce with cross coupled nor gates

 

The operation of the cross-coupled NOR gate debounce circuit is the same as for the NAND circuit except that the output at Q is HIGH when the switch is in position B and LOW when it is in position A. The reverse of the cross-couple NAND bistable latch.

Then its worth noting that when input interfacing switches to circuits using a NAND or a NOR latch to use as debounce circuits, the NAND configuration requires a LOW or logic "0" input signal to change state, while the NOR configuration requires a HIGH or logic "1" input signal to change state.

Interfacing with Opto Devices

An Optocoupler (or optoisolator) is an electronic component with an LED and photo-sensitive device, such as a photodiode or phototransistor encased in the same package. The Opto-coupler which we look at in a previous tutorial interconnects two separate electrical circuits by means of a light sensitive optical interface. This means that we can effectively interface two circuits of different voltage or power ratings together without one electrically affecting the other.

Optical Switches (or opto-switches) are another type of optical (photo) switching devices which can be used for input interfacing. The advantage here is that the optical switch can be used for input interfacing harmful voltage levels onto the input pins of microcontrollers, PICs and other such digital circuits or for detecting objects using light as the two components are electrically separate but optically coupled providing a high degree of isolation (typically 2-5kV).

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

Slotted Optical Switch

slotted optical switch

 

A DC voltage is generally used to drive a light emitting diode (LED) which converts the input signal into infrared light energy. This light is reflected and collected by the phototransistor on the other side of the isolation gap and converted back into an output signal.

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

Slotted Opto-switch Circuit

slotted opto switch circuit

 

Rotary and slotted disk optical sensors are used extensively in positional encoders, shaft encoders and even the rotary wheel of your computer mouse and as such make excellent input interfacing devices. The rotary disk has a number of slots cut out of an opaque wheel with the number of evenly spaced slots representing the resolution per degree of rotation. Typical encoded discs have a resolution of up to 256 pulses or 8-bits per rotation.

During one revolution of the disk the infrared light from the LED strikes the phototransistor through the slot and then is blocked as the disk rotates, turning the transistor "ON" and then "OFF" each pass of the slot. Resistor R1 set the LED current and the pull-up resistor R2 ensures the supply voltage, Vcc is connected to the input of the Schmitt inverter when the transistor is "OFF" producing a LOW, logic "0" output.

When the disk rotates to an open cut out, the infrared light from the LED strikes the phototransistor and shorts the Collector-to-Emitter terminals to ground producing a LOW input to the Schmitt inverter which in turn outputs a HIGH or logic "1". If the inverters output was connected to a digital counter or encoder, then it would be possible to determine the shafts position or count the numbers of shaft revolutions per unit time to give the shafts rotations per minute (rpm).

As well as using slotted opto devices as input interfacing switches, there is another type of optical device called a reflective optical sensor which uses an LED and photodevice to detect an object. The reflective opto switch can detect the absence or presence of an object by reflecting (hence its name) the LEDs infrared light of the reflective object being sensed. The basic arrangement of a reflective opto sensor is given below.

Reflective Optical Switch

reflective optical switch

 

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

Other Types of Opto Devices

As well as using slotted or reflective photoswitches for the input interfacing of circuits, we can also use other types of semiconductor light detectors such as photo resistive light detectors, PN junction photodiodes and even solar cells. All these photo sensitive devices use ambient light such as sunlight or normal room light to activate the device allowing them to be esily interfaced to any type of electronic circuit.

Normal signal and power diodes have their PN junction sealed within a plastic body for both safety and to stop photons of light from hitting it. When a diode is reverse biased it blocks the flow of current, acting like a high resistance open switch. However, if we were to shine a light onto this PN junction the photons of light open up the junction allowing current to flow depending upon the intensity of the light on the junction.

Photodiodes exploit this by having a small transparent window that allows light to strike their PN junction making the photodiode extremely photosensitive. Depending upon the type and amount of semiconductor doping, some photodiodes respond to visible light, and some to infrared (IR) light. When there is no incident light, the reverse current, is almost negligible and is called the "dark current". An increase in the amount of light intensity produces an increase in the reverse current.

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

Interfacing Photodiodes

interfacing photodiodes

 

In the two basic circuits on the left, the photodiode is simply reverse biased through the resistor with the output voltage signal taken from across the series resistor. This resistor can be of a fixed value, usually between the 10kΩ to 100kΩ range, or as a variable 100kΩ potentiometer as shown. This resistor can be connected between the photodiode and 0v ground, or between the photodiode and the positive Vcc supply.

While photodiodes such as the BPX48 give a very fast response to changes in light level, they can be less sensitive compared to other photo-devices such as the Cadmium Sulphide LDR cell so some form of amplification in the form of a transistor or op-amp may be required. Then we have seen that the photodiode can be used as a variable-resistive device controlled by the amount of light falling on its junction. Photodiodes can be switch from "ON" to "OFF" and back very fast sometimes in nano-seconds or with frequencies above 1MHz and so are commonly used in optical encoders and fibre optic communications.

As well as PN junction photo devices, such as the photodiode or the phototransistor, there are other types of semiconductor light detectors that operate without a PN junction and change their resistive characteristics with changes or variations in light intensity. These devices are called Light Dependant Resistors, or LDR's.

The LDR, also known as a cadmium-sulphide (CdS) photocell, is a passive device with a resistance that varies with visible light intensity. When no light is present their internal resistance is very high in the order of mega-ohms ( MΩ's ). However, when illuminated their resistance falls to below 1kΩ in strong sunlight. Then light dependant resistors operate in a similar fashion to potentiometers but with light intensity controlling their resistive value.

Interfacing LDR Photoresistors

interfacing ldr photoresistors

 

Light dependant resistors change their resistive value in proportion to the light intensity. Then LDRs can be used with a series resistor, R to form a voltage divider network across the supply. In the dark the resistance of the LDR is much greater than that of the resistor so by connecting the LDR from supply to resistor or resistor to ground, it can be used as a light detector or as a dark detector as shown.

As LDRs such as the NORP12, produce a variable voltage output relative to their resistive value, they can be used for analogue input interfacing circuits. But LDRs can also be connected as part of a Wheatstone Bridge arrangement as the input of an op-amp voltage comparator or a Schmitt trigger circuit to produce a digital signal for interfacing to digital and microcontroller input circuits.

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

Input Interfacing Summary

As we have seen throughout this tutorial section on input and output devices, there are many different types of sensors which 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, microcontroller or digital circuit.

The problem is that just about all of the physical properties being measured can not be directly connected to the processing or amplifying circuit. Then some form of input interfacing circuit is required to interface the wide range of different analogue input voltages and currents to a microprocessor digital circuit.

Today with modern PC's, microcontrollers, PIC's and other such microprocessor based systems, input interfacing circuits allows these low voltage, low power devices to easily communicate with the outside world as many of these PC based devices have built-in inputoutput ports for transferring data to and from the controllers program and attached switches or sensors.

We have seen that sensors are electrical components that convert one type of property into an electrical signal thereby functioning as input devices. Adding input sensors to an electronic circuit can expand its capabilities by providing information about the surrounding environment. However, sensors can not operate on their own and in the most cases an electrical or electronic circuit called an interface is required.

Then input interfacing circuits allow external devices to exchange signals (data or codes) from either simple switches using switch debouncing techniques from a single push button or keyboard for data entry, to input sensors that can detect physical quantities such as light, temperature, pressure, and speed for conversion using analogue-to-digital converters. Then interfacing circuitsallow us to do just that.

Summary of Transducers

Summary of Transducers

Below is a summary of transducers and sensors we have looked at in this section along with a list of the main characteristics associated with Transducers, Sensors and Actuators.

Input Devices or Sensors

  • Sensors are "Input" devices which convert one type of energy or quantity into an electrical analogue signal.
  • The most common forms of sensors are those that detect Position, Temperature, Light, Pressure and Velocity.
  • The simplest of all input devices is the switch or push button.
  • Some sensors called "Self-generating" sensors generate output voltages or currents relative to the quantity being measured, such as thermocouples and photo-voltaic solar cells and their output bandwidth equals that of the quantity being measured.
  • Some sensors called "Modulating" sensors change their physical properties, such as inductance or resistance relative to the quantity being measured such as inductive sensors, LDR's and potentiometers and need to be biased to provide an output voltage or current.
  • Not all sensors produce a straight linear output and linearisation circuitry may be required.
  • Signal conditioning may also be required to provide compatibility between the sensors low output signal and the detection or amplification circuitry.
  • Some form of amplification is generally required in order to produce a suitable electrical signal which is capable of being measured.
  • Instrumentation type Operational Amplifiers are ideal for signal processing and conditioning of a sensors output signal.

Output Devices or Actuators

  • "Output" devices are commonly called Actuators and the simplest of all actuators is the lamp.
  • Relays provide good separation of the low voltage electronic control signals and the high power load circuits.
  • Relays provide separation of DC and AC circuits (i.e. switching an alternating current path via a DC control signal or vice versa).
  • Solid state relays have fast response, long life, no moving parts with no contact arcing or bounce but require heat sinking.
  • Solenoids are electromagnetic devices that are used mainly to open or close pneumatic valves, security doors and robot type applications. They are inductive loads so a flywheel diode is required.
  • Permanent magnet DC motors are cheaper and smaller than equivalent wound motors as they have no field winding.
  • Transistor switches can be used as simple ON/OFF unipolar controllers and pulse width speed control is obtained by varying the duty cycle of the control signal.
  • Bi-directional motor control can be achieved by connecting the motor inside a transistor H-bridge.
  • Stepper motors can be controlled directly using transistor switching techniques.
  • The speed and position of a stepper motor can be accurately controlled using pulses so can operate in an Open-loop mode.
  • Microphones are input sound transducers that can detect acoustic waves either in the Infra sound, Audible sound or Ultrasound range generated by a mechanical vibration.
  • Loudspeakers, buzzers, horns and sounders are output devices and are used to produce an output sound, note or alarm.

Sound Transducers

The Audio Sound Transducer

Sound is the generalised name given to "acoustic waves". These acoustic waves have frequencies ranging from just 1Hz up to many tens of thousands of Hertz with the upper limit of human hearing being around the 20 kHz, (20,000Hz) range. The sound that we hear is basically made up from mechanical vibrations produced by an Audio Sound Transducer used to generate the acoustic waves, and for sound to be "heard" it requires a medium for transmission either through the air, a liquid, or a solid.

audio sound transducer

Sound Transducer

Also, the actual sound need not be a continuous frequency sound wave such as a single tone or a musical note, but may be an acoustic wave made from a mechanical vibration, noise or even a single pulse of sound such as a "bang".

Audio Sound Transducers include both input sensors, that convert sound into and electrical signal such as a Microphone, and output actuators that convert the electrical signals back into sound such as a loudspeaker.

We tend to think of sound as only existing in the range of frequencies detectable by the human ear, from 20Hz up to 20kHz (a typical loudspeaker frequency response), but sound can also extend way beyond these ranges.

Sound transducers can also both detect and transmit sound waves and vibrations from very low frequencies called infra-sound up to very high frequencies called ultrasound. But in order for a sound transducer to either detect or produce "sound" we first need to understand what sound is.

What is Sound?

Sound is basically a waveform of energy that is produced by some form of a mechanical vibration such as a tuning fork, and which has a "frequency" determined by the origin of the sound for example, a bass drum has a low frequency sound while a cymbal has a higher frequency sound.

A sound waveform has the same characteristics as that of an electrical waveform which areWavelength (λ), Frequency (Æ’) and Velocity (m/s). Both the sounds frequency and wave shape are determined by the origin or vibration that originally produced the sound but the velocity is dependent upon the medium of transmission (air, water etc.) that carries the sound wave. The relationship between wavelength, velocity and frequency is given below as:

Sound Wave Relationship

sound waves

 

frequency and wavelength relationship

  • Where:
  •   Wavelength – is the time period of one complete cycle in Seconds.
  •   Frequency – is the number of wavelengths per second in Hertz. 
  •   Velocity – is the speed of sound through a transmission medium in m/s-1.

The Microphone Input Transducer

The Microphone, also called a "mic", is a sound transducer that can be classed as a "sound sensor". This is because it produces an electrical analogue output signal which is proportional to the "acoustic" sound wave acting upon its flexible diaphragm. This signal is an "electrical image" representing the characteristics of the acoustic waveform. Generally, the output signal from a microphone is an analogue signal either in the form of a voltage or current which is proportional to the actual sound wave.

The most common types of microphones available as sound transducers are DynamicElectret CondenserRibbon and the newer Piezo-electric Crystal types. Typical applications for microphones as a sound transducer include audio recording, reproduction, broadcasting as well as telephones, television, digital computer recording and body scanners, where ultrasound is used in medical applications. An example of a simple "Dynamic" microphone is shown below.

Dynamic Moving-coil Microphone Sound Transducer

microphone sound transducer

 

The construction of a dynamic microphone resembles that of a loudspeaker, but in reverse. It is a moving coil type microphone which uses electromagnetic induction to convert the sound waves into an electrical signal. It has a very small coil of thin wire suspended within the magnetic field of a permanent magnet. As the sound wave hits the flexible diaphragm, the diaphragm moves back and forth in response to the sound pressure acting upon it causing the attached coil of wire to move within the magnetic field of the magnet.


As the coil of wire is usually very small the range of movement of the coil and attached diaphragm is also very small producing a very linear output signal which is 90
o out of phase to the sound signal. Also, because the coil is a low impedance inductor, the output voltage signal is also very low so some form of "pre-amplification" of the signal is required.The movement of the coil within the magnetic field causes a voltage to be induced in the coil as defined by Faraday's law of Electromagnetic Induction. The resultant output voltage signal from the coil is proportional to the pressure of the sound wave acting upon the diaphragm so the louder or stronger the sound wave the larger the output signal will be, making this type of microphone design pressure sensitive.

As the construction of this type of microphone resembles that of a loudspeaker, it is also possible to use an actual loudspeaker as a microphone.

Obviously, the average quality of a loudspeaker will not be as good as that for a studio type recording microphone but the frequency response of a reasonable speaker is actually better than that of a cheap "freebie" microphone. Also the coils impedance of a typical loudspeaker is different at between 8 to 16Ω. Common applications where speakers are generally used as microphones are in intercoms and walki-talkie's.

The Loudspeaker Output Transducer

Sound can also be used as an output device to produce an alert noise or act as an alarm, and loudspeakers, buzzers, horns and sounders are all types of sound transducer that can be used for this purpose with the most commonly used audible type output sound actuator being the "Loudspeaker".

loudspeaker sound transducer

Loudspeaker Transducer

Loudspeakers are audio sound transducers that are classed as "sound actuators" and are the exact opposite of microphones. Their job is to convert complex electrical analogue signals into sound waves being as close to the original input signal as possible.

Loudspeakers are available in all shapes, sizes and frequency ranges with the more common types being moving coil, electrostatic, isodynamic and piezo-electric. Moving coil type loudspeakers are by far the most commonly used speaker in electronic circuits, kits and toys, and as such it is this type of sound transducer we will examine below.

The principle of operation of the Moving Coil Loudspeaker is the exact opposite to that of the "Dynamic Microphone" we look at above. A coil of fine wire, called the "speech or voice coil", is suspended within a very strong magnetic field, and is attached to a paper or Mylar cone, called a "diaphragm" which itself is suspended at its edges to a metal frame or chassis. Then unlike the microphone which is pressure sensitive input device, this type of sound transducer can be classed as a pressure generating output device.

The Moving Coil Loudspeaker

moving coil loudspeaker

 

When an analogue signal passes through the voice coil of the speaker, an electro-magnetic field is produced and whose strength is determined by the current flowing through the "voice" coil, which in turn is determined by the volume control setting of the driving amplifier or moving coil driver. The electro-magnetic force produced by this field opposes the main permanent magnetic field around it and tries to push the coil in one direction or the other depending upon the interaction between the north and south poles.

As the voice coil is permanently attached to the cone/diaphragm this also moves in tandem and its movement causes a disturbance in the air around it thus producing a sound or note. If the input signal is a continuous sine wave then the cone will move in and out acting like a piston pushing and pulling the air as it moves and a continuous single tone will be heard representing the frequency of the signal. The strength and therefore its velocity, by which the cone moves and pushes the surrounding air produces the loudness of the sound.

As the speech or voice coil is essentially a coil of wire it has, like an inductor an impedance value. This value for most loudspeakers is between 4 and 16Ω's and is called the "nominal impedance" value of the speaker measured at 0Hz, or DC.

Remember that it is important to always match the output impedance of the amplifier with the nominal impedance of the speaker to obtain maximum power transfer between the amplifier and speaker. Most amplifier-speaker combinations have an efficiency rating as low as 1 or 2%.

Although disputed by some, the selection of good speaker cable is also an important factor in the efficiency of the speaker, as the internal capacitance and magnetic flux characteristics of the cable change with the signal frequency, thereby causing both frequency and phase distortion. This has the effect of attenuating the signal. Also, with high power amplifiers large currents are flowing through these cables so small thin bell wire type cables can overheat during extended periods of use, again reducing efficiency.

The human ear can generally hear sounds from between 20Hz to 20kHz, and the frequency response of modern loudspeakers called general purpose speakers are tailored to operate within this frequency range as well as headphones, earphones and other types of commercially available headsets used as sound transducers. However, for high performance High Fidelity (Hi-Fi) type audio systems, the frequency response of the sound is split up into different smaller sub-frequencies thereby improving both the loudspeakers efficiency and overall sound quality as follows:

Generalised Frequency Ranges

Descriptive UnitFrequency Range
Sub-Woofer10Hz to 100Hz
Bass20Hz to 3kHz
Mid-Range1kHz to 10kHz
Tweeter3kHz to 30kHz

In multi speaker enclosures which have a separate Woofer, Tweeter and Mid-range speakers housed together within a single enclosure, a passive or active "crossover" network is used to ensure that the audio signal is accurately split and reproduced by all the different sub-speakers. This crossover network consists of ResistorsInductorsCapacitorsRLC type passive filters or op-amp active filters whose crossover or cut-off frequency point is finely tuned to that of the individual loudspeakers characteristics and an example of a multi-speaker "Hi-fi" type design is given below.

Multi-speaker (Hi-Fi) Design

multispeaker sound transducer

 

In this tutorial, we have looked at different Sound Transducers that can be used to both detect and generate sound waves. Microphones and loudspeakers are the most commonly available sound transducer, but other lots of other types of sound transducers available which use piezoelectric devices to detect very high frequencies, hydrophones designed to be used underwater for detecting underwater sounds and sonar transducers which both transmit and receive sound waves to detect submarines and ships.

DC Motors

Electrical DC Motors

Electrical DC Motors are continuous actuators that convert electrical energy into mechanical energy. The DC motor achieves this by producing a continuous angular rotation that can be used to rotate pumps, fans, compressors, wheels, etc. As well as conventional rotary DC motors, linear motors are also available which are capable of producing a continuous liner movement.

There are basically three types of conventional electrical motor available: AC type Motors, DC type Motors and Stepper Motors.

small dc motor

A Typical Small DC Motor

AC Motors are generally used in high power single or multi-phase industrial applications were a constant rotational torque and speed is required to control large loads such as fans or pumps.

In this tutorial on Electrical Motors we will look only at simple light duty DC Motors and Stepper Motors which are used in many different types of electronic, positional control, microprocessor, PIC and robotic type circuits.

The Basic DC Motor

The DC Motor or Direct Current Motor to give it its full title, is the most commonly used actuator for producing continuous movement and whose speed of rotation can easily be controlled, making them ideal for use in applications were speed control, servo type control, and/or positioning is required. A DC motor consists of two parts, a "Stator" which is the stationary part and a "Rotor" which is the rotating part. The result is that there are basically three types of DC Motor available.

  • • Brushed Motor – This type of motor produces a magnetic field in a wound rotor (the part that rotates) by passing an electrical current through a commutator and carbon brush assembly, hence the term "Brushed". The stators (the stationary part) magnetic field is produced by using either a wound stator field winding or by permanent magnets. Generally brushed DC motors are cheap, small and easily controlled.
  • • Brushless Motor – This type of motor produce a magnetic field in the rotor by using permanent magnets attached to it and commutation is achieved electronically. They are generally smaller but more expensive than conventional brushed type DC motors because they use "Hall effect" switches in the stator to produce the required stator field rotational sequence but they have better torque/speed characteristics, are more efficient and have a longer operating life than equivalent brushed types.
  • • Servo Motor – This type of motor is basically a brushed DC motor with some form of positional feedback control connected to the rotor shaft. They are connected to and controlled by a PWM type controller and are mainly used in positional control systems and radio controlled models.

Normal DC motors have almost linear characteristics with their speed of rotation being determined by the applied DC voltage and their output torque being determined by the current flowing through the motor windings. The speed of rotation of any DC motor can be varied from a few revolutions per minute (rpm) to many thousands of revolutions per minute making them suitable for electronic, automotive or robotic applications. By connecting them to gearboxes or gear-trains their output speed can be decreased while at the same time increasing the torque output of the motor at a high speed.

The "Brushed" DC Motor

A conventional brushed DC Motor consist basically of two parts, the stationary body of the motor called the Stator and the inner part which rotates producing the movement called the Rotor or"Armature" for DC machines.

The motors wound stator is an electromagnet circuit which consists of electrical coils connected together in a circular configuration to produce the required North-pole then a South-pole then a North-pole etc, type stationary magnetic field system for rotation, unlike AC machines whose stator field continually rotates with the applied frequency. The current which flows within these field coils is known as the motor field current.

These electromagnetic coils which form the stator field can be electrically connected in series, parallel or both together (compound) with the motors armature. A series wound DC motor has its stator field windings connected in series with the armature. Likewise, a shunt wound DC motor has its stator field windings connected in parallel with the armature as shown.

Series and Shunt Connected DC Motor

series and shunt dc motor

 

The rotor or armature of a DC machine consists of current carrying conductors connected together at one end to electrically isolated copper segments called the commutator. The commutator allows an electrical connection to be made via carbon brushes (hence the name "Brushed" motor) to an external power supply as the armature rotates.

The magnetic field setup by the rotor tries to align itself with the stationary stator field causing the rotor to rotate on its axis, but can not align itself due to commutation delays. The rotational speed of the motor is dependent on the strength of the rotors magnetic field and the more voltage that is applied to the motor the faster the rotor will rotate. By varying this applied DC voltage the rotational speed of the motor can also be varied.

Conventional (Brushed) DC Motor

brushed dc motor

 

The Permanent magnet (PMDC) brushed DC motor is generally much smaller and cheaper than its equivalent wound stator type DC motor cousins as they have no field winding. In permanent magnet DC (PMDC) motors these field coils are replaced with strong rare earth (i.e. Samarium Cobolt, or Neodymium Iron Boron) type magnets which have very high magnetic energy fields.

The use of permanent magnets gives the DC motor a much better linear speed/torque characteristic than the equivalent wound motors because of the permanent and sometimes very strong magnetic field, making them more suitable for use in models, robotics and servos.

Although DC brushed motors are very efficient and cheap, problems associated with the brushed DC motor is that sparking occurs under heavy load conditions between the two surfaces of the commutator and carbon brushes resulting in self generating heat, short life span and electrical noise due to sparking, which can damage any semiconductor switching device such as a MOSFET or transistor. To overcome these disadvantages, Brushless DC Motors were developed.

The "Brushless" DC Motor

The brushless DC motor (BDCM) is very similar to a permanent magnet DC motor, but does not have any brushes to replace or wear out due to commutator sparking. Therefore, little heat is generated in the rotor increasing the motors life. The design of the brushless motor eliminates the need for brushes by using a more complex drive circuit were the rotor magnetic field is a permanent magnet which is always in synchronisation with the stator field allows for a more precise speed and torque control.

Then the construction of a brushless DC motor is very similar to the AC motor making it a true synchronous motor but one disadvantage is that it is more expensive than an equivalent "brushed" motor design.

The control of the brushless DC motors is very different from the normal brushed DC motor, in that it this type of motor incorporates some means to detect the rotors angular position (or magnetic poles) required to produce the feedback signals required to control the semiconductor switching devices. The most common position/pole sensor is the "Hall Effect Sensor", but some motors also use optical sensors.

Using Hall effect sensors, the polarity of the electromagnets is switched by the motor control drive circuitry. Then the motor can be easily synchronized to a digital clock signal, providing precise speed control. Brushless DC motors can be constructed to have, an external permanent magnet rotor and an internal electromagnet stator or an internal permanent magnet rotor and an external electromagnet stator.

Advantages of the Brushless DC Motor compared to its "brushed" cousin is higher efficiencies, high reliability, low electrical noise, good speed control and more importantly, no brushes or commutator to wear out producing a much higher speed. However their disadvantage is that they are more expensive and more complicated to control.

The DC Servo Motor

DC Servo motors are used in closed loop type applications were the position of the output motor shaft is fed back to the motor control circuit. Typical positional "Feedback" devices include Resolvers, Encoders and Potentiometers as used in radio control models such as aeroplanes and boats etc.

A servo motor generally includes a built-in gearbox for speed reduction and is capable of delivering high torques directly. The output shaft of a servo motor does not rotate freely as do the shafts of DC motors because of the gearbox and feedback devices attached.

DC Servo Motor Block Diagram

dc servo motor

 

A servo motor consists of a DC motor, reduction gearbox, positional feedback device and some form of error correction. The speed or position is controlled in relation to a positional input signal or reference signal applied to the device.

rc servo motor

RC Servo Motor

The error detection amplifier looks at this input signal and compares it with the feedback signal from the motors output shaft and determines if the motor output shaft is in an error condition and, if so, the controller makes appropriate corrections either speeding up the motor or slowing it down. This response to the positional feedback device means that the servo motor operates within a "Closed Loop System".

As well as large industrial applications, servo motors are also used in small remote control models and robotics, with most servo motors being able to rotate up to about 180 degrees in both directions making them ideal for accurate angular positioning. However, these RC type servos are unable to continually rotate at high speed like conventional DC motors unless specially modified.

A servo motor consist of several devices in one package, the motor, gearbox, feedback device and error correction for controlling position, direction or speed. They are widely used in robotics and small models as they are easily controlled using just three wires, PowerGround and Signal Control.

DC Motor Switching and Control

Small DC motors can be switched "On" or "Off" by means of switches, relays, transistors or MOSFET circuits with the simplest form of motor control being "Linear" control. This type of circuit uses a bipolar Transistor as a Switch (A Darlington transistor may also be used were a higher current rating is required) to control the motor from a single power supply.

By varying the amount of base current flowing into the transistor the speed of the motor can be controlled for example, if the transistor is turned on "half way", then only half of the supply voltage goes to the motor. If the transistor is turned "fully ON" (saturated), then all of the supply voltage goes to the motor and it rotates faster. Then for this linear type of control, power is delivered constantly to the motor as shown below.

Motor Speed Control

motor speed control circuit

 

The simple switching circuit above shows the circuit for a Uni-directional (one direction only) motor speed control circuit. As the rotational speed of a DC motor is proportional to the voltage across its terminals, we can regulate this terminal voltage using a transistor.

The two transistors are connected as a darlington pair to control the main armature current of the motor. A 5kΩ potentiometer is used to control the amount of base drive to the first pilot transistorTR1, which in turn controls the main switching transistor, TR2 allowing the motor's DC voltage to be varied from zero to Vcc, in this example 9 to 12 volts.

Optional flywheel diodes are connected across the switching transistor, TR2 and the motor terminals for protection from any back emf generated by the motor as it rotates. The adjustable potentiometer could be replaced with continuous logic "1" or logic "0" signal applied directly to the input of the circuit to switch the motor "fully-ON" (saturation) or "fully-OFF" (cut-off) respectively from the port of a micro-controller or PIC.

As well as this basic speed control, the same circuit can also be used to control the motors rotational speed. By repeatedly switching the motor current "ON" and "OFF" at a high enough frequency, the speed of the motor can be varied between stand still (0 rpm) and full speed (100%) by varying the mark-space ratio of its supply. This is achieved by varying the proportion of "ON" time (tON) to the "OFF" time (tOFF) and this can be achieved using a process known as Pulse Width Modulation.

Pulse Width Speed Control

We said previously that he rotational speed of a DC motor is directly proportional to the mean (average) voltage value on its terminals and the higher this value, up to maximum allowed motor volts, the faster the motor will rotate. In other words more voltage more speed. By varying the ratio between the "ON" (tON) time and the "OFF" (tOFF) time durations, called the "Duty Ratio", "Mark/Space Ratio" or "Duty Cycle", the average value of the motor voltage and hence its rotational speed can be varied. For simple unipolar drives the duty ratio Î² is given as:

dc motor duty cycle

 

and the mean DC output voltage fed to the motor is given as: Vmean = β x Vsupply. Then by varying the width of pulse a, the motor voltage and hence the power applied to the motor can be controlled and this type of control is called Pulse Width Modulation or PWM.

Another way of controlling the rotational speed of the motor is to vary the frequency (and hence the time period of the controlling voltage) while the "ON" and "OFF" duty ratio times are kept constant. This type of control is called Pulse Frequency Modulation or PFM.

With pulse frequency modulation, the motor voltage is controlled by applying pulses of variable frequency for example, at a low frequency or with very few pulses the average voltage applied to the motor is low, and therefore the motor speed is slow. At a higher frequency or with many pulses, the average motor terminal voltage is increased and the motor speed will also increase.

Then, Transistors can be used to control the amount of power applied to a DC motor with the mode of operation being either "Linear" (varying motor voltage), "Pulse Width Modulation" (varying the width of the pulse) or "Pulse Frequency Modulation" (varying the frequency of the pulse).

Reversing The Direction Of A DC Motor

While controlling the speed of a DC motor with a single transistor has many advantages it also has one main disadvantage, the direction of rotation is always the same, its a "Uni-directional" circuit. In many applications we need to operate the motor in both directions forward and back.

To control the direction of a DC motor, the polarity of the DC power applied to the motor's connections must be reversed allowing its shaft to rotate in the opposite direction. One very simple and cheap way to control the rotational direction of a DC motor is to use different switches arranged in the following manner:

DC Motor Directional Control

dc motor directional control

 

The first circuit uses a single double-pole, double-throw (DPDT) switch to control the polarity of the motors connections. By changing over the contacts the supply to the motors terminals is reversed and the motor reverses direction. The second circuit is slightly more complicated and uses four single-pole, single-throw (SPST) switches arranged in an "H" configuration.

The mechanical switches are arranged in switching pairs and must be operated in a specific combination to operate or stop the DC motor. For example, switch combination A + D controls the forward rotation while switches B + C control the reverse rotation as shown. Switch combinations A + B or C + D shorts out the motor terminals causing it to brake quickly. However, using switches in this manner has its dangers as operating switches A + C or B + D together would short out the power supply.

While the two circuits above would work very well for most small DC motor applications, do we really want to operate different combinations of mechanical switches just to reverse the direction of the motor, NO!. We could change the manual switches for set of Electromechanical Relays and have a single forward-reverse button or switch or even use a solid state CMOS 4066B quad bilateral switch.

But another very good way of achieving bi-directional control of a motor (as well as its speed) is to connect the motor into a Transistor H-bridge type circuit arrangement as shown below.

Basic Bi-directional H-bridge Circuit

dc motor h-bridge circuit

 

The H-bridge circuit above, is so named because the basic configuration of the four switches, either electro-mechanical relays or transistors resembles that of the letter "H" with the motor positioned on the centre bar. The Transistor or MOSFET H-bridge is probably one of the most commonly used type of bi-directional DC motor control circuits. It uses "complementary transistor pairs" both NPN and PNP in each branch with the transistors being switched together in pairs to control the motor.

Control input A operates the motor in one direction ie, Forward rotation while input B operates the motor in the other direction ie, Reverse rotation. Then by switching the transistors "ON" or "OFF" in their "diagonal pairs" results in directional control of the motor.

For example, when transistor TR1 is "ON" and transistor TR2 is "OFF", point A is connected to the supply voltage (+Vcc) and if transistor TR3 is "OFF" and transistor TR4 is "ON" point B is connected to 0 volts (GND). Then the motor will rotate in one direction corresponding to motor terminal A being positive and motor terminal B being negative.

If the switching states are reversed so that TR1 is "OFF", TR2 is "ON", TR3 is "ON" and TR4 is "OFF", the motor current will now flow in the opposite direction causing the motor to rotate in the opposite direction.

Then, by applying opposite logic levels "1" or "0" to the inputs A and B the motors rotational direction can be controlled as follows.

H-bridge Truth Table

Input AInput BMotor Function
TR1 and TR4TR2 and TR3 
00Motor Stopped (OFF)
10Motor Rotates Forward
01Motor Rotates Reverse
11NOT ALLOWED

It is important that no other combination of inputs are allowed as this may cause the power supply to be shorted out, ie both transistors, TR1 and TR2 switched "ON" at the same time, (fuse = bang!).

As with uni-directional DC motor control as seen above, the rotational speed of the motor can also be controlled using Pulse Width Modulation or PWM. Then by combining H-bridge switching with PWM control, both the direction and the speed of the motor can be accurately controlled.

Commercial off the shelf decoder IC's such as the SN754410 Quad Half H-Bridge IC or the L298N which has 2 H-Bridges are available with all the necessary control and safety logic built in are specially designed for H-bridge bi-directional motor control circuits.

The DC Stepper Motor

Like the DC motor above, Stepper Motors are also electromechanical actuators that convert a pulsed digital input signal into a discrete (incremental) mechanical movement are used widely in industrial control applications. A stepper motor is a type of synchronous brushless motor in that it does not have an armature with a commutator and carbon brushes but has a rotor made up of many, some types have hundreds of permanent magnetic teeth and a stator with individual windings.

dc stepper motor

Stepper Motor

As it name implies, the stepper motor does not rotate in a continuous fashion like a conventional DC motor but moves in discrete "Steps" or "Increments", with the angle of each rotational movement or step dependant upon the number of stator poles and rotor teeth the stepper motor has.

Because of their discrete step operation, stepper motors can easily be rotated a finite fraction of a rotation at a time, such as 1.8, 3.6, 7.5 degrees etc. So for example, lets assume that a stepper motor completes one full revolution (360o in exactly 100 steps.

Then the step angle for the motor is given as 360 degrees/100 steps = 3.6 degrees per step. This value is commonly known as the stepper motors Step Angle.

There are three basic types of stepper motor, Variable ReluctancePermanent Magnet andHybrid (a sort of combination of both). A Stepper Motor is particularly well suited to applications that require accurate positioning and repeatability with a fast response to starting, stopping, reversing and speed control and another key feature of the stepper motor, is its ability to hold the load steady once the require position is achieved.

Generally, stepper motors have an internal rotor with a large number of permanent magnet "teeth" with a number of electromagnet "teeth" mounted on to the stator. The stators electromagnets are polarized and depolarized sequentially, causing the rotor to rotate one "step" at a time.

Modern multi-pole, multi-teeth stepper motors are capable of accuracies of less than 0.9 degs per step (400 Pulses per Revolution) and are mainly used for highly accurate positioning systems like those used for magnetic-heads in floppy/hard disc drives, printers/plotters or robotic applications. The most commonly used stepper motor being the 200 step per revolution stepper motor. It has a 50 teeth rotor, 4-phase stator and a step angle of 1.8 degrees (360 degs/(50×4)).

Stepper Motor Construction and Control

variable reluctance stepper motor

 

In our simple example of a variable reluctance stepper motor above, the motor consists of a central rotor surrounded by four electromagnetic field coils labelled ABC and D. All the coils with the same letter are connected together so that energising, say coils marked A will cause the magnetic rotor to align itself with that set of coils.

By applying power to each set of coils in turn the rotor can be made to rotate or "step" from one position to the next by an angle determined by its step angle construction, and by energising the coils in sequence the rotor will produce a rotary motion.

The stepper motor driver controls both the step angle and speed of the motor by energising the field coils in a set sequence for example, "ADCB, ADCB, ADCB, A…" etc, the rotor will rotate in one direction (forward) and by reversing the pulse sequence to "ABCD, ABCD, ABCD, A…" etc, the rotor will rotate in the opposite direction (reverse).

So in our simple example above, the stepper motor has four coils, making it a 4-phase motor, with the number of poles on the stator being eight (2 x 4) which are spaced at 45 degree intervals. The number of teeth on the rotor is six which are spaced 60 degrees apart.

Then there are 24 (6 teeth x 4 coils) possible positions or "steps" for the rotor to complete one full revolution. Therefore, the step angle above is given as:   360o/24 = 15o.

Obviously, the more rotor teeth and or stator coils would result in more control and a finer step angle. Also by connecting the electrical coils of the motor in different configurations, Full, Half and micro-step angles are possible. However, to achieve micro-stepping, the stepper motor must be driven by a (quasi) sinusoidal current that is expensive to implement.

It is also possible to control the speed of rotation of a stepper motor by altering the time delay between the digital pulses applied to the coils (the frequency), the longer the delay the slower the speed for one complete revolution. By applying a fixed number of pulses to the motor, the motor shaft will rotate through a given angle.

The advantage of using time delayed pulse is that there would be no need for any form of additional feedback because by counting the number of pulses given to the motor the final position of the rotor will be exactly known. This response to a set number of digital input pulses allows the stepper motor to operate in an "Open Loop System" making it both easier and cheaper to control.

For example, lets assume that our stepper motor above has a step angle of 3.6 degs per step. To rotate the motor through an angle of say 216 degrees and then stop again at the require position would only need a total of: 216 degrees/(3.6 degs/step) = 80 pulses applied to the stator coils.

There are many stepper motor controller IC's available which can control the step speed, speed of rotation and motors direction. One such controller IC is the SAA1027 which has all the necessary counter and code conversion built-in, and can automatically drive the 4 fully controlled bridge outputs to the motor in the correct sequence.

The direction of rotation can also be selected along with single step mode or continuous (stepless) rotation in the selected direction, but this puts some burden on the controller. When using an 8-bit digital controller, 256 microsteps per step are also possible

SAA1027 Stepper Motor Control Chip

saa1027 stepper motor chip

 

In this tutorial about Rotational Actuators, we have looked at the brushed and brushless DC Motor, the DC Servo Motor and the Stepper Motor as an electromechanical actuator that can be used as an output device for positional or speed control.


Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget