Chapter 4: Sensors in Robotics
The Class 10 robotics club at a school in Jaipur built a small four-wheeled robot for the annual exhibition. It ran on batteries, had two motors, and was programmed to drive straight down the corridor and then turn left at the end. On the first test run it worked beautifully. On the second run, a visitor left a school bag in the corridor. The robot drove straight into it, spun its wheels against the bag, and kept trying to move forward until the batteries ran low.
The robot was not badly built. It simply had no way of knowing that the corridor had changed. It could move, but it could not look. A machine that only follows fixed instructions will keep following them even when the world in front of it is different.
That is the gap this chapter is about. Before a robot can decide anything, it has to gather information about its surroundings and about itself — and that job belongs to sensors.
Diagram
Fig. 4.0-1 – a simple four-wheeled classroom robot in a school corridor, moving towards a school bag lying on the floor; show a dotted arrow marking the robot’s straight path and a question mark above the robot to suggest it has no way of detecting the obstacle
This chapter answers each of these questions as you go through it.
4.1 Why a Robot Needs to Sense
Think about a ceiling fan with a regulator. You set the regulator to speed 3 and the fan runs at speed 3. It will keep running at that speed whether the room is hot or cold, empty or crowded. The fan does exactly what it was told, and nothing more.
Now think about an air conditioner. You set it to 26 °C. The air conditioner does not simply run at a fixed setting. It keeps measuring how warm the room actually is, compares that with 26 °C, and cools more or cools less depending on the answer. Its behaviour changes because the room changes.
That is the difference between a machine that follows fixed instructions and a machine that responds to the world. A robot belongs to the second kind. It has to keep checking what is happening around it while it works, not just once at the start.
The sense, decide, act loop
The classroom robot in the corridor failed for exactly this reason. It had motors, so it could act. It had a program, so it could decide. What it did not have was any way to find out that a bag had appeared in its path. With that step missing, its decisions were based on a corridor that no longer existed.
A working robot runs the same three steps over and over, many times a second, as shown in Fig. 4.1-1.
Diagram
Fig. 4.1-1 – a closed loop of three labelled blocks arranged in a circle with arrows: “Sense — measure what is happening”, “Decide — compare with the goal”, “Act — move a motor or a joint”; a dotted arrow labelled “the world changes” feeds back from Act into Sense
Break the loop at the first step and the rest of the loop is working on stale information. This is why sensing is not an extra feature added at the end of a robot’s design. It is where every action begins.
Two kinds of information
A robot needs two different kinds of information, and it is worth separating them early.
The first is information about the world outside — how far away the wall is, how hot the oven is, whether a gripper is touching a glass or crushing it. The second is information about the robot itself — how far a joint has turned, how fast a wheel is spinning, how much force an arm is pushing with.
Both are equally necessary. A robot arm that can see a cup on the table but has no idea where its own elbow is cannot reach the cup. The devices that supply both kinds of information are the subject of this chapter, and the next section looks at what they are and what they do.
4.2 What a Sensor Is
A small night lamp sold in most electrical shops switches itself on when the room gets dark and switches off at sunrise. Nobody presses a switch. Something inside the lamp is measuring how much light is falling on it and turning that measurement into an electrical signal the lamp’s circuit can act on.
That “something” is a sensor — a device that detects a physical condition such as light, heat, sound, motion, pressure or distance, and converts it into an electrical signal that a circuit or a computer can use.
The word convert is the important one. A robot’s controller is an electronic circuit. It cannot handle heat or pressure or brightness directly; it can only work with electrical signals, and finally with numbers. The world outside, on the other hand, offers nothing but heat, pressure, brightness and movement. A sensor sits between the two and translates one into the other, as shown in Fig. 4.2-1.
Diagram
Fig. 4.2-1 – a left-to-right flow: a box labelled “Physical quantity (light, heat, sound, force, distance)” → an arrow into a box labelled “Sensor” → an arrow labelled “electrical signal” into a box labelled “Controller”; a small arrow from the controller onwards labelled “decision”
Notice that a sensor by itself decides nothing. A temperature sensor in an air conditioner does not choose to cool the room. It only reports how warm the room is. The choosing happens later, in the controller. Keeping this straight will save you a lot of confusion in the chapters ahead.
Sensors are not unique to robots. Your phone dims its screen in a dark room, a car sounds an alarm when a seat belt is not fastened, and a washing machine stops when the drum lid is opened. Each of these depends on a sensor doing quietly the same job: measure something real, hand over a signal.
4.2.1 Functions of Sensors
Once a sensor is fitted to a robot, it goes on doing several jobs at the same time. Listing them separately makes it easier to see what a designer is buying when he or she picks a sensor.
Detecting a change. The first job is to notice that something in the surroundings, or inside the machine, is not what it was a moment ago — a wall coming closer, a surface getting hotter, a wheel starting to turn.
Measuring how much. Noticing is not enough. A robot that only knows “something is near” cannot judge whether to slow down or stop. Most sensors give a value, not just a yes or a no.
Converting the quantity into an electrical signal. This is the translation step described in the previous section, and it is what makes the measurement usable by a circuit.
Supplying feedback to the controller. Feedback means information about the result of an action, sent back to the part that ordered the action. A wheel sensor tells the controller how fast the wheel is actually turning, so the controller can see whether its last command worked.
Keeping the system safe. Many sensors exist only to stop something bad from happening — a gripper that senses too much force before it cracks a glass, or a robot that halts when a person steps into its working area.
Monitoring the robot’s own condition. Position, speed and force inside the machine are measured continuously so that the robot always knows the state of its own body.
No sensor does these jobs perfectly. Readings drift over time, dust and heat affect them, and most sensors need calibration — checking the sensor against a known correct value and adjusting it — before their numbers can be trusted. A sensor is a reliable helper, not an infallible one.
4.2.2 Inside a Sensor: The Three Main Parts
From outside, a sensor looks like a single small component. Inside, the translation from a physical quantity to a usable signal happens in three stages, shown in Fig. 4.2-2.
Diagram
Fig. 4.2-2 – three boxes in a row inside a dotted outline labelled “Sensor”: “Sensing element” → “Transducer” → “Signal conditioner”; an arrow labelled “heat, light, force, sound” enters the first box from the left and an arrow labelled “clean, usable signal” leaves the last box to the right towards a small box labelled “Controller”
The sensing element
The sensing element is the part that actually meets the physical quantity. It is the only part of the sensor that touches the outside world, and everything after it depends on how well it responds.
The sensing element is chosen to suit the quantity being measured. A temperature sensor may use a thermocouple, a pressure sensor a piezoelectric crystal, and a light sensor a photodiode. Each of these reacts in some measurable way when the quantity it is built for changes.
The transducer
Reacting is not the same as producing a signal. The transducer converts the change picked up by the sensing element into a measurable electrical quantity, usually a voltage or a current. It is also built so that the electrical output rises or falls in step with the strength of the physical quantity — a bigger push gives a bigger voltage.
In many small sensors the sensing element and the transducer are the same piece of material doing both jobs at once. A piezoelectric crystal, for example, feels the pressure and generates the charge itself. The three stages are still a useful way to think, even when you cannot point to three separate parts.
The signal conditioner
The raw signal from a transducer is often too weak, too noisy, or in the wrong form for a controller to read. The signal conditioner cleans it up. It may amplify a small voltage so it can be measured, filter out unwanted electrical noise, or perform analogue-to-digital conversion — turning a smoothly varying voltage into a number, because a controller can only work with numbers.
4.3 Types of Sensors Based on Application
There are hundreds of different sensors on the market, and no useful list can be made by naming them one by one. A better question to ask is what job a sensor has been fitted to do. Grouping sensors by application means grouping them by the job, not by the physics inside them.
Take a delivery robot moving through a warehouse. It has to see the aisle markings, judge how far the shelf is, notice when its gripper has touched a carton, know which way it is facing, and stop if a motor is running hot. Five different jobs, five different groups of sensors — and the robot needs all of them at once, as suggested in Fig. 4.3-1.
Diagram
Fig. 4.3-1 – a simple wheeled robot with an arm and gripper, with labelled callout lines pointing to different positions on the body: camera at the top, a microphone beside it, touch pads on the gripper fingers, a distance sensor on the front panel, a temperature sensor near the motor, a motion sensing board inside the body, and a navigation receiver on the roof
The rest of this section takes the groups one at a time, in this order:
Vision sensors — for anything the robot must look at.
Tactile sensors — for anything it must touch, hold or press.
Temperature sensors — for how hot or cold something is.
Range and proximity detection sensors — for how far away an object is, or whether it is there at all.
Motion sensors — for movement, tilt and rotation of the robot itself.
Navigation sensors — for where the robot is and which way it should go.
Speech recognition sensors — for spoken instructions from a person.
One warning before you start. These groups describe purposes, and a single device can serve more than one purpose. An infrared sensor can measure temperature without touching an object, and a different infrared sensor can measure distance to a wall. The name of the group tells you what the sensor is being used for, not what is inside it.
4.3.1 Vision Sensors
A fruit-packing unit has to separate ripe mangoes from unripe ones before they are boxed. No amount of measuring weight or distance will settle the question; the difference is in the colour and the surface of the fruit. The machine has to look.
A vision sensor is a sensor that captures visual information from the surroundings and processes it so that the robot can act on what is in the picture. A plain camera only records an image. A vision sensor records and then examines it — checking a colour, counting objects, finding an edge — and passes on a result.
Diagram
Fig. 4.3-2 – photo of a compact industrial vision camera mounted on a bracket above a conveyor belt, with its lens pointing down at items passing below
What a vision sensor is made of
Four parts work together in a vision sensor:
An image acquisition device — the camera itself, which captures the image.
Illumination — a lamp, LED or laser that lights the object, so the image does not depend on whatever light happens to be around.
An image processing unit — the processor, memory and algorithms that examine the captured image.
A communication interface — the Ethernet, USB or wireless link that carries the result to the rest of the system.
Common types
Vision sensors differ mainly in what kind of information they pull out of a scene.
2D vision sensors capture a flat image, with height and width but no depth. They commonly use CCD (charge-coupled device) or CMOS (complementary metal oxide semiconductor) cameras, are simple and low in cost, and are used in security, surveillance and monitoring.
3D vision sensors capture depth as well, using methods such as laser triangulation and time of flight. Robot navigation, obstacle avoidance and 3D modelling need this extra dimension.
Colour vision sensors use RGB (red, green and blue) channels to record colour information. Sorting products by colour and checking colour consistency are typical uses — the mango problem above is one of them.
Time-of-flight sensors measure how long a pulse of light takes to travel to an object and return, and work out depth from that time. They are used in gesture recognition, robot navigation and object scanning.
Multispectral and hyperspectral vision sensors go beyond the colours the eye can see. Multispectral sensors capture a few chosen wavelengths, hyperspectral sensors capture a continuous band. They are used to study surface features, landscape patterns and the material an object is made of.
The honest limitation of vision is light. A vision sensor sees nothing useful in darkness, glare or thick dust, and a shiny surface can throw its readings off completely. This is why robots that must work in the dark rarely depend on vision alone.
4.3.2 Tactile Sensors
Pick up an egg. Your fingers close until they meet resistance, and then they stop. You did not measure anything consciously; your skin reported the pressure and your hand held back. Now imagine a robot gripper closing on that egg with no such report. It would keep closing until the program told it to stop, and the egg would be gone.
A tactile sensor is a sensor that detects and measures information produced by physical contact — force, pressure, texture, or the temperature of the surface being touched. It gives a robot the equivalent of a sense of touch.
Diagram
Fig. 4.3-3 – photo of a thin, flexible film pressure sensing pad connected by a ribbon lead, with a fingertip pressing on its round sensing area
The common types
Tactile sensors differ in the physical change they measure.
Resistive tactile sensors measure a change in resistance when pressure is applied, as described above.
Capacitive tactile sensors are built from layers of conducting and insulating material. A touch deforms the insulating layer and changes the capacitance between the layers. Phone touchscreens and wearable health monitors use them.
Piezoelectric tactile sensors use materials such as quartz, or specially made polymers, that generate an electrical charge when they are squeezed. They pick up very small changes in pressure, which suits vibration sensing in industry and robotic fingertips that must grip precisely.
Optical tactile sensors send light through a fibre or across a surface and watch how the light changes when something presses on it. They give high-resolution touch sensing and can detect the shape and contour of an object.
Magnetic tactile sensors detect changes in a magnetic field caused by movement or deformation of magnetic material, using Hall effect sensors or magneto-resistive elements. They are used to detect speed, direction of rotation, and whether a rotating part is standing still.
Flexible and stretchable tactile sensors combine the resistive, capacitive or piezoelectric principle with a bendable base, so the sensor can wrap around a curved surface. They are used in wearable health monitors and in the electronic skins being developed for robots.
4.3.3 Temperature Sensors
A soldering station in a school lab has to hold its tip at a steady temperature. Too cool and the solder will not melt; too hot and the tip is ruined. Something in the station must keep reporting how hot the tip actually is, many times a minute, all through the lesson.
A temperature sensor is a sensor that measures how hot or cold an object or an environment is, and converts that into an electrical signal. Robots use them to watch motors that heat up under load, to protect battery packs, and to handle hot material safely.
Five kinds are commonly used, and they differ in how they turn heat into electricity.
Thermocouple
A thermocouple is made of two different metal wires joined at one end to form a junction. When the junction is at a different temperature from the free ends of the wires, a voltage appears across those free ends, and the voltage depends on the temperature difference. This behaviour is called the Seebeck effect. Fig. 4.3-4 shows the arrangement.
Diagram
Fig. 4.3-4 – two wires of different metals, drawn in two shades, joined at a point on the left labelled “measuring junction (hot end)”; the two free ends on the right go to a box labelled “voltmeter”, with a label “voltage depends on the temperature difference”
Common thermocouples are Type K (Chromel–Alumel), Type J (Iron–Constantan) and Type T (Copper–Constantan). Typical thermocouples cover a very wide span, from about −200 °C to over 1700 °C depending on the type, which is why they are used in furnaces, kilns and exhaust gas measurement.
Resistance temperature detector (RTD)
A resistance temperature detector (RTD) measures temperature from the change in electrical resistance of a metal, typically platinum, as it heats up. The resistance rises almost in a straight line with temperature, which makes the reading easy to trust. PT100 and PT1000 are common examples, named for their resistance of 100 Ω and 1000 Ω at 0 °C. RTDs are chosen for laboratory and industrial measurement where accuracy and stability matter.
Thermistor
A thermistor is made of semiconductor material whose resistance changes sharply with temperature. In an NTC (negative temperature coefficient) thermistor the resistance falls as the temperature rises; in a PTC (positive temperature coefficient) thermistor it rises. Thermistors are very sensitive and inexpensive, which suits digital thermometers, battery management and consumer electronics — but their resistance does not change in a straight line, so the reading needs correcting in software.
Infrared (IR) temperature sensor
Every object gives off infrared radiation, and the amount depends on its temperature. An infrared (IR) temperature sensor measures that radiation and works out the temperature without touching the object at all. It responds very fast and can read high temperatures, so it suits moving objects and thermal imaging in medical work.
Semiconductor temperature sensor
A semiconductor temperature sensor is a small integrated circuit in which the voltage or current changes with temperature. It is tiny, cheap, gives an output that varies in a straight line with temperature, and drops straight into a circuit board — but it only covers a modest range, typically about −55 °C to 150 °C, so it is used for electronics and battery monitoring rather than furnaces.
4.3.4 Range and Proximity Detection Sensors
Come back to the robot in the school corridor. To avoid the bag it needed the answer to two slightly different questions: is anything in front of me? and how far away is it? The first question needs only a yes or a no. The second needs a number.
Range and proximity detection sensors are the sensors that answer both. A proximity measurement reports whether an object is present within a certain distance; a range measurement reports how far the object actually is. Many devices do both, which is why the syllabus treats them as one family.
Five kinds are widely used in robotics.
Ultrasonic sensor
An ultrasonic sensor sends out a burst of high-frequency sound, too high for people to hear, and listens for the echo that comes back from an object. The longer the echo takes, the further away the object is. Fig. 4.3-5 shows the idea.
Diagram
Fig. 4.3-5 – a small two-eyed ultrasonic sensor on the left facing a wall on the right; an arrow labelled “sound burst sent out” travels from the transmitter eye to the wall, and a second arrow labelled “echo returns” travels from the wall back to the receiver eye; the gap between sensor and wall is marked “distance d”
The sound travels to the object and back, so it covers the distance twice. That gives
\[d = \dfrac{v \times t}{2}\]
where \(d\) is the distance to the object, \(v\) is the speed of sound in air, and \(t\) is the total time from sending the pulse to receiving the echo.
Infrared (IR) sensor
An infrared (IR) sensor used for distance shines infrared light at an object and measures the intensity or the angle of the light reflected back. It is cheap and responds quickly, which makes it common in short-range obstacle detection and in proximity sensing inside consumer electronics. Its weakness is the surface itself: a dark, dull object reflects very little infrared light and can be missed, and strong sunlight can confuse the reading.
Light detection and ranging (LIDAR)
Light detection and ranging (LIDAR) emits a laser beam and measures the time the reflected light takes to return, using phase shift or triangulation methods. It offers very high accuracy and resolution over a long range and a wide field of view, and it is used for 3D mapping, environment scanning and autonomous vehicle navigation. The cost is the catch: LIDAR units are far more expensive than the other sensors here.
Capacitive proximity sensor
A capacitive proximity sensor generates an electric field in front of itself and detects the change in capacitance when any object enters that field. It works on metallic and non-metallic objects alike, is not troubled by dust and dirt, and is used for level sensing in containers and in touch-sensitive interfaces. Its sensing distance is short, and humidity affects it.
Inductive proximity sensor
An inductive proximity sensor generates an electromagnetic field and detects the disturbance caused by a metal object entering it. It detects conductive materials only — a plastic box passes by unnoticed — but it is rugged, reliable and largely unaffected by environmental conditions, so it is used for metal detection and position sensing on production lines.
4.3.5 Motion Sensors
Hold a phone flat and turn it on its side. The picture on the screen rotates to match. Nothing outside the phone changed — the phone worked out that it had moved. A robot needs the same ability. A two-wheeled robot that cannot tell it is tipping over will keep driving until it falls.
Motion sensors detect and measure movement — how fast something speeds up, how it turns, and which way it is facing. Three of them are used together so often that they are worth learning as a set, as shown in Fig. 4.3-6.
Diagram
Fig. 4.3-6 – a small rectangular robot body drawn in three dimensions, with three straight arrows labelled x, y and z showing directions of linear acceleration, and three curved arrows around those same axes labelled “rotation”, with a compass needle drawn beside the body labelled “direction of the magnetic field”
Accelerometer
An accelerometer measures acceleration — how quickly the speed of the sensor is changing, and in which direction. It responds to two things: dynamic acceleration from movement, shaking or a knock, and static acceleration from gravity, which never stops pulling downwards.
That second point is the useful trick. Because gravity always acts downwards, an accelerometer sitting still can work out which way is down, and therefore how far the robot is tilted. Accelerometers are small and light and measure linear acceleration precisely, but they are easily upset by vibration, and they need calibration before their numbers can be relied on.
Gyroscope
A gyroscope measures the rate of rotation about an axis — how fast the body is turning, in degrees per second. Where an accelerometer answers “which way am I leaning?”, a gyroscope answers “how quickly am I spinning?”. Drones use gyroscopes to hold themselves steady, and camera stabilisers use them to cancel out a shaking hand.
Its honest limitation is drift. Small errors in each reading pile up as the readings are added over time, so a gyroscope’s estimate of the total angle turned slowly wanders away from the truth unless another sensor corrects it.
Magnetometer
A magnetometer measures the strength and direction of the magnetic field around it. Since the Earth has a magnetic field, a magnetometer can work as a compass and give the robot an absolute direction that does not drift. It is usually paired with the other two for this reason. The catch is that the Earth’s field is weak; a motor, a steel table leg or a speaker nearby can pull the reading well off course.
4.3.7 Speech Recognition Sensors
Every sensor so far reports something about the physical world. This last group reports something quite different: an instruction from a person. A hospital assistant robot carrying a tray cannot stop to have buttons pressed, and a worker with both hands occupied cannot type. Speaking is the only channel left.
The sensing part of this arrangement is a microphone — a sensor that detects the pressure waves of sound in the air and converts them into an electrical signal. What happens after that is where the interesting work lies, as Fig. 4.3-8 shows.
Diagram
Fig. 4.3-8 – a left-to-right chain: a person speaking → a microphone symbol labelled “sound converted to an electrical signal” → a box labelled “analogue-to-digital conversion” → a box labelled “recognition software: pattern matched against stored word patterns” → a box labelled “command sent to the robot”
Speech recognition is the process of converting spoken words into text or into a command a machine can act on. It is worth being clear about the division of labour here. The microphone measures sound and nothing more. The recognition is done afterwards by software, which breaks the digitised signal into small pieces, compares the pattern of each piece against patterns it has stored for known sounds, and produces the most likely sequence of words.
The software does not understand the sentence in the way you do. It computes which stored pattern the incoming sound most closely matches, and a robot programmed to respond to “stop” will stop when that match is made.
Background noise is the main limitation, and there are others. A speaker standing too far from the microphone gives a weak signal, an unfamiliar accent or an unusual pronunciation produces a pattern the software matches poorly, and words that sound alike are easily swapped. This is why safety-critical machines are almost never controlled by voice alone: a misheard command on a moving robot is a hazard, so a physical stop button always remains.
4.4 Internal and External Sensors
Grouping sensors by application, as the last section did, answers the question “what is this sensor for?”. There is a second way of grouping them that answers a different question: “where is the thing being measured?”
A robot arm reaching for a cup on a table needs both answers. It has to know where the cup is — that is outside the robot. It also has to know how far its own elbow joint has already turned — that is inside the robot. Fig. 4.4-1 shows the two directions of measurement on one machine.
Diagram
Fig. 4.4-1 – a robot arm on a table beside a cup; arrows pointing inwards at the arm’s joints and motor labelled “internal: joint angle, motor speed, gripping force”; arrows pointing outwards from a camera and a distance sensor on the arm labelled “external: where the cup is, how far away it is”
An internal sensor measures a quantity inside the robot itself — the state of its own body, such as the position of a joint, the speed of a wheel or the force in a gripper.
An external sensor measures a quantity in the world outside the robot — the distance to a wall, the temperature of an oven, the colour of a fruit.
The same device can appear in either group, depending on the job it has been given. A force sensor in a robot’s wrist that measures how hard the arm is pushing is an internal sensor. The same type of sensor placed under a conveyor to weigh a passing box is an external one. What decides the group is not the component, but what it has been asked to measure.
4.4.1 Internal Sensors
Switch off a robot arm halfway through a job and switch it on again. Unless something inside it has been keeping track, the arm has no idea whether its elbow is straight or bent. Internal sensors exist to prevent exactly this kind of blindness. Four kinds are used.
Position sensors
A position sensor measures how far a part of the robot has moved from a reference point — the angle of a joint, or the distance a sliding link has travelled.
The common device on a rotating joint is a rotary encoder. A disc with evenly spaced slots is fixed to the motor shaft, and a light source shines through it onto a detector on the other side, as in Fig. 4.4-2. Each slot passing by produces one electrical pulse. Counting pulses gives the angle turned.
Diagram
Fig. 4.4-2 – a motor shaft carrying a disc with evenly spaced slots around its rim; an LED on one side of the disc and a light detector on the other; the detector output drawn to the right as a train of square pulses labelled “one pulse per slot”
Another simple position sensor is a potentiometer fixed to the joint. Its electrical resistance changes as the shaft turns, so the voltage across it becomes a direct measure of the angle.
Velocity sensors
A velocity sensor measures how fast a part is moving — the rotational speed of a motor shaft or the linear speed of a sliding link. A tachometer fitted to the shaft is one way. More often the same encoder does the work, as in the worked example above: the controller counts pulses over a fixed short time, and the count gives the speed.
Speed matters because a robot that only knows position arrives at the right place too fast. Slowing down before a target needs a speed measurement.
Acceleration sensors
An acceleration sensor measures how quickly the speed of a part is changing. The accelerometer described earlier in this chapter is the device used, and inside a robot it reports the shocks, vibrations and sudden starts that the machine’s own movement produces. Sharp acceleration means sharp force on the joints, so this reading is used to keep movement smooth and to protect the mechanism.
Force sensors
A force sensor measures the force or torque acting on a part of the robot. Most are built around a strain gauge — a thin element bonded to a metal part whose electrical resistance changes very slightly when the metal flexes under load. The circuit reads that change and works back to the force.
Force sensors are placed in wrists, joints and gripper fingers. They tell the robot how hard it is pushing against a surface, and they are the reason an arm can press a component into place firmly without crushing it.
4.4.2 External Sensors: Contact Type
External sensors split into two kinds, and the dividing line is simple: does the sensor have to touch the thing it is measuring?
A contact sensor is an external sensor that must be in physical contact with the object or medium it measures. It interacts with the object directly and detects a change in some physical property at the point of contact.
The simplest example on a mobile robot is a bump switch, shown in Fig. 4.4-3. A spring-loaded bar across the front closes a switch when the robot runs into something. There is no ambiguity in its reading — if the switch is closed, contact has happened.
Diagram
Fig. 4.4-3 – top view of a small wheeled robot with a spring-loaded bumper bar across its front edge; the bumper is shown pressed back against a wall, closing a small switch behind it, with a wire running from the switch to the robot’s controller
Three more contact sensors appear regularly:
A thermocouple has to sit against the hot object, because it is the temperature difference at its own junction that produces the voltage.
A pressure sensor usually uses a diaphragm that is in direct contact with the gas or liquid being measured. The diaphragm flexes as the pressure changes, and that flexing is converted into a signal.
A humidity sensor measures moisture in air or soil. A moisture-absorbing insulating material is held between two conducting plates; as it takes up moisture from its surroundings, the capacitance between the plates changes, and the circuit reads that change.
Contact sensors have two real strengths. Their design is simple, which keeps them cheap, and a contact reading is direct — nothing is being inferred from a reflection or an echo.
The weakness follows from the same fact. Anything that must touch will rub, bend and wear out, so contact sensors need replacing more often than sensors that stay clear of the object. For obstacle detection there is a second problem, and it is the more serious one: by the time a bump switch reports a wall, the robot has already hit the wall.
4.4.3 External Sensors: Non-contact Type
A steel plant needs the temperature of molten metal. Nothing can be pressed against it and survive. The measurement still has to be made, and it has to be made from a distance.
A non-contact sensor is an external sensor that measures an object without touching it. It works by sending out or receiving some form of energy — infrared radiation, light, sound or an electric or magnetic field — and reading what comes back or what changes.
Several non-contact sensors have already appeared in this chapter, and it is worth seeing them together in this new light. An infrared sensor detects heat given off by an object, or measures distance from reflected infrared light. LIDAR uses a laser to measure distance and build a map of a space. An ultrasonic sensor times the echo of a sound burst. A capacitive or inductive proximity sensor detects an object entering the field it sets up in front of itself.
The advantages come straight from the absence of touch. Nothing rubs, so there is very little wear and the sensor lasts. The sensor can be kept away from heat, pressure or moving machinery that would destroy it. And it reports an object before the robot reaches it, which is the whole basis of obstacle avoidance.
There is a price for all this. A non-contact sensor never touches the object, so it never measures it directly — it measures a reflection, an echo or a field, and then infers the answer. That makes it vulnerable in ways a contact sensor is not: a dark surface absorbs infrared light, a soft surface swallows sound, dust scatters a laser beam, and a wet or humid environment shifts a capacitive reading.
4.5 Where Sensors Are Used
Sensors are easy to miss because they are almost never the visible part of a machine. Once you know what to look for, they turn up everywhere.
In industry
Factories run on measurement. Sensors sit inside control systems on the production line, checking that a temperature, a pressure or a flow stays where it should. They also watch the machines themselves: a temperature sensor on a bearing or a vibration reading from a motor can show that a part is wearing out, so it is replaced during a planned shutdown rather than in the middle of a shift.
In healthcare
Medical instruments depend on sensors to turn something happening in the body into a number a doctor can read. Blood pressure monitors, pulse rate monitors and the wearable bands that track heart rate all work this way.
In vehicles
A modern car carries sensors that watch engine and vehicle performance continuously. Safety systems depend on them too. An airbag has to decide within a few thousandths of a second whether a sudden change in motion is a crash or a pothole, and anti-lock brakes need to know when a wheel has stopped turning while the car is still moving.
In consumer electronics
Your phone is a small box of sensors. A touchscreen registers where a finger presses, an ambient light sensor dims the display in a dark room, and an accelerometer rotates the picture when you turn the phone on its side. Smart home devices add more — a thermostat measuring room temperature, a motion sensor switching on a corridor light.
In robotics
Robots use nearly all of these, which is why they are the natural subject of a chapter like this. Cameras, LIDAR units, ultrasonic sensors and infrared sensors give a robot its picture of the world, while encoders and force sensors keep it aware of its own body.
4.6 Choosing the Right Sensor for a Task
By now you have met several sensors that could answer the same question. An ultrasonic sensor, an infrared sensor, a LIDAR unit and a capacitive proximity sensor will all tell a robot that a crate is in front of it. That does not make them interchangeable. The right choice depends on the task, the surroundings and the budget.
The factors that decide
Type of physical quantity to be measured. This is the first filter and it settles most of the choice. Temperature, pressure, humidity, light, motion and sound each need a sensor built for that quantity.
Accuracy and precision. Accuracy is how close a reading is to the true value. Precision is how close repeated readings of the same thing are to each other. They are not the same, as Fig. 4.6-1 shows, and a sensor can have one without the other.
Diagram
Fig. 4.6-1 – three dartboards side by side, each with four marks; the first labelled “accurate but not precise” with marks spread around the centre, the second labelled “precise but not accurate” with marks tightly grouped away from the centre, the third labelled “accurate and precise” with marks tightly grouped on the centre
Environmental conditions. The sensor has to survive where it is fitted. Extreme temperature, high pressure, vibration and dust rule out many otherwise suitable devices.
Response time. This is the time a sensor takes to react to a change in the quantity it measures. It decides whether the sensor is fast enough for the job. An airbag system must react within a few thousandths of a second, so a slow sensor there is worthless however accurate it is.
Range. This is the span over which the sensor measures correctly. A proximity sensor on a small robot may need only a few centimetres, while a LIDAR unit on a self-driving vehicle needs tens of metres.
Sensitivity. This is how much the sensor’s output changes for a given change in the measured quantity. High sensitivity means small changes are still detected — necessary for a microphone that must pick up a quiet voice.
Size and form factor. The sensor has to physically fit. A wearable band needs a miniature sensor; a factory floor can house a large one.
Cost. The price of the sensor, and of maintaining it, has to suit the product. This is often what settles a choice between two sensors that would both work.
Durability and reliability. A sensor must keep performing over months and years, especially where replacing it is difficult or where a failure is dangerous.
Working through a choice
Try the method on a real case. A robot on a warehouse conveyor must detect plastic crates about 30 cm away, in a dusty aisle. Step 1 says presence detection is enough. Step 2 rules out short-range devices that cannot reach 30 cm. Step 3 rules out an inductive proximity sensor, since a plastic crate is not metal, and warns against a vision sensor in dust. That leaves an ultrasonic sensor, which reaches the distance, ignores colour and transparency, and costs far less than a LIDAR unit.
4.7 Summary
A robot works by repeating a loop: sense what is happening, decide what to do, act. Without the sensing step, its decisions are based on a world that may already have changed.
A sensor is a device that detects a physical quantity and converts it into an electrical signal that a circuit or computer can use. A sensor measures and reports; it does not decide.
The functions of sensors are to detect a change, measure how large it is, convert it into an electrical signal, supply feedback to the controller, keep the system safe, and monitor the robot’s own condition.
A sensor works in three stages: the sensing element meets the physical quantity, the transducer converts the change into a voltage or current, and the signal conditioner amplifies, filters and digitises the signal.
Sensors grouped by application include vision, tactile, temperature, range and proximity detection, motion, navigation, and speech recognition sensors.
Vision sensors capture and examine images. Their common types are 2D, 3D, colour, time-of-flight, and multispectral and hyperspectral sensors. They depend on good lighting.
Tactile sensors measure force, pressure and texture on contact. Resistive, capacitive, piezoelectric, optical, magnetic, and flexible and stretchable types are used.
Temperature sensors include the thermocouple, which works by the Seebeck effect, the RTD, the thermistor, the infrared temperature sensor, which measures without touching, and the semiconductor temperature sensor.
Range and proximity detection sensors report whether an object is present and how far away it is. Ultrasonic sensors, infrared sensors, LIDAR, and capacitive and inductive proximity sensors are the common kinds.
For an ultrasonic sensor, the sound travels to the object and back, so the distance is half the product of the speed of sound and the total echo time.
Motion sensors measure movement. An accelerometer measures acceleration and can sense tilt from gravity, a gyroscope measures rate of rotation, and a magnetometer measures the direction of the magnetic field. Together they form an inertial measurement unit.
Navigation sensors let a robot find its position and plan a path. GPS is the common example, but its signal is weak indoors and accurate only to a few metres.
Speech recognition begins with a microphone, which converts sound into an electrical signal. The words are then identified by software matching the digitised sound against stored patterns.
Sensors are also classified by where the measured quantity lies. Internal sensors measure the robot’s own state and include position, velocity, acceleration and force sensors. External sensors measure the surroundings.
External sensors are of two kinds. Contact sensors must touch the object; they are simple and direct but wear out and give no warning before contact. Non-contact sensors measure from a distance; they last longer and warn in advance, but read a reflection rather than the object itself.
Sensors are used in industry, healthcare, vehicles, consumer electronics and robotics.
The choice of a sensor depends on the physical quantity to be measured, accuracy and precision, environmental conditions, response time, range, sensitivity, size and form factor, cost, and durability and reliability.
No sensor is perfect. Every one of them has conditions in which its reading cannot be trusted, which is why robots usually carry several sensors that cover each other’s weaknesses.
4.8 Key Terms
2D vision sensor – A vision sensor that captures a flat image with width and height but no depth.
3D vision sensor – A vision sensor that captures depth as well as width and height, using methods such as laser triangulation and time of flight.
Acceleration sensor – An internal sensor that measures how quickly the speed of a part of the robot is changing.
Accelerometer – A motion sensor that measures acceleration, including the constant pull of gravity, which lets it sense tilt.
Accuracy – How close a sensor’s reading is to the true value of the quantity being measured.
Calibration – Checking a sensor against a known correct value and adjusting it so its readings can be trusted.
Capacitive proximity sensor – A sensor that detects metallic and non-metallic objects from the change in capacitance when they enter the electric field it generates.
Capacitive tactile sensor – A tactile sensor built from conducting and insulating layers that measures touch as a change in capacitance.
Colour vision sensor – A vision sensor that records colour using red, green and blue channels.
Contact sensor – An external sensor that must physically touch the object or medium it measures.
External sensor – A sensor that measures a condition in the world outside the robot.
Feedback – Information about the result of an action, sent back to the part that ordered the action.
Flexible and stretchable tactile sensor – A tactile sensor on a bendable base that can wrap around a curved surface while measuring pressure and touch.
Force sensor – An internal sensor that measures the force or torque acting on a part of the robot, usually using a strain gauge.
Global positioning system (GPS) – A navigation system in which a receiver calculates its position on the Earth from the travel times of signals sent by satellites.
Gyroscope – A motion sensor that measures the rate of rotation about an axis.
Humidity sensor – A contact sensor that measures moisture in air or soil from the change in capacitance of a moisture-absorbing material.
Inductive proximity sensor – A sensor that detects metal objects from the disturbance they cause in the electromagnetic field it generates.
Inertial measurement unit (IMU) – A single unit combining an accelerometer, a gyroscope and a magnetometer so that each covers the others’ weaknesses.
Infrared (IR) sensor – A non-contact sensor that emits infrared light and measures distance from the intensity or angle of the light reflected back.
Infrared (IR) temperature sensor – A non-contact temperature sensor that works out an object’s temperature from the infrared radiation it gives off.
Internal sensor – A sensor that measures a quantity inside the robot itself, such as joint position, speed or force.
Light detection and ranging (LIDAR) – A non-contact sensor that emits a laser beam and measures distance from the time the reflected light takes to return.
Magnetic tactile sensor – A tactile sensor that detects touch from changes in a magnetic field, using Hall effect or magneto-resistive elements.
Magnetometer – A motion sensor that measures the strength and direction of the magnetic field, allowing it to act as a compass.
Microphone – A sensor that converts the pressure waves of sound in the air into an electrical signal.
Motion sensor – A sensor that detects and measures movement, tilt or rotation.
Multispectral and hyperspectral vision sensor – A vision sensor that captures wavelengths of light beyond those the eye can see, either at chosen wavelengths or across a continuous band.
Navigation sensor – A sensor that helps a robot find its position, map its surroundings and plan a path.
Non-contact sensor – An external sensor that measures an object without touching it, using light, sound, radiation or a field.
Optical tactile sensor – A tactile sensor that detects contact and pressure from changes in transmitted or reflected light.
Piezoelectric tactile sensor – A tactile sensor made of a material that generates an electrical charge when it is squeezed.
Position sensor – An internal sensor that measures how far a joint or link has moved from a reference point.
Precision – How close repeated readings of the same quantity are to each other.
Pressure sensor – A contact sensor that measures the pressure of a gas or liquid, usually through a flexing diaphragm.
Range – The span of values over which a sensor measures correctly.
Range and proximity detection sensor – A sensor that reports whether an object is present nearby and how far away it is.
Resistance temperature detector (RTD) – A temperature sensor that measures temperature from the nearly linear change in the resistance of a metal, typically platinum.
Resistive tactile sensor – A tactile sensor whose electrical resistance changes with the pressure applied to it.
Response time – The time a sensor takes to react to a change in the quantity it is measuring.
Semiconductor temperature sensor – A small integrated circuit whose voltage or current changes in step with temperature.
Sensing element – The part of a sensor that directly meets the physical quantity being measured.
Sensitivity – How much a sensor’s output changes for a given change in the measured quantity.
Sensor – A device that detects a physical quantity in its surroundings or inside a machine and converts it into an electrical signal that can be measured and used.
Signal conditioner – The part of a sensor that amplifies, filters and, where needed, digitises the signal so a controller can read it.
Speech recognition – The process of converting spoken words into text or into a command a machine can act on.
Tactile sensor – A sensor that detects and measures force, pressure, texture or temperature arising from physical contact.
Temperature sensor – A sensor that measures how hot or cold an object or an environment is.
Thermistor – A temperature sensor made of semiconductor material whose resistance changes sharply, but not in a straight line, with temperature.
Thermocouple – A temperature sensor made of two different metal wires joined at one end, which produces a voltage depending on the temperature difference, by the Seebeck effect.
Time-of-flight sensor – A sensor that measures depth or distance from the time a pulse of light takes to travel to an object and return.
Transducer – The part of a sensor that converts the change picked up by the sensing element into a measurable electrical quantity.
Ultrasonic sensor – A non-contact sensor that measures distance from the time taken by an emitted burst of high-frequency sound to echo back.
Velocity sensor – An internal sensor that measures how fast a part of the robot is moving or rotating.
Vision sensor – A sensor that captures visual information and processes it so the robot can act on what is in the image.
4.9 Objective Questions
Which temperature sensor produces a voltage because of the Seebeck effect?
- Thermistor
- Thermocouple
- Resistance temperature detector
- Semiconductor temperature sensor
Fill in the blank: The part of a sensor that converts the change picked up by the sensing element into a measurable voltage or current is called the ____________.
State whether true or false: A sensor measures a quantity and also decides what action the robot should take.
Which sensor measures the rate at which a body is rotating about an axis?
- Accelerometer
- Gyroscope
- Magnetometer
- Humidity sensor
Fill in the blank: Sensors that measure the robot’s own state, such as the angle of a joint or the speed of a wheel, are called ____________ sensors.
Match each sensor in List A with the quantity it measures in List B.
| List A | List B |
|---|---|
| a. Magnetometer | i. Distance to an object |
| b. Force sensor | ii. Moisture in air or soil |
| c. Ultrasonic sensor | iii. Direction of the magnetic field |
| d. Humidity sensor | iv. Load acting on a joint |
State whether true or false: An inductive proximity sensor will detect a plastic crate placed in front of it.
An ultrasonic sensor sends out a pulse and receives its echo 2 ms later. Taking the speed of sound in air as 343 m/s, how far away is the object? Show the working.
4.10 Concept Questions
Define a sensor, and state any three functions it performs in a robotic system.
Name the three stages inside a sensor and state what each one does. Why is a sensor with a good sensing element still useless if the last stage is missing?
Differentiate between contact and non-contact sensors on any three points, giving one example of each.
A robot arm has to pick up a cup from a table. Explain why it needs both internal and external sensors to do this, naming one sensor of each kind and the job it does here.
A rotary encoder on a robot joint produces 400 pulses for one full revolution. The controller counts 100 pulses, and the count takes 0.5 s. Calculate the angle through which the joint has turned, and its speed in revolutions per minute.
A team plans to use a vision sensor to detect crates in an unlit, dusty storeroom. Explain what would go wrong, suggest a more suitable sensor, and give the reason for your choice.
4.11 Case-Based Questions
- A Class 10 team builds a small wheeled robot that runs on a long table during a school exhibition. It must stop before it reaches the edge of the table, and it must also stop if a visitor holds a hand about 15 cm in front of it. The table stands beside a window through which bright sunlight falls for most of the day.
- Which type of sensor would you fit facing downwards to detect the edge of the table, and why?
- Which sensor would you fit facing forwards to detect the visitor’s hand at 15 cm, and give one reason for preferring it to the alternatives?
- State one condition in this exhibition hall under which your forward-facing sensor could give a wrong reading.
- A small workshop fills clear glass jars on a moving conveyor. A sensor beside the belt must count every jar that passes, and a robot gripper must lift each filled jar off the belt without cracking it. The workshop air carries fine dust from the packing area.
- Which range or proximity sensor would you choose to count the jars, and why would an infrared sensor be a poor choice here?
- Which sensor should be fitted in the gripper fingers to stop the jars from being crushed, what does it measure, and is it an internal or an external sensor?
- Name two of the factors listed in this chapter that the workshop must check before finalising its choice of sensor, and explain why each one matters in these conditions.