Sensors For A Robot: Based On Book by Fred Martin
Sensors For A Robot: Based On Book by Fred Martin
Sensors For A Robot: Based On Book by Fred Martin
Based on
Touch sensors tell the
book by Fred
robot when it bumps
into something.
Martin
The simplest possible use of sensors
The diagram serves to illustrate the general case of
sensing a specific phenomenon. In this case it is the
presence or absence of light.
The sensor in this case is a photo-resistor.
When sufficient light strikes it, its internal resistance is reduced
to several hundred Ohms.
When no light strikes it its resistance is typically several million
Ohms.
light
Remember
Breitenberg’s
Vehicles?
What Is a Sensor?
Anything that detects the state of the environment.
For instance, we already used sensors in the
Braitenberg vehicles.
Are the following, sensors?
Positioning devices
Encoders
Vision
Mine detectors (detector vs. sensor)
Metal Detector
Pendulum Resistive
Tilt Sensors Piezo Bend Sensor
Gieger-Muller
Radiation Sensor
Pyroelectric Detector
UV Detector
Resistive Bend Sensors
CDS Cell
Resistive Light Sensor
Digital Infrared Ranging
Pressure Switch
Miniature Polaroid Sensor
Limit Switch Touch Switch
Mechanical Tilt Sensors
IR Modulator
Lite-On IR Radio Shack Solar Cell
Receiver
Remote Receiver Remote Receiver
Compass Compass
Piezo Ultrasonic Transducers
What are the types of Sensors?
Active
send signal into environment and measure interaction of signal
w/ environment
e.g. radar, sonar
In our lab we used
infrared, light
Passive
(photodiodes,
record signals already present in environment
phototransistors),
e.g. video cameras
compass, volt and
GPS
amperometers, ions,
We will discuss sensing using the pH, magnetic,
following temperature, voice,
Touch sound, camera,
Active Light sonars and of course
Passive Light all resistance based
There are many more ways micro-switches and
(sound, heat, magnetic field, smell...)
pads..
Passive versus Active Sensors
All of the sensors that will be presented in this part are
passive in that the stimulus, i.e., the physical property, they
were measuring, comes from the environment.
In contrast, active sensors provide their own signal/stimulus
(and thus typically require extra energy), and use its interaction
with the environment as the property to be measured.
Active sensors include:
reflectance and break-beam infra-red (IR) sensors,
ultrasound sensors,
laser range finders,
and others.
They will be presented in next parts.
How to Choose a Sensor?
There are four main factors to consider in choosing a sensor.
Cost:
sensors can be expensive
you can buy cheap sensors but often without good documentation
knowing main principles and experimentation is useful when you purchase such sensors
(usually military old sensors)
Environment:
there are many sensors that work well and predictably inside, but that choke and die
outdoors.
Range:
Most sensors work best over a certain range of distances.
If something comes too close, they bottom out, and if something is too far, they cannot
detect it.
Choose a sensor that will detect obstacles in the range you need.
Field of View:
depending upon what you are doing, you may want sensors that have a wider cone of
detection.
A wider “field of view” will cause more objects to be detected per sensor
But it also will gives less information about where exactly an object is when one is
detected.
Tell our stories about sensors in lab as examples
Types of Sensors according to
their purpose in a robot
Exteroceptive: deal with external world
where is something ? No experience yet
how does is look ? (camera, laser range-finder)
Proprioceptive: deal with self
where are my hands ? (encoders, stretch receptors)
am I balanced ? (gyroscopes)
Interoceptive
what is my thirst level ? (biochemical)
what is my battery charge ? (voltmeter)
Try to understand sensors practically
Take time to play with each of the sensors you find in the lab,
especially in Lego, Lynxmotion and Robix kits.
Figure out how they work.
Look at the range of values they return.
Check under what conditions they give those values.
Look to code of previous students related to sensors.
The time you spend here will greatly ease your integration of
hardware and software later.
The better you understand your sensors, the easier it will be for
you to write intelligible control software that will make your
robot appear intelligent.
So as you read about the sensors, you should assemble a
bunch of sensors as shown in Webpages of previous classes.
There can be no feedback without
sensors!
Remember this!!
In this board, for instance, the typical analog values for digital sensors
are somewhat above 250 for an open switch, and less than 20 for a
closed switch.
When using the IC command, digital(port) {where port is an
analog port number (i.e., greater than 7)} :
the sensor value is compared to a threshold value,
and the command returns:
a 0 if the analog value is above the threshold
or a 1 if the analog value is below it (remember the inversion of the actual
signal that digital does?).
This threshold's default value is 127, but it can be changed
(See the section on IC commands for information on this).
Digital Sensors used in Analog
Ports
A good way to get digital information from an analog
sensor is to plug the analog sensor into a analog port
and call it with the digital(port) command.
For example, a reflectance sensor would return a 0 for black
or a 1 for white if read with the digital command - provided
the threshold is properly set.
This can reduce some of the programming complexity
by abstracting away the thresholding.
You should however experiment with the sensors
to determine the range of thresholds you get and
under what conditions these thresholds are valid.
Analog sensors in digital ports?
It is not recommended to plug analog sensors
into digital ports, however, because the digital
ports threshold to conventional logic levels
which cannot be adjusted to suit each analog
sensor.
The valid analog readings may fall into the
invalid range for digital logic.
Read in book about some mountings and uses
for some digital sensors in the 6.270 kit.
Switch Sensors
Switches are perhaps the simplest sensors of all.
They work without processing, at the electronics
(circuit) level.
Their general underlying principle is that of an open
vs. closed circuit.
If a switch is open, no current can flow; if it is closed,
current can flow and be detected.
This simple principle can (and is) used in a wide
variety of ways.
Think about all possible uses of
switch sensors in robot arms, mobile
robots and robot-animals of various
kinds
Switch Sensors
Switch sensors can be used in a
variety of ways - recall which were
already discussed and shown in lab.
You have seen many kinds of
switches already;
button switches,
mouse switches,
key board keys, Various Switches
One dollar switch
phone keys, etc.
Go to Shops (like Wacky Willy
or Tek Country) and you will
find plenty of cheap industrial
switches useful for your robot
project
What are the ways that Switch Sensors can be used?
• Contact (touch) Sensing Various Switches
–detect when the sensor has made physical contact with
another object
– triggers when a robot grabs an object;
– contact of whiskers
– a robot’s body runs into a wall,
– a robot’s gripper closes around a cube
• Limit Sensing:
– triggers when a gripper is as open as it can be
– a limit sensor detects when a mechanism has moved to
the end of its range of travel, signaling that the motor
should be turned off
• Shaft Encoding: 1. Bumpers
– an axle may be fitted with a contact switch that clicks
once per revolution. 2. Limit in robot
–Software counts the clicks and determines the amount arms
and speed of the axle’s rotation.
–e.g., triggers for each turn, allowing for counting rotations
3. Shaft encoders
Use of Dip Switches on Robots
There are four dip switches on the Expansion Board
6.270.
They can be used to select user program options
during testing.
One dip switch will be used in the starting code for the
contest to determine the side your robot starts on and at
which frequencies it transmits and receives the
modulated IR.
They can also be useful for outside control of program
parameters, like enabling certain functions or selecting
programs to run.
While these switches are connected to the analog port,
they are really digital switches.
Analog Sensors and Thresholding
Analog sensors, such as photo-resistors, can tell you how
far the sensor has bent, or how much light is hitting the
sensor.
They answer questions with more detail.
Analog sensors, however can be converted to digital sensors
using thresholding.
Instead of asking the question “How much is the sensor
bent?” you can ask the question: “Is the sensor bent
more than half way?”
The threshold can be determined by playing around with
the specific sensor.
How to interface a Digital
Sensor to Handy Board?
Digital Inputs Similar to Robix
• Nine digital sensor ports connect to Vsens
Example 2
Light Sensor
• Good for detecting direction/presence of light
• Non-linear resistance
• Slow response
3-terminal
potentiometer
2–terminal potentiometer
works best when the
pot’s value is large
2-terminal
potentiometer
Various uses of
Potentiometers
Potentiometers have a variety of uses.
In the past, they have been used for menuing programs
and angle measurement for various rotating limbs or
scanning beacons.
They can be used with a motor to mimic servos, but
that's a difficult task.
It is important to notice that the pots are not designed to
turn more than about 270 degrees.
Forcing them farther is likely to break them.
Tell about current project of animation inverse kinematics
robot with many pots and A/D board.
Various uses of Potentiometers
A potentiometer can be attached to a LEGO
beam such that it can be used in place of a
bend sensor.
The rotation of the beam will produce a
rotation in the potentiometer.
See if you can come up with an assembly that
can be used in place of a bend sensor.
The advantage to such a sensor is that it is
much sturdier than the bend sensor.
The disadvantage is that it is bulkier.
Linear Potentiometers and
their use in HandyBoard
A linear potentiometer can be used to measure precise linear
motion, such as a gate closing, or a cocking mechanism for ring
balls or blocks.
Frob-knob
The frob knob is the small white dial on the lower left corner of
the Expansion Board.
It returns values between 0 and 255 and provides a handy user
input for adjusting parameters on the y or for menuing routines
to select different programs.
You may find it useful to glue a small LEGO piece to the frob
knob to make turning it easier.
Homework Assignment
Try to find in your storage any kind of
sensors that you do not use and bring
them to the robotics labs.
The ECE 271 and the high school students
will possibly use it for projects if you will
not.
Look around the lab and try to identify
sensors and devices that we talked about.
Resistive
(Analog)
Position
Sensors
Resistive Position Sensors:
bending
We said earlier that a photocell is a resistive device,
i.e., it senses resistance in response to the light.
We can also sense resistance in response to other
physical properties, such as bending.
The resistance of the device increases with the
amount it is bent.
These bend sensors were originally developed for
video game control (for example, Nintendo
Powerglove), and are generally quite useful.
Video game accessories are in general useful for robotics and virtual reality
and very cheap.
Resistive Bend Sensors
Sensors
Wall Following/Collision
Detection
Sensor
Weight Sensor
Inputs for Resistive Sensors
V1
Voltage divider: R1
You have two resisters, one
V
is fixed and the other varies, Analog to Digital
as well as a constant voltage R2
(pull down)
V2
V1 – V2 * (R2/R1+R2) = V