Electronic Technologies for Art II (electric boogaloo)
Mark Allen
UCSD
Overview
- Introduction
- Microcontroller 101
- Lab set up
- Hello World
Goals
- gain general familarity with materials and concepts of class
- understand the basic elements of electronics
- set up computers and basic stamp for programming
- understand + build basic schematic
- write first program
Materials
- computer
- basic stamp homework board
- serial cable, usb to serial converter
- resistor
- led
How to succeed at electronics
- Document your process
- Buy your way out of trouble
- Remain flexible
- Expect things to go wrong
- Collaborate
- Try to avoid reinventing the wheel
Interactivity
- Input – sense something. Human moves in front of motion sensor
- Processing – decide what to do. If human present, activate defense system
- Output – do something. Turn on flamethrower.
Transduction
- Conversion of one form of energy to another
- Sensors convert physical changes (heat, sound, motion) to electricity
- Motors, Electromagnets, Toasters convert electrical energy into other forms of energy such as heat or kinetic energy
Digital vs Analog
- Digital is on/off. Push button switch, beam break detection.
- Analog covers range of value. Temperature, brightness, volume
Microcontrollers
- Computer with I/O designed for electronics
- Cheap + Small
- Uses electricity as information
- Interfaces with transducers
- Compilier running on PC turns human readable code into instructions for microcontroller
- Hardware (burner) connected to PC transfers instructions onto microcontroller
Basic Stamp overview
- Pro: Basic Stamp software is a (free) basic compilier and IDE (Integrated development environment)
- Pro: Basic stamp hardware eliminates the need for seperate hardware to transfer code onto stamp
- Pro: Oodles of users
- Pro: Easy
- Con: Expensive
- Con: Slow
Homework board wiring
- Vin : unregulated voltage into stamp
- Vdd : regulated 5v, 100 m.a. max current
- Vss : Ground
- P0-P15 : Input/output pins. Each pin can source 20ma max, sink 25ma max
Hello World code
- Main: ' label
high 7 ' set pin 7 to 5v
pause 100 ' do nothing for .1 seconds
low 7 ' set pin 7 to gnd
pause 100 ' do nothing for .1 seconds
Goto Main ' go to label "Main"
Programming procedure
- Connect stamp to computer via serial cable or usb to serial converter
- Make sure stamp has power
- Launch basic stamp application
- (windows) choose bs2 icon. it's green and near the middle of the tool
bar
- (windows) choose language version 2.5. it's a cog with 2.5 on ito the
right of the bs2 icon
- click the run button to download code into the stamp
Debugging
- Does stamp have power?
- Is resistor the right value? (220 ohm)
- Does LED work?
- Is compiler finding the stamp? try using the id button in the tool bar