Lessons Menu:
- Lesson 1 – Getting Started
- Lesson 2 - Choosing a Robotic Platform
- Lesson 3 - Making Sense of Actuators
- Lesson 4 - Understanding Microcontrollers
- Lesson 5 - Choosing a Motor Controller
- Lesson 6 – Controlling your Robot
- Lesson 7 - Using Sensors
- Lesson 8 - Getting the Right Tools
- Lesson 9 - Assembling a Robot
- Lesson 10 - Programming a Robot
What can humans sense that robots can’t?
![Ice Cream Ice Cream](/uploads/c/a/carlos-31/imported/ice-cream-208x300.jpg)
Robots have a really hard time tasting and smelling. A human may be able to tell you “this tastes sweet” or “this smells bad” whereas a robot would need to analyze the chemical composition and then look up the substance in a database to determine if humans have marked the taste as being “sweet” or the smell as being “bad”. There has not been much demand for a robot that can taste or smell, so not much effort has been put into creating the appropriate sensors.
Humans have nerve endings throughout their skin and as such, we know when we have touched an object or when something has touched us. Robots are equipped with buttons or simple contacts placed in strategic locations (for example on a front bumper) to determine if it has come into contact with an object. Robot pets may have contact or force sensors placed in their head, feet and back, but if you try to touch an area where there is no sensor, the robot has no way of knowing it has been touched and will not react. As research into humanoid robots continues, perhaps an “electromechanical skin” will be developed.
What can robots sense that humans can’t?
![Nao Robotic Vision Nao Robotic Vision](/uploads/c/a/carlos-31/imported/nao-vision-300x242.png)
Humans use a pair of eyes to get a very good sense of depth, though for many, accurately gauging distance is not easy. A human might tell you “the tree looks to be about 50 feet away”, but a robot, equipped with the right distance sensors, can tell you “the tree is 43.1 feet away”.
Additionally, robots can not only sense but give accurate values of a variety of environmental factors that humans are otherwise unaware of or incapable of sensing. For example, a robot can tell you the precise angular or linear acceleration it is subjected to, while most humans would only tell you “I’m turning”, or “I’m moving”. A human can tell you based on experience if they think an object will be hot or cold without actually touching it, whereas a thermal camera can provide a 2D thermal image of whatever is in front of it. Although humans have five main senses, robots can have an almost infinite number of different sensors.
Which sensors do my robots need?
So, what types of sensors are available and which ones does your robot need? You need to first ask yourself “what do I want or need the robot to measure?” and refer to the appropriate category below. There is a good chance what you have in mind will not fall “nicely” into one of these categories, so try to break it down into its basic elements.Contact
Push button / Contact switch
![SFE 12mm Push-button SFE 12mm Push-button](/uploads/c/a/carlos-31/imported/sfe-12mm-push-button-switch-150x150.jpg)
- Advantages: very low cost, easy to integrate, reliable
- Disadvantages: single distance measurement
Pressure sensor
![Interlink Square FSR Interlink Square FSR](/uploads/c/a/carlos-31/imported/interlink-15-square-fsr-150x150.jpg)
- Advantages: allows gauging how much force is being applied
- Disadvantages: can be imprecise and are more difficult to use than simple switches.
Distance
Ultrasonic Range Finders
![Maxbotix EZ0 Ultrasonic Ranger Maxbotix EZ0 Ultrasonic Ranger](/uploads/c/a/carlos-31/imported/maxbotix-ez0-ultrasonic-ranger-150x150.jpg)
- Advantages: medium range (several meters) measurement.
- Disadvantages: surfaces and environmental factors can affect the readings.
Infrared
![Dagu Compound Eye Infrared Sensor Dagu Compound Eye Infrared Sensor](/uploads/c/a/carlos-31/imported/dagu-compound-infrared-sensor-150x150.jpg)
- Advantages: low cost, fairly reliable and accurate.
- Disadvantages: closer range than ultrasonic
Laser
![Loke Industrial Laser Rangefinder Loke Industrial Laser Rangefinder](/uploads/c/a/carlos-31/imported/loke-0-2-35m-industrial-laser-rangefinder-50hz-150x150.jpg)
- Advantages: very accurate, very long range.
- Disadvantages: much costlier than regular infrared or ultrasonic sensors.
Encoders
Optical encoders use mini infrared transmitter/receiver pairs and send signals when the infrared beam is broken by a specifically designed spinning disk (mounted to a rotating shaft). The number of times the beam is broken corresponds to the total angle travelled by a wheel. Knowing the radius of the wheel, you can determine the total distance travelled by that wheel. Two encoders give you a relative distance in two dimensions.
- Advantages: assuming there is no slip, the displacement is absolute. Often comes installed on the rear shaft of a motor
- Disadvantages: additional programming required; more accurate optical encoders can be ~$50+ each
Linear Potentiometer, resistive band
![DFRobot Slide Position Sensor DFRobot Slide Position Sensor](/uploads/c/a/carlos-31/imported/dfrobot-slide-position-sensor-150x150.jpg)
- Advantages: position is absolute. A resistive band requires pressure to be applied at a given position.
- Disadvantages: range is very small
Stretch and Bend Sensors
![Images Scientific Stretch Sensor Images Scientific Stretch Sensor](/uploads/c/a/carlos-31/imported/images-scientific-8inch-stretch-sensor-150x150.jpg)
- Advantages: useful where an axis of rotation is internal or inaccessible
- Disadvantages: not very accurate, and only small angles can be measured
Stereo Camera System
![Minoru 3D Webcam Minoru 3D Webcam](/uploads/c/a/carlos-31/imported/minoru-3d-webcam-150x150.jpg)
- Advantages: can provide dept information and a good feedback about a robot’s environment
- Disadvantages: complex to program and use the information
Positioning
Indoor Localization (room navigation)
![Hagisonic Stargazer Localization System Hagisonic Stargazer Localization System](/uploads/c/a/carlos-31/imported/hagisonic-stargazer-localization-system-150x150.jpg)
- Advantages: excellent for absolute positioning
- Disadvantages: requires complex programming and the use of markers
GPS
![4D Systems GPS 4D Systems GPS](/uploads/c/a/carlos-31/imported/4d-systems-miniature-66-channel-gps-receiver-breakout-150x150.jpg)
- Advantages: does not requires markers or other references
- Disadvantages: can only function outdoors.
Rotation
Potentiometer
![Phidgets Rotation Sensor Phidgets Rotation Sensor](/uploads/c/a/carlos-31/imported/phidgets-rotation-sensor-150x150.jpg)
- Advantages: simple to use, inexpensive, reasonably accurate, provides absolute readings.
- Disadvantages: most are restricted to 300 degrees of rotation
Gyroscope
![SFE Gyro SFE Gyro](/uploads/c/a/carlos-31/imported/sfe-gyro-breakout-board-150x150.jpg)
- Advantages: no moving “mechanical” components
- Disadvantages: the sensor is always subjected to angular acceleration whereas a microcontroller cannot always take continuous input, meaning values are lost, leading to "drift".
Encoders
![Solarbotics Wheel Watcher Encoder Solarbotics Wheel Watcher Encoder](/uploads/c/a/carlos-31/imported/solarbotics-wheel-watcher-encoder-150x150.jpg)
- Advantages: accurate
- Disadvantages: for optical encoders, the angle is relative (not absolute) to the starting position.
Environmental Conditions
Light Sensor
![Photocell Photocell](/uploads/c/a/carlos-31/imported/mini-photocell-light-sensor-150x150.jpg)
- Advantages: usually very inexpensive and very useful
- Disadvantages: cannot discriminate the source or type of light.
Sound sensor
![DFRobot Sound Sensor DFRobot Sound Sensor](/uploads/c/a/carlos-31/imported/dfrobot-sound-sensor-150x150.jpg)
- Advantages: inexpensive, reliable
- Disadvantages: more meaningful information requires complex programming
Thermal Sensors
![Parallax AD592 Temperature Probe Parallax AD592 Temperature Probe](/uploads/c/a/carlos-31/imported/parallax-ad592-temperature-probe-150x150.jpg)
- Advantages: they can be very accurate
- Disadvantages: more complex and accurate sensors can be more difficult to use.
Thermal Camera
![Devantech 8-pixel Thermal-array Sensor Devantech 8-pixel Thermal-array Sensor](/uploads/c/a/carlos-31/imported/devantech-8-pixel-thermal-array-sensor-150x150.jpg)
- Advantages: differentiate objects from the background based on their thermal signature
- Disadvantages: expensive
Humidity
Humidity sensors detect the percentage of water in the air and are often paired with temperature sensors.Pressure Sensor
A pressure sensor (which can also be a barometric sensor) can be used to measure atmospheric pressure and give an idea of the altitude of a UAV.Gas sensors
![SeeedstudioMQ6 Gas Sensor SeeedstudioMQ6 Gas Sensor](/uploads/c/a/carlos-31/imported/seeedstudio-mq6-gas-sensor-150x150.jpg)
- Advantages: These are the only sensors which can be used to accurately detect gas
- Disadvantages: inexpensive sensors may give false positives or somewhat inaccurate readings and should therefore not be used for critical applications.
Magnetometers
![Hall Effect Sensor Hall Effect Sensor](/uploads/c/a/carlos-31/imported/hall-effect-sensor-150x150.jpg)
- Advantages: can detect ferromagnetic metals.
- Disadvantages: some times the sensors can be damaged by strong magnets.
Attitude (roll, pitch and heading)
Compass
![Parallax Dual-axis Compass Parallax Dual-axis Compass](/uploads/c/a/carlos-31/imported/parallax-hitachi-hm55b-dual-axis-compass-150x150.jpg)
- Advantages: provides absolute navigation
- Disadvantages: greater accuracy increases the price
Gyroscope
![SFE Dual Axis Gyro SFE Dual Axis Gyro](/uploads/c/a/carlos-31/imported/sfe-dual-axis-gyro-150x150.jpg)
- Advantages: electronic tilt sensors have a higher accuracy than mechanical ones
- Disadvantages: can be expensive
Accelerometers
Accelerometers measure the linear acceleration. This allows to measure the gravitational acceleration or any other accelerations the robot is subject to. This can be a good option to approximate distance travelled if your robot cannot use the surrounding environment as a reference. Accelerometers can measure accelerations along one, two or three axis. A three-axis accelerometer can be used also to measure the orientation a
- Advantages: they do not require any external reference or marker to function and can provide absolute orientation with respect to gravity, or relative orientation.
- Disadvantages: they only approximate the traveled distance and cannot precisely determine it.
IMU's
![Phidgets IMU Phidgets IMU](/uploads/c/a/carlos-31/imported/phidgets-usb-9-dof-accelerometer-gyro-and-compass-150x150.jpg)
- Advantages: it is a very reliable way of measuring the robots attitude without using external references (besides the earth’s magnetic field)
- Disadvantages: can be very expensive and is complex to use.
Miscellaneous
Current and Voltage Sensors
Current and voltage sensors do exactly as their name describes; they measure the current and/or voltage of a specific electric circuit. This can be very useful for gauging how much longer your robot will operate (measure the voltage from the battery) or if your motors are working too hard (measure the current).- Advantages: they do exactly what they are intended to do
- Disadvantages: can disturb the voltage or current they are measuring. Sometimes they require the circuit being measured to be modified.
Magnetic Sensors
Magnetic sensors or magnetometers detect magnetic objects and can either require contact with the object, or be relatively close to an object. Such sensors can be used on an autonomous lawn mower to detect wire embedded into a lawn.- Advantages: usually inexpensive
- Disadvantages: usually need to be relatively close to the object, and sadly cannot detect non-magnetic metals.
Vibration
Vibration sensors detect the vibration of an object by using piezoelectric or other technologies.RFID
Radio Frequency Identification devices use active (powered) or passive (non-powered) RFID tags usually the size and shape of a credit card, small flat disc or addition to a key chain (other shapes are possible as well). When the RFID tag comes within a specific distance of the RFID reader, a signal with the tag’s ID is produced.- Advantages: RFID tags are usually very low cost and can be individually identified
- Disadvantages: not useful for measuring distance, only if a tag is within range.
Practical Examples
1. “I want my robot to follow a person”
(More info on the robot featured in the video...)
There is no “person following sensor” available (yet), so you would need to see which categories above may apply and which don’t need to be considered.- Q: Are you looking to detect, measure distance to (or contact with) an object?
- Immediately the answer should be yes and this first category of sensors will likely give the best results.
- Q: Are you looking to measure rotation?
- Perhaps, but you really don’t need to know if the robot is rotated (that’s a different aspect entirely) or if the human is rotated with respect to the robot.
- Q: Are you looking to measure environmental conditions?
- Not really. You might consider tracking a human based on their thermal signature, but differentiating between humans and animals (or even a microwave) would be difficult.
- Q: Are you looking to measure position, orientation, or angle?
- GPS is the first sensor which immediately stands out.
- Contact: irrelevant since the robot will be following the human at a distance.
- Distance:
- Ultrasonic, infrared and laser: measuring the distance is useful when combined with other sensors.
- Camera: This may be the best option and we will look into it.
- Stretch: This would require the human to be physically connected to the robot, which is something we do not want.
- Rotation: irrelevant
- Positioning:
- GPS: placing a GPS unit on both the robot and the human would allow the robot to easily follow the human within a certain radius.
- Environmental conditions: irrelevant
- Attitude:
- Accelerometer: not very useful since it does not give the robot an idea of where the human is.
- IMU: not very useful since it does not give the robot an idea of where the human is.
- Miscellaneous:
- RFID: An RFID reader can locate a tag placed around it, and although some sort of RFID option may be possible, it would require quite a bit of research.
2. “I want my robot to stay within the boundaries of our lawn”
- Q: Are you looking to detect, measure distance to (or contact with) an object?
- Yes, we are looking to detect a boundary
- Q: Are you looking to measure rotation?
- Not really
- Q: Are you looking to measure environmental conditions?
- Not really, but we’ll keep an open mind since the robot is outdoors.
- Q: Are you looking to measure position, orientation, or angle?
- Not really
- Contact: Detecting collisions in order to avoid obstacles.
- Distance:
- Ultrasonic, infrared and laser: These will help the robot to avoid hitting objects, and when several placed facing downwards, will help the robot avoid falling into openings such as pools.
- Rotation:
- Encoders: Encoders: these will help position the robot in two dimensional space based on a starting position.
- Positioning:
- GPS: Ideal, the robot could be instructed to remain within certain coordinates.
- Environmental conditions:
- Humidity sensor: This is not an “intuitive” solution and was creatively used on the Lawnbott Spyder lawn mower to differentiate between grass and “non-humid” surfaces such as concrete and pavement.
- Magnetic sensor: Magnetic sensors are used both indoors and outdoors to mark boundaries. The perimeter is marked with a strip of conductive wire and the robot is equipped with a few magnetic sensors.
- Attitude:
- IMU: this may make the data obtained from the encoders more accurate, especially if there are slopes or uneven terrain.
- Miscellaneous: irrelevant
For further information on learning how to make a robot, please visit the RobotShop Learning Center. Visit the RobotShop Community Forum in order to seek assistance in building robots, showcase your projects or simply hang-out with other fellow roboticists.
This is a companion discussion topic for the original entry at https://community.robotshop.com/tutorials/show/how-to-make-a-robot-lesson-7-using-sensors