The BEEB BODY BUILDING COURSE No. 38 IN CLOSE PROXIMITY TO - Mike Cook At a recent exhibition I was surprised at the number of people asking me about sensing problems who had never heard of proximity switches. So this month I want to look at these useful gadget and see what makes them tick and how we can harness them. I first worked with proximity switches way back in the stone age just after leaving school, when computers filled a room and log tables and slide rules were the order of the day. One of my first projects was fitting up weaving looms with proximity switches so a central computer could monitor the state and productivity of each loom in the shed. They were quite a new concept then and they have improved considerably over the intervening years. Basically, a proximity switch senses when something is close to it. Its obvious application is to replace a mechanical limit switch. As limit switches have to work many times, mechanical devices will inevitably wear out. This is especially true the more often they are tripped. As a proximity switch has no moving parts its reliability is greatly improved. Also they can switch at a faster rate than mechanical microswitches can and so other applications are open for their use. There are two types of proximity switch:- inductive and capacitive. The inductive ones respond to the presence of metal and the capacitive ones respond to most objects including us. As the names imply they work on different principles so let's look at the inductive switch first. Figure I shows an oscillator connected to an inductor. In fact the inductor is part of the oscillator feed-back circuit and so carries an alternating current. This produces an alternating magnetic field around the coil. Whenever an alternating magnetic field is placed next to a conductor an electric current is induced. So, if the coil is placed next to some metal, small circulating currents will be induced in the metal, these are known as eddy currents. The heating effect on the metel is negligable but the eddy currents need energy to sustain them. This energy is drawn out of the oscillator. As the metal target approaches the energy drain increases to such an extent that the oscillator stalls or stops oscillating. When this happens the inductor is no longer being supplied by an alternating current but by a direct current. This means that it will draw more current as inductors resist electrical current flow at high frequncies, exactly the opposite of capacitors which resist the flow at low frequencies. Finally this increase in current can be detected and used to signal that something is in front of the proximity switch. As the load on the inductor needed to stop it oscillating is smaller than the load it can start oscillating with, there is a hysteresis effect built in. This prevents switch chattering when the target is just on the switching distance. The switch-on distance is shorter than the switch off-distance as the target approaches and the proximity switch turns on. As the target receeds it turns off. You could make your own inductive proximity switch and it would make a good school project. The oscillator needs to run at 1 to 2 MHz (Capital M) and the inductor can be wound on a ferrite core. If you place a small resistor in series with the supply there will be a voltage rise across it as the oscillator stalls. You can then feed this back to a threshold detector and thus get a switch output. Various different oscillator circuits could be used, the one shown in figure II is a resonant frequency oscillator. The feedback is provided by a second winding, the dots indicate the start of the winding, note this is connected to give an out-of-phase feedback. If this is not done it will not oscillate. As it is an experimental circuit component values have not been shown. For those of you who just want to use a proximity switch you can get them ready built. They are three-wire devices encapsulated in resin. They come in various guises but most have a threaded shaft for bolting into holes. Different switches work over different voltage ranges, anything from 4.75 volts DC right up to mains voltage AC. Their switching ranges vary from 0.8mm to 20mm, some are capable of switching up to 500mA directly. That's enough current to drive a small relay. Figure III shows the output of a IPO 002 BCF switch which works on any DC voltage from 4.75 to 30 volts. It even has a built-in pull-up resistor so we can easily connect it up to the user port, although it can switch a load up to 250mA. This switch has a plastic cover and so may be mounted flush in metal although better results are obtained if it is not. The sensing distance is 2mm on a standard target. A standard target is a square sheet that is made of mild steel which has its sides three times the sensing range or the diameter of the sensor, whichever is larger. This ensures that all the field is collected by the target and gives the maximum range. If the target size is reduced, the range will be reduced. Typically, if the target area is reduced to 25% of the standard size, the range is reduced by 85%. Also, mild steel has nearly the best range. For other metals the range is reduced. Table 1 shows typical reduction rates for inductive proximity switches. A good target is ordinary aluminium foil stuck onto a non-conducting surface. Well how can we use these switches with our computer? The most obvious situation is when you want to monitor the prescence of something for use in your buggy or robot. However you can also use it for timing. Many experiments in mechanics involve timing an object over a measured distance. With two sensors you could use your computer to do this timing. In industry they are often used to count or monitor objects on conveyor belts. A less obvious application is to measure the speed of rotation without making contact. As the speed of switching can be up to 1000Hz then with a target made of a strip of foil half way around the shaft you can measure speeds up to 30,000 RPM. If you are using a cog as in figure IV remember that the frequnecy you measure will be a multiple of the actual shaft speed; the exact factor will depend upon the number of cogs. The computer program to do this is the same as you need to measure frequency. Various frequency measurement techniques were given in the September 84 Body Build article. Any effect in the world of inductors usually has a similar effect in the world of capacitors. The same is true of proximity switches. The great advantage of capacitive proximity switches is that they respond to metallic and non-metallic objects. Capacitance exists between any two plates and the value of the capacitor depends on the area of the plates and the distance between them. The larger the plates or the closer they are the greater is the capacitance. There is also another factor in determining capacitance, and that is the substance between the plates. Each substance effects the capacitance to a different extent, the effect is summed up in a value known as the dieletric constant. If we have one plate of our capacitor in the sensor the target can be the other plate. As all objects are effectively capacitively coupled to earth, if we earth our sensor we will form an earth return circuit. Now when the plates get close enough there is enough capacitance to start up an oscillator, when they get further apart it stalls. The change in current drawn by the oscillator can be measured and hence a switch can be made. Note that this the opposite effect to an inductive proximity switch. Figure V shows a circuit that can demonstration the effect. The frequency of oscillation is determined by the value of capicator. Due to stray capacitances this could always be in oscillation or it could stall. Each cycle of oscillation fires a monostable. This produces a fixed width pulse, the faster the oscillator the more frequent are the pulses and so the higher is the output on the capacitor. This is then taken to level detector. Again the values shown in figure V are just experimental. You can also get ready-built capacitive proximity switches and they can be wired up just like inductive switches. The CAC 04V FSN requires a voltage between 8 and 30 volts and has a sensing distance of 20mm. As this voltage is more than the user port can stand you will have to use a transistor to reduce it as shown in figure VI. Capacitive switches have a small adjusting screw so that the range may be altered. This can also tune out the effects of any stray capacitance due to fixed objects or the sensors mounting. You can increase the range of these switches by gluing a large plate on the front, as long as you have enough tuning control to nullify the effect of the plate. Table II shows the effect on range for various different traget materials. A good use of these switches is in touch controls like those found in some lifts. Also they make good liquid level detectors as the liquid forms the other plate of the capacitor. In this way the liquid never comes in contact with the sensor. By gluing a ring or clip on the front of the sensor you can bend the field and so concentrate it. In this way you could detect the presence of a liquid in a nonmetallic tube this is shown in figure VI. Proximity sensors are not cheap or easy to get hold of so on offer this month in Body Build Pack 32 is a capacitive and inductive proximity switch. You can find the order form on page XXX. Well now we have seen what we can do when we are at close proximity, I will back off until next month. TABLE 1 THE EFFECT OF TARGET MATERIAL ON INDUCTIVE SWITCHES MATERIAL RANGE EFFECT Mild steel 1.0 Cast Iron 1.1 Aluminium foil 0.9 Stainless steel 0.7 Brass 0.4 Aluminium 0.33 Copper 0.3 TABLE 2 THE EFFECT OF TARGET MATERIAL ON CAPACITIVE SWITCHES MATERIAL RANGE EFFECT Mild steel 1.0 Cast Iron 1.1 Aluminium foil 0.9 Stainless steel 0.8 Brass 0.8 Aluminium 0.95 Copper 0.95 Water 1.0 P.V.C 0.5 Glass 0.5 Ceramics 0.4 Wood from 0.2 Beer 0.7 Coca Cola 0.65 Lubricating oil 0.1