84
And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up. Heat Sensors which measure temperature. Ultra Sonic Rangers tell the robot how far away objects are. Based on Based on book by book by Fred Fred Martin Martin Sensors for a robot 1. Resistive 2. Infra- red 3. Light 4. Sonar 5. Other Part 1. Resistive Sensors

And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

And

Touch sensors tell the robot when it bumps into something.

Light sensors measure light intensity.

gyroscopes tell the robot which direction is up.

Heat Sensors which measure temperature.

Ultra Sonic Rangers tell the robot how far away objects are.

Based on Based on book by Fred book by Fred MartinMartin

Sensors for a robot

1. Resistive2. Infra-red3. Light4. Sonar5. Other

Part 1.

Resistive Sensors

Page 2: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

The simplest possible use of The simplest possible use of sensorssensors

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.

Remember Breitenberg’s Vehicles?

light

Page 3: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

What Is a Sensor?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)

The material presented in our textbook and here relates to HandyBoard, but the same principles are true for Robix, Lynxmotion, Lego, etc. Read the manuals.

Page 4: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

What can a robot do without What can a robot do without sensing?sensing?

Simple Sensors Can be used without much processing Still require electronics (and

connectors) The basic electronics laws to know:

Ohm's law combining resistance dividing voltage

Review from ECE 201

Page 5: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

What you (and the robot) What you (and the robot) can do without sensors?can do without sensors?

Close your eyes. Plug your ears. Hold your nose. Tie your hands behind your back.

Shut your mouth. Tie your shoelaces together. Spin yourself around a few times.

Now walk. How does it feel? That's exactly what your robot feels: nothing - without sensors.

You have been given many types of sensors that can be used in a variety of ways to give your robot information about the world around it.

We will explain each of the sensors you can find in the lab, how it works, what it's good for, and how to build it.

Page 6: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Biological AnalogsBiological AnalogsAll of the sensors we describe in this

and next parts exist in biological systems

Touch/contact sensors with much more precision and complexity in all species (spiders?)

Polarized light sensors in insects and birds

Bend/resistance receptors in muscles and many more...

Page 7: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

You have to understand You have to understand sensorssensors

Before we can teach you what sensors do, we need to make one point very clear: Sensors are not magical boxes. All information you get from sensors must be decoded by you,

the human builder and programmer. Sensors convert information about the environment into a

form that can be used by the computer. The sensors that are on the robot can be related to sensors

found in humans. Touch sensors embedded in your skin, visual sensors in your

retina, and hair cells in your ears convert information about the environment into neural code that your brain can understand. Your brain needs to understand the neural code before you can

react. Since you will be programming the robot, you will need to

understand the output of the sensors before you can program your robot to react to different stimuli.

Learn about sensors in animals and think how to use this knowledge in your projects.

Page 8: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Some types of Sensors:Some types of Sensors:

Ladar (laser distance and ranging) Time of flight Phase shift

SonarRadarInfra-redLight sensingHeat sensingTouch sensing

Page 9: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Topics to be discussed:

What are sensors?

Types of sensors (many examples)

Sensor complexity

Signals -> symbols

Levels of processing

Poor and good design of perception

Biological perception and lessons

Sensor fusion

I’m Mr. Sensitivity. . .

Sensors and their useSensors and their use

Not every quarter

Page 10: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Solar Cell

Digital Infrared Ranging

Compass

Touch Switch

Pressure Switch

Limit Switch

Magnetic Reed Switch

Magnetic Sensor

Miniature Polaroid Sensor

Polaroid Sensor Board

Piezo Ultrasonic Transducers

Pyroelectric Detector

Thyristor

Gas Sensor

Gieger-MullerRadiation Sensor

Piezo Bend Sensor

Resistive Bend Sensors

Mechanical Tilt Sensors

Pendulum Resistive Tilt Sensors

CDS Cell Resistive Light Sensor

Hall EffectMagnetic Field

Sensors

Compass

IRDA Transceiver

IR Amplifier Sensor

IR ModulatorReceiverLite-On IR

Remote Receiver

Radio ShackRemote Receiver

IR Sensor w/lens

GyroAccelerometer

IR Reflection Sensor

IR Pin Diode

UV Detector

Metal Detector

Page 11: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

What are the types of What are the types of Sensors?Sensors?

Active send signal into environment and measure interaction

of signal w/ environment e.g. radar, sonar

Passive record signals already present in environment

e.g. video cameras GPS

We will discuss sensing using the following Touch Active Light Passive Light

There are many more ways (sound, heat, magnetic field, smell...)

In our lab we used infrared, light (photodiodes, phototransistors), compass, volt and amperometers, ions, pH, magnetic, temperature, voice, sound, camera, sonars and of course all resistance based micro-switches and pads..

Page 12: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Passive versus Active SensorsPassive 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.

Page 13: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

How to Choose a Sensor?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

Page 14: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Types of Sensors according to Types of Sensors according to their purpose in a robottheir purpose in a robot

Exteroceptive: deal with external world where is something ? 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)

No experience yet

Page 15: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

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.

Try to understand sensors Try to understand sensors practicallypractically

Page 16: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

There can be no feedback There can be no feedback without sensors!without sensors!

Sensors provide feedback to your program about the environment. Feedback is important in any controlled situation.

So far, we were discussing mostly open-loop, or timed programs that simply follow a pattern but have no real knowledge of the world.

Sensors can provide the feedback necessary to let a robot make decisions about how to act in its environment. They will make these programs smarter.

The feedback mechanism is very important in an environment that is continually changing.

Remember this!!

Page 17: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

There can be no There can be no feedback without feedback without

sensorssensors During the rounds of the contest, the objects on the playing field

will be changing their location (i.e., the other robot moves, the drawbridge closes, or you bump into a block). Robot soccer, robot theatre

We strongly encourage you to use closed-loop feedback design when planning and implementing your strategy.

There will be a smaller chance of random errors completely messing up your game if you use sensors wisely.

Read Chapter 6 of Martin about sensors. Read Chapter 8 of Martin for more information on the control

problems you may encounter.

Page 18: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Electric Electric Sensors:Sensors:digitaldigital

Electric Electric Sensors:Sensors:digitaldigital

Page 19: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Example of Sensor Example of Sensor InterfacingInterfacing

Handy Board has two banks for sensors:

• Digital inputs, numbered 15 to 7 on the left

• Analog inputs, numbered 6 to 0 on the right

Each sensor ports provides three signals to the sensor:

• +5v power - middle row

• Ground - lower row

• Sensor signal line - upper row

Not all sensors require +5v power, e.g., switches and photocells may be wired between sensor signal and ground lines

Handy Board’sHandy Board’s Sensor Input Banks

Page 20: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Location of Digital and Analog Location of Digital and Analog Ports on the HandyBoardPorts on the HandyBoard

The digital ports on the main board are labeled from 0-7.

There are also four analog ports on the main board, but when you use the expansion board, the analog ports get remapped to the connectors on the right side of the expansion board.

The ports are all arranged in the same format. The innermost row of pins are the signals,

followed by a space, then microprocessor power, and finally on the outer side is the ground.

Page 21: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Analog versus Digital Analog versus Digital SensorsSensors

In all our robotics kits the sensors are digital or analog. For instance, in HandyBoard, analog sensors can be

plugged into the analog sensor ports, which return values between 0 and 255.

Digital sensors can be plugged into either the digital ports or the analog ports, but will always return either 0 or 1.

ANALOG 0 =< x =< 255 DIGITAL 0 or 1 Each type of sensor has its own unique uses. Think about new uses, not shown in these slides and

tell me your ideas. May be we will use them.

Page 22: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Figure 5.1: Generic Figure 5.1: Generic Digital SensorDigital Sensor Schematics.Schematics.

Page 23: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Digital SensorsDigital Sensors Digital inputs all have pull-up resistors connected to

them as shown in Figure 5.1. Digital switches are wired such that the sensor is

wired across the signal pin and ground. This means that when the digital sensors is closed, the signal is

grounded or LOW. When the switch is open, the signal pin outputs +5V, or HIGH.

This value is INVERTED by software, so reading the digital port with the switch open returns 0, while reading the digital port with the switch closed returns 1.

With nothing plugged in, the value of a digital port should be 0.

Digital sensors can be used in the analog ports on the Controller board (such as 6.270 board) as well, relieving any restrictions the small number of digital inputs may cause.

Page 24: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Digital Sensors used in Analog Digital Sensors used in Analog Parts of the HandyBoardParts of the HandyBoard

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).

Page 25: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

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.

Digital Sensors used in Analog Digital Sensors used in Analog PortsPorts

Page 26: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Analog sensors in digital Analog sensors in digital ports?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.

Page 27: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Switch SensorsSwitch SensorsSwitches 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

Page 28: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Switch SensorsSwitch 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,

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

Various SwitchesOne dollar switch

Page 29: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

• Contact (touch) Sensing

–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:

– an axle may be fitted with a contact switch that clicks once per revolution.

–Software counts the clicks and determines the amount and speed of the axle’s rotation.

–e.g., triggers for each turn, allowing for counting rotations

Various Switches

What are the ways that Switch Sensors can be What are the ways that Switch Sensors can be used?used?

1. Bumpers

2. Limit in robot arms

3. Shaft encoders

Page 30: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Use of Dip Switches on RobotsUse of Dip Switches on RobotsThere 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.

Page 31: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Analog Sensors and Analog Sensors and ThresholdingThresholding

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.

Page 32: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

How to interface a Digital How to interface a Digital Sensor to Handy Board?Sensor to Handy Board?

• Nine digital sensor ports connect to circuitry on the HB that interprets each sensor’s Vsens voltage as a digital true/false

Vsens > 2.5 v, signal is logic one

Vsens < 2.5 v, signal is logic zero

• To connect switch to digital input circuit:

– Wire between the sensor signal line and ground

Digital Inputs Similar to Robix

Vsens

Page 33: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

• “normally open” switch

– Switch is released: it is open, so there is no connection between the Vsens sensor line and ground. The 47K pull-up resistor on the HB then provides the default value of +5v or logic one to the sensor input circuitry.

– Switch is pressed: it connects the Vsens sensor line to ground, the zero volt level. Then the sensor input circuitry detects a logic zero reading.

• Switch reading is inverted in software: digital()

Sensor Interfacing to Digital Sensor Interfacing to Digital InputsInputs

Page 34: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Mostly using micro-switchesMostly using micro-switches

Touch Touch sensorssensors

Page 35: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

The two micro switches are double pull, which means they can be wired so that they return a one return a one or a zero when not depressed. or a zero when not depressed.

The only major difference is how you think about the device in your code. Reading a sensor can be thought of as asking a question. Here, the question could be, “Are you open?" or “Are you

closed?"

If you wire the switch normally open, the answers are yes and no, respectively, where they would be no and yes for a switch wired

normally closed, all for the same situation where the switch is not

depressed.

Double Pull Micro-SwitchesDouble Pull Micro-Switches

Page 36: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Normally open and Normally open and Normally closed switchNormally closed switch

Depending on how you wire a switch, it can be normally open or normally closed.

This would of course depend on your robot's electronics, mechanics, and its task.

The simplest yet extremely useful sensor for a robot is a "bump switch" it tells when it's bumped into something, so robot can

back up and turn away.

You'll find that even for such a simple idea, there are many different ways of implementation.

Page 37: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Figure 5.2: Microswitch AssembliesFigure 5.2: Microswitch Assemblies

Normally closed

Normally open

Page 38: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Switch Sensor ConstructionSwitch Sensor Construction

Microswitch Normally Open Configuration

Pushbutton Switch Wiring Diagram

Microswitch Normally Closed Configuration

Page 39: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Possible arrangements for touch Possible arrangements for touch switchesswitches

Touch switches should be wired in a normally open configuration, so that the signal line is brought to ground only when the switch is depressed.

In some cases, a slight advantage may result from one of these arrangements, because there may be a difference between the position where the open side makes contact and the closed side breaks contact.

When this is the case, the choice of normally open or normally closed will affect how sensitive the switch is to outside forces.

This can allow you to make a very touchy sensing device or help block out noise.

The small black switches with the white lever arm respond to a respond to a shortershorter arm movement when wired normally openarm movement when wired normally open and require a little more movement to cause a transition in the normally closed configuration.

Page 40: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Switch SensorsSwitch SensorsSwitch Sensor Applications

Left- and Right-Hand Switch Construction

Design for a Simple Touch Bumper

These are not standard touch sensors in Lego. You can add them inexpensively buying in standard hardware store rather than through Lego.

Page 41: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Micro-Switches as object Micro-Switches as object detectorsdetectors

The standard kit includes three types of small switches, two micro switches and a small push button.

These make great object detectors, so long as you are only interested in answering the question, Am I touching something right now? with a yes or no.

This is often enough for responding to contact with a wall or the other robot or for actuator position sensing. Using a switch for actuator position sensing

(called a “limit" switch) can be a good way to protect drive mechanisms which self destruct when over driven.

Page 42: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Other uses of Micro-Other uses of Micro-Switches in our robotsSwitches in our robots

Actuator position sensing. This could be handy for limiting the

motion of hinged joints or linear actuators by requiring that a switch be open (or closed, depending upon the situation) before running the motor and monitoring it while things are moving.

They could also be used for extended user interface for testing and development purposes.

Page 43: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Bouncing and Bouncing and Debouncing of Debouncing of microswitchesmicroswitches

Bouncing is a problem found in many switches. At the point where the switch goes from open to close or vice versa, the output from the switch is very glitchy. The switch may output several transitions.

Bounciness occurs especially when the switch is used in a sensitive mode.

One way to debounce the switch is to add a delay between samples of the digital input.

If the sampling is sparse enough, the bouncing section of the data will not be collected. Discuss debouncing using NAND latches

and recall asynchronous state machines from ECE 271

Page 44: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Touch Sensors other Touch Sensors other than microswitchesthan microswitches

Whiskers, bumpers etc. mechanical contact leads to

closing/opening of a switchchange in resistance of some elementchange in capacitance of some elementchange in spring tension...

Page 45: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

What are three types What are three types of sensing with touch?of sensing with touch?

Normally done to avoid collisions Avoiding is a lot better than Detecting

There are basically 3 forms Bumper Switch Whisker Pressure Pad

Page 46: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Bumper SwitchBumper SwitchMounted on the chassis of the robotWhen plunger depressed collision is about to

occurCharacteristics

small surface area low cost = low sensitivity

Page 47: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Use of Touch Sensor as Use of Touch Sensor as BumperBumper

Page 48: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Bumper Example 1Bumper Example 1

Page 49: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Another Bumper Design Another Bumper Design ExamplesExamples

Bumper Design• rotational and sliding pivot points allow the bumper to react to pressure from any forward direction

Design for Bi-Directional Touch Bumper• can detect pressure from front or behind• movement in either direction pushes levered arm away from contact sensor• rubber bands pull arm back onto switch when pressure is released

Example 2Example 2

Page 50: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Touch Sensors: Touch Sensors: bumper bumper skirtskirt

• When the robot runs into a wall the bumper skirt hits a micro switch

•which lets the robot controller know that the robot is up against a wall.

Page 51: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

WhiskersWhiskersExtends sensing like a cat extends its sensing through its whiskers

Care should be taken in determining things like length weight shape

•Cat whiskers measure space. If a whisker touches the cat knows that it will not be able to go through an opening as the whiskers define the size of entrance it is capable of moving through.

Things like suspended ceiling wire, coffee sticks or tooth picks can all act as whiskers. They should no interfere with the actual sensing element.

Page 52: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Analog Analog SensorsSensors

Page 53: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Ohm's LawOhm's LawOhm's law; explains the relationship between

voltage (V), current (I), and resistance (R): V = I R

Simply put: the voltage between two points in an electronic circuit is equal to the product of the amount of current flowing through them and the amount of resistance between them.

Voltage is measured in Volts (V), current in Amperes (A), and resistance in Ohms (Omega).

Page 54: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Combining Combining resistancesresistances

It's not hard to figure out how much resistance one resistor gives (since they are labeled!). But what happens if you put one resistor R1 after another R2, i.e., connected them in

series?

The current I flowing through any number of resistors has to be equal, since it has only one route to flow on, as it goes from one resistor to the next. What happens to the voltage V?

Recall Ohm's law: V = I R = I (R1 + R2)

= I R1 + I R2

Suppose we measure the voltage across R1, i.e., the voltage between the input point V and the connection between R1 and R2, would would it be? It would be I R1 Volts. Similarly, if we measure the voltage across R2, i.e., the

voltage between the connection between R1 and R2 and ground, what will it be? It will be I R2.

The total voltage in an electronic circuit has to add up; therefore, the input voltage V has to equal the output voltage, after the drop across the two resistors, R1 and R2.

Therefore, since voltages in a series add, so do resistances in a series.

Practical use of your undergraduate electronics

Page 55: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Dividing voltageDividing voltage Suppose we take the voltage out at the point between R1 and R2,

what will the amount of that voltage Vout be?

Use Ohm's law again: V = I R => I = V / R

= V / (R1 + R2)

Then the voltage drop across R2, is the product of the above current I and R2: Vout = V R2 / (R1 + R2)

What if R1 = R2?

= V R2 / 2 R2

= V / 2

This is a voltage divider. To summarize: voltage can be divided by using two equal-value resistors in series.

You will learn in the lab how to bridge the gap between this type of laws of electronics to physical sensors all the way to robot behavior.

Page 56: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Analog SensorsAnalog Sensors The analog ports all have a pull up resistor which is a 47K

resistor between +5 volts and the signal input. The analog readings are generated by measuring the

amount of current flow through the pull up resistor. If no current flows through the resistor, the voltage at the

signal input will be +5 volts and the analog value will be 255.

The voltage at the signal pin can be simply calculated by: V sig = 5 check if one sensor fell out: write a piece of code that

checks the values of the analog ports that you have sensors plugged into.

If that value is above 250 or so, have it tell you to check the sensor.

Page 57: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Figure 5.4: Analog Sensors Figure 5.4: Analog Sensors SchematicsSchematics

Page 58: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Resistive Resistive SensorsSensors

The resistance of resistive analog sensors, like the bend sensors or potentiometers, change with changes in the environment, either an increase in light, or a physical deformation.

The change in resistance causes a change in the voltage at the signal input by the voltage divider relation.

Page 59: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Transitive Analog Transitive Analog SensorSensor

Transitive analog sensors, like the photo transistors and reflectance sensors, work like a water faucet.

Providing more of what the sensor is looking for opens the setting of the valve, allowing more current to flow.

This makes the voltage the voltage at the signal decrease.

A photo transistor reads around 10 in bright light and 240 in the dark.

One problem that may occur with transitive sensors is that the voltage drop across the resistor may not be large enough when the transistor is open. Some transitive devices only allow a small amount of current to

flow through the transistor.

Page 60: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Transitive Analog Transitive Analog SensorSensor

A larger range for the sensor can be accomplished by putting a larger pull-up resistor.

By having a larger resistor, the voltage drop across the pull-up resistor will be proportional to the resistance.

We will give example uses and mountings for each type of sensor.

Keep in mind that these are only simple examples and are not the only possible uses for them. It's up to you to make creative use of the sensors you have.

Page 61: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

•Vsens voltage at the center tap of the two resistors is proportional to the ratio of the two resistances.

Rphoto = 47K, Vsens = 2.5 v (exactly)

Rphoto << 47K, Vsens ~= gnd

Rphoto >> 47K, Vsens ~= +5 v

Sensor Interfacing to Analog Sensor Interfacing to Analog InputsInputs

Also possible to connect circuits that generate a voltage

Two resistors form voltage divider circuit

photocell element

Page 62: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

0 to 5 volts are converted into 8–bit numbers 0 to 255 (decimal) (A/D conversion)

Sensor Interfacing to Analog Sensor Interfacing to Analog InputsInputs

–When the photocell resistance is small

(brightly illuminated), the Vsens ~= 0v

– When the photocell resistance is large

(dark), Vsens ~= +5 v

Page 63: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Resistive Resistive Position Position SensorsSensors

Resistive Resistive Position Position SensorsSensors

Potentiometers. Glowes. Pads. Bend Sensors. Other….?

Page 64: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Pressure PadPressure Pad

You can purchase such pad for Nintendo games

Page 65: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

LM339 is a quad comparator circuit: Output will be +6V

Another approach is to use ohm meter to detect the resistance change which would be proportional to amount of pressure applied.

Pressure PadPressure Pad

Page 66: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Potentiometer: the main Potentiometer: the main ideasideas

Potentiometers are very common for manual tuning; you know them from some controls (such as volume and tone on stereos).

Typically called pots, they allow the user to manually adjust the resistance.

The general idea is that the device consists of a movable tap along two fixed ends.

As the tap is moved, the resistance changes. As you can imagine, the resistance between the two

ends is fixed, but the resistance between the movable part and either end varies as the part is moved.

In robotics, pots are commonly used to sense and tune position for sliding and rotating mechanisms.

Page 67: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

• Fixed Rotation Sensors• Easy to find, easy to mount

Light Sensor• Good for detecting direction/presence of light • Non-linear resistance• Slow response

Potentiometers versus resistance sensorsPotentiometers versus resistance sensors

Cadmium Sulfide Cell

Potentiometer

Look to catalogs:

HANDYBOARD: Gleason Research. http://www.gleasonresearch.com/

http://handyboard.com

DISTRIBUTOR OF AGE BEND SENSOR: Images Company: http://www.imagesco.com

PITSCO LEGO DACTA, JAMECO, ETC - see the book and my webpage.

Page 68: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

PotentiometersPotentiometers

• Manually-controlled variable resistor, commonly used as volume/tone controls of stereos

• Mechanical varieties:Mechanical varieties:

– Linear and rotational styles - make position sensors for both sliding mechanisms and rotating shafts

– Resistance between the end taps is fixed, but the resistance between either end tap and the center swipe varies based on the position of the swipe

• Electrical varieties:Electrical varieties:

– Linear taper - linear relationship between position and resistance. Turn the pot 1/4 way, the resistance between the nearer end and the center is 1/4 of end-to-end resistance

– Audio taper - logarithmic relationship between position and resistance. At one end, 1/4 turn would swipe over a small bit of total resistance range, while at the other end, 1/4 turn would be most of the range

Page 69: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Figure 5.5: Figure 5.5: Potentiometer Potentiometer

AssembliesAssemblies Kits contain several

sizes of potentiometers, also known as variable resistors.

There are rotary and linear pots.

Potentiometers should be wired with Vcc and ground on the two outside pins, and the signal wire on the center tap. This will, in effect,

place the resistance of the potentiometer in parallel with the 47K pull-up on the expansion board and is more stable than just using one side and the center tab to make a plain variable resistor

Page 70: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

PotentiometersPotentiometers as Resistive Position as Resistive Position SensorsSensors

works best when the potentiometer resistance is small enough such that a 47K resistance in parallel with the pot’s resistance has only a small effect

2-terminal potentiometer

3-terminal potentiometer

2–terminal potentiometer works best when the pot’s value is large

Page 71: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

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.

Various uses of Various uses of PotentiometersPotentiometers

Tell about current project of animation inverse kinematics robot with many pots and A/D board.

Page 72: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

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.

Various uses of Various uses of PotentiometersPotentiometers

Page 73: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Linear Linear Potentiometers Potentiometers and their use in and their use in

HandyBoardHandyBoard 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-knobFrob-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.

Page 74: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Homework AssignmentHomework AssignmentTry 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.

Page 75: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Resistive Resistive (Analog) (Analog) Position Position SensorsSensors

Page 76: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Resistive Position Resistive Position Sensors: bendingSensors: 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.

Page 77: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

• Resistance = 10k to 35k• Force to produce 90deg = 5 grams• www.jameco.com = 10$

Resistive Bend SensorsResistive Bend Sensors

Page 78: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Bend SensorsBend Sensors

• Useful for contact sensing and wall-tracking

• The bend sensor is a simple resistance

– As the plastic strip is bent (with the silver rectangles facing outward), the resistance increases

You can remove it from Nintendo gloves

Page 79: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Resistive Position Resistive Position SensorsSensors

Mechanically, the bend sensor is not terribly robust, and requires strong protection at its base, near the electrical contacts. Unless the sensor is well-protected from direct

forces, it will fail over time. Notice that even in a good arrangement, repeated

bending will wear out the sensor. Remember: a bend sensor is much less robust than

light sensors, although they use the same underlying resistive

principle.

Page 80: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Sensor

Measure bend of a joint

Wall Following/Collision Detection

Weight Sensor

Sensors

Sensor

Applications of Resistive Analog SensorsApplications of Resistive Analog Sensors

Page 81: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

micro+-

Single Pin Resistance

Measurement

Binary Threshold

micro

Analog to Digital(pull down)

Inputs for Resistive SensorsInputs for Resistive Sensors

Voltage divider: You have two resisters, oneis fixed and the other varies,as well as a constant voltage

V1 – V2 * (R2/R1+R2) = V

R1

R2

measureKnown unknown

V

V1

V2

Comparator: ifvoltage at + is greaterthan at -, high value out

Page 82: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Sensor AssemblySensor Assembly

You should have read the section on the chapter of Martin’s book on the types of connectors used with the 6.270 board. This is an important concept to understand

before building your sensors.When building your sensors, do not make

your wires too long. Excess wiring has a tendency to get caught

in gears and other mechanisms.

Page 83: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

Sensor Assembly Sensor Assembly HomeworkHomework

Start out with sensor wires no longer than 1 foot long and when your finally decide on your robot configuration, you can modify to length. Just build a few of each type so you can play with them.

Start out with building simple sensors like one or two switches.

The more complicated ones will be the analog sensors that use IR.

Go to lab and familiarize yourself with Lego kit sensors and how to use them.

I purchased many good sensors from Wacky Willy, Tek Country Store and Radio Shack. In Goodwill you can buy old toys like Nintendo gloves or jumping pads that can be used. They are in the lab and you can use them. You have to notify me or lab assistant.

Page 84: And Touch sensors tell the robot when it bumps into something. Light sensors measure light intensity. gyroscopes tell the robot which direction is up

SourcesSources A. Ferworn Saúl J. Vega Daisy A. Ortiz

Raúl E. Torres

Maja Mataric Ali Emre Turgut Dr. Linda Bushnell Web Site:

http://www.ee.washington.edu/class/462/aut00/Robotic Explorations: A Hands-on

Introduction to Engineering, Fred Martin, Prentice Hall, 2001.