Introduction to electronics and microcontrollers
by Nathan McCorkle for PortLabPDX’s October 19th meetup lecture
Electricity?
Symbols are Useful
Symbolic representations of
common building blocks help
communicate complex systems
Diodes Resistors Inductors Capacitors
Diodes: one-way valves
Diodes: one-way valves
First were made of a chunk of crystal (rock) and a fine wire, hallmark device was a cat’s whisker detector-- the ‘crystal’ in crystal radio.
Diodes: one-way valves
Diodes: LEDs
Capacitors
These store charge and can discharge it very quickly. These are used to power things like a camera flash, and an oscillator (clock tick or metronome) can be built by charging a capacitor and discharging it when full
Capacitors
Capacitors
electrolytic have higher current leakage, but are cheap and work pretty well if you aren’t running on batteries
capacitors are harder to control manufacturing tolerances on than inductors, so for circuits requiring precise signal filtering it is cheaper to use inductors instead (RL filter instead of RC or LC)
Resistors
photoresistors - resistance changes with illumination
can be made to have very fine tolerance i.e. 0.1%
Resistors
Inductors
Store energy in a magnetic field around the wire
RLC Java demo
Inductors
Transistors
An electronic switch that can control much more power than applied.
Like a water faucet on a pressure washer, takes little effort to turn, but afterward the pressurized water can peel paint from a house or metal surface.
Transistors
Breadboard
Used for prototyping circuits with jumper wires and through-hole components.
To used smaller surface-mount components, a break-out board is needed.
Wire-wrap (historically used;prototyping)
Wire-wrap (historically used;prototyping)
Point-to-point
Point-to-point (Dead-bug)
Printed Circuit Board (PCB)
Using Computer Aided Drafting to lay out PCB traces
PCB - Printed Circuit Board
After the traces have been routed, the board made and populated (‘stuffed’).
Electronic Component Packages Through-hole components
Electronic Component Packages Through-hole components
TO-220 - has heatsink mount, higher-power ability
Joint Electron Device Engineering Council (JEDEC) Transistor Outline Package 220
TO-92 - cheap, low-power only
Electronic Component Packages
Pin Grid Array (PGA) - older CPUs
Electronic Component Packages
surface mount device (smd)
‘’ technology (smt)
ExposedPAD TSSOP with 16 pins
LQFP with 44 pins
Electronic Component Packages
Ball Grid Array (BGA)
(xbox red ring of death)
DIY using hacked toaster oven
Electronic Component Packages
Land Grid Array (LGA) socket - late-generation CPUs (2011 pins )
Electronic Component Packages
Low Insertion Force socket - 1.8” hard drives, previously 80386 CPUs
Electronic Component Packages
Zero Insertion Force socket - Much more expensive than LIF
BGA chips are supported, used with Flexible Flat Cable (FFC) in embedded devices
Microcontroller vs
laptop computer
Microcontrollers
$0.44
Microcontrollers
Microcontrollers
ATMega Microcontroller functional block diagram
But wait there’s more!!
AVR
CPU
functional
block
diagram
But wait there’s more!!
Microcontrollers
This is starting to look like we could branch out and enter recursive loops for weeks of learning. Whole reference books worth of sub-systems/peripherals.
Know the basic system, be good about looking up jargon.
Remember, computers operate in binary, 0 or 1, high voltage or low voltage… this largely reduces real-world noise from messing up data or operations.
Setting one of these up right must be really complex, right?
Microcontrollers - programming
The microcontroller has many useful peripherals but often fewer pins broken-out from the Integrated Circuit package. The configuration depends on user need.
Microcontrollers - programming
Magic numbers from the datasheet, what page was that on? Hrmm, this is getting hard.
Microcontrollers - programming
Arduino to the layman’s rescue!
Unzip the 1 zip-file download, and forget about magic numbers.
Microbial Fuel Cell example
precision resistors are expensive depending on the power needed
Microbial Fuel Cell example
resistance value should be a little higher since there is no load in a mud battery (mfc)
Microbial Fuel Cell example
Microbial Fuel Cell example
Electroencephalography (EEG) example
Electrodes
Mastoid (Ground), the bone behind your ear.
Nasion (+/-), the ridge between your nose and forehead, between eyebrows.
Inion (-/x), the point where your skull ends at the back of your head.
Electroencephalography (EEG) example
From Instructables user cah6 - circuit can also do Electrocardiography (ECG)
Electroencephalography (EEG) example
Fast Fourier Transform of the microphone signal using Processing framework
Electroencephalography (EEG) example
Playing a simple game, paddle position depends on brain frequency
Electroencephalography (EEG) example
From Instructables user cah6 - http://www.instructables.com/id/DIY-EEG-and-ECG-Circuit/
The circuit will use 3 electrodes - 2 to measure a voltage difference across your scalp, and one as a reference to ground.
Electroencephalography (EEG) example
Frequency response of completed circuit
Electroencephalography (EEG) example
Stage 1 - Instrumentation Amplifier
Electroencephalography (EEG) example
Stage 2 - 60Hz Notch Filter (filters U.S. AC power related noise)
Electroencephalography (EEG) example
Stage 2 - 60Hz Notch Filter, frequency vs gain response
Electroencephalography (EEG) example
Stage 3 - 7Hz High Pass Filter (HPF)
Electroencephalography (EEG) example
Stage 3 - 7Hz High Pass Filter (HPF)
Electroencephalography (EEG) example
Stage 4 - 31Hz Low Pass Filter (LPF)
Electroencephalography (EEG) example
Stage 4 - 31Hz Low Pass Filter (LPF)
Electroencephalography (EEG) example
Stage 5 - 1Hz High Pass Filter (HPF) and gain of 83-455
Electroencephalography (EEG) example
Stage 6 - 60Hz Notch Filter and into the computer microphone
Even with all the previous filtering stages, the data will still at this point contain a good amount of 60 Hz noise. Even after adding another 70Hz notch filter, the final data will still have a small amount of noise
EEG + Transcranial Magnetic Stimulation
Other Biotech Uses
Seperation of DNA
fragments via an electrical
potential
PCR
DNA xerox machine.
Essentially an electronics project