Title: Week 5 Lots of Stuff
1Week 5 Lots of Stuff
- Sensors and sensing, mostly.
2All of Todays Stuff
- Start Passing Wires Around
- printf() / just a few words /
- Serial Terminal
- Sensors and Sensing
- Voltage Divider Circuit
- Photocells
- Photovores
- Wiring
3Start Passing Wires Around
- Youll need four 2½ long wires of different
colors, stripped ¼ at both ends - Red (5 Volts)
- Black (Ground)
- Blue (Pin C4)
- White (Pin C5)
- Also, two 1 long blue/yellow striped wires,
stripped ¼ at both ends
4printf()
- printf() is a formatted print function in C.
- It takes a variable number of arguments
- 1 printf(Hello, world!\n)
- 2 printf(This is an integer d\n, nameofint)
- gt2 printf(3 ints d, d, d\n, a, b, c)
- See analogbutt.c on Blackboard.
5Serial Terminal
- No monitor hooked up to your robot!
- Buzzer
- LEDs
- RS232
- TeraTerm
- A (free!) terminal emulation software
- http//hp.vector.co.jp/authors/VA002416/teraterm.h
tml - StartgtRun Q\tt
6Sensors and Sensing
- Sensors tell a robot one simple thing about their
environment - Temperature, distance, pressure etc.
- A digital sensor returns a 0 or a 1
- Example bump sensor
- An analog sensor returns a value from a range
based on the voltage level. - Examples photocell, ultrasonic ranger
7The Voltage Divider
This is a battery. It supplies electrical
current at a constant(ish) voltage.
8The Voltage Divider
This is a battery. It supplies electrical
current at a constant(ish) voltage.
6V
9The Voltage Divider
This is a resistor. It blocks the flow of
electrical current.
10The Voltage Divider
This is a resistor. It blocks the flow of
electrical current.
11The Voltage Divider
V
R1
R2
12The Voltage Divider
- a V
- c 0 (Ground)
- b (a-c)(R1/R1R2)
- V(R1/R1R2)
V
R1
R2
13Photocells
Photocells are variable resistors. Current flow
is proportional to incident light.
14Photocells
Photocells are variable resistors. Current flow
is proportional to incident light.
15The Voltage Divider with a Twist
- a 5V
- c 0V
- R1 4.7k ohms
- b (a-c)(4700/4700R2)
- 5(4700/4700R2)
- 3k lt R1 lt 11k claimed
- 300 lt R1 lt 500k actual
V
R1
R2
16Photovore
- A photovore is a robot that is attracted to
light. - Grey Walter created the turtle robots in 1948
it is unknown how they worked, but they were
among the first photovores.
17Photovore
- Braitenberg published a paper (1984) on a simple
method of controlling a photovore.
18Next weeks demo
- Your task to create a photovore
- Things to keep in mind
- Light levels vary depending on time of day
- Your photocells will NOT be identical, nor will
they return the same values for similar light
levels - Hint you may want to compare both of your
photocells for light intensity and drive in the
direction of the greatest light intensity. Just a
suggestion there are many ways to do this.
19Photovores
20A Quick Note about Breadboards
21To Ffly C4
To Ffly C5