Housekeeping
- Results from your sensor walk assignments
- Questions from Arduino assignments – anything you’d like to show us, talk about? You should have…
Rationale
Today will be a quite practical session – looking at the input and output options for your Arduino systems. We’ll also go through some tips and trips for programming with Arduino.
From Last Week
- Go through the Arduino_SecondExamples.zip – what’s going on in there…
- We’ll develop a few more practical examples in class
This Substance of Electricity
- Waterfalls, bolders – metaphors for electricity…
- LED “circuit“
- The “voltage divider” = potentiometer – what’s really going on in there?
- Electricity:
- Voltage
- Resistance
- Current – led ‘circuit’
- Ohm’s Law: V= iR
- Electromagnetism – relays, solenoids, electromagnets
- Semiconductors – transistors, microchips
Representation
- Sampling
- Resolution, Sample rate
- Nyquist’s theorum describes this processes’ potentials and limitations
- How many (more) samples do we need to take for a signal that is twice as “fast”…?
- Resolution & Sampling
- Image quality examples (spatial aliasing)
- Imaging Sensor (e.g.: photography)
- Moving image examples (temporal aliasing)
- Wagon Wheel Effect
- Wagon Wheel Effect demo
- Aliasing
- Nate the mathematics guy explains aliasing
- Digital Numbers
- Decimal (base-10) numbers
- Binary (base-2) numbers
- ASCII Characters - the ASCII Table
- What happens in the Arduino when we sample?
The Serial Port
- Serial, RS232 and USB
- ASCII encoding – can be confusing – be careful that you understand this!
- Zterm (there are many like this)
Programming structures
- Most things are common to all programming languages!
- Flow… “Threading” and timings in a microcontroller
- why PWM, UART (serial ports) are important
- interrupts (a microchip’s subconscious mind??)
- Variables
- Choices – “if” statements – e.g.: thresholding
- More than one choice – “case” statements – e.g.: metering
- Over and over – “for” loops – e.g.: S.O.S.
- Creating a function – concealing/repurposing a set of functions – e.g.: the S.O.S. function
- Timing – how long since something happened – e.g.: millis
- “Counting”
- The increment operator (++)
- Modulus
- What if you want something to happen every X number of times?
- count up, whenever the ‘modulus’ of that count is “0″ – you can trigger an action. Very useful
- physical properties of the thing being sensed
- thermal
- electromagnetic (e.g.: the hall effect)
- mechanical
- chemical
- optical and radiation (e.g.: geiger counter)
- properties of the sensor
- Continuous/Discrete/Sampling rate
- Dynamic Range (high/low)
- Resolution (high/low)
- Repeatability & Long-term sensor drift
- ‘interaction potential’?
- fine/coarse control
- mental model
- expressiveness / satisfaction
- Switches!
- Types of Switches:
- Mechanical switches – Knife, pushbutton, slide, tilt, DIP
- Magnetic reed switches
- Relays
- Hall effect sensors
- Other Properties
- Pole & Throw (SPST, SPDT, DPST, DPDT)
- Number of ‘positions’ and number of independent conductors that get ‘thrown’ when switch changes Momentary/Toggle
- “Normal” position (open, closed)
- Momentary or toggle
- Types of Switches:
- Variable resistance!
- Staggering applicability…
- Types of Potentiometers:
- Slide potentiometers
- Yo-yo (“string”) potentiometers
- Rotary potentiometers
- Geared, levered, pulley-actuated, etc.
- Types of Potentiometers:
- Other Properties
- Linear vs. Non-linear – Refers to the property of whether or not a given of ‘turn’ gives an equal change in resistance across the entire scale of the potentiometer (more on this later)
- Dampened, notched, sprung, etc.
- Detent (e.g.: variable detent potentiometer)
- Staggering applicability…
- Continuous sensors of physical properties!
- Thermal – Bimetals (thermo-mechanical) – Thermocouple – Thermistor
- Electromagnetic – Current sensors – Metal detectors – Hall effect sensors
- Mechanical – Pressure:
- altimeter
- barometer
- air-speed – flow? temperature? ultrasonic
- Flow:
- mass flow
- pressure derived
- anemometer
- Tilt:
- accelerometer
- ball&groove
- mercury
- Chemical
- Olfactory
- Gas sensors (volatile organics)
- pH
- Optical and radiation - Geiger counter, photoresistors
- IR & Visible Light
Outputs (for now)
- Transistors
- Relay
- Motors
- DC motors
- Servo motors
- AC motors (be careful… please talk to me if you’re going to try this)
- Lights
- LEDs
- DC Filament lights
- AC lighting (be careful… please talk to me if you’re going to try this)
- Thermal… etc. (Peltier junction)
