Hardware Hacking area: Make Cool Things with Microcontrollers (and learn to solder)

Preview:

Citation preview

Mitch Altman Chief Scientist, Cornfield Electronics, San Francisco, CA USA Author of The Brain Machine in MAKE Magazine #10 Inventor of TV-B-Gone universal remote control

email: mitch@CornfieldElectronics.com site: www.CornfieldElectronics.com

Codebits November 14, 2008

Hacking Cool things With

Microcontrollers!

I Love My Job!

Why make cool things with Microcontrollers?

And anyone can learn…

Microcontrollers are fun to play with

Why make cool things with Microcontrollers?

Examples of Cool Microcontroller Projects (in my opinion)

TV-B-Gone TV-B-Gone Pro

TV-B-Gone Kit

Examples of Cool Microcontroller Projects (in my opinion)

MiniPOV3 kit

The Brain Machine

Trippy RGB Light LED Cube

Solar BugBot

Examples of Cool Microcontroller Projects (in my opinion)

Mignonnette Game kit

Examples of Cool Microcontroller Projects (in my opinion)

Trippy RGB Waves kit

What is a Microcontroller?

What is a Microcontroller?

A complete computer on a chip (with a little extra stuff)

Processor Program Memory

RAM

Input/Output

Timers

Inputs

Outputs

What Does a Microcontroller Do?

Like all computers:

Fetch Instruction

Execute Instruction

Repeat forever (till power goes off)

How to Make Cool Things with Microcontrollers

•  Idea

•  Hardware

•  Firmware

•  Coolness!

Hello World

Make an LED blink

Hello World – Hardware Battery +

Battery -

Battery - Resistor LED Microcontroller

Hello World – Digression:

(Very) Basic Electronics Lesson

Electronics: electrons flowing through wires and parts (sorta like water flowing through pipes)

Current -- speed of electrons flowing

Battery -- like a pump pushing electrons

Resistor -- like a kink in a pipe, slows down electrons

Diode -- one-way valve for current

LED -- special diode: emit photons when current flows

Transistor -- remotely controlled switch

Microcontroller -- zillions of transistors!

Hello World – Firmware

Software: X = 00000001

Firmware: X = 00000001

Assign a value to a variable:

Hello World – Firmware

PortA = 00000001

PortA = 00000000

Changing an output pin:

Hello World – Firmware

PortA = 00000001

Call Delay

PortA = 00000000

Changing an output pin (using manual delay):

Delay: Count = 0

Wait: Count = Count + 1 If Count < 10,000 goto wait Return

-----------

Hello World – Firmware

Main: Call Init

PortA = 00000001 Call Delay

PortA = 00000000 Sleep

Changing an output pin (using hardware timer):

Delay: Timer0 = 60,000

Wait: If Timer0flag = 0 goto wait Return

-----------

Hello World – Firmware

Main: Call Init

PortA = 00000001 Call Delay

PortA = 00000000 Sleep

Changing an output pin (using interrupts):

Delay: Timer0 = 60,000

Wait: If TimeFlag = 0 goto wait Return

-----------

Advanced topic:

ISR: TimeFlag=1

Return

Hello World – programming your chip

Use software on your computer Text Editor Compiler Programmer

Specific software Depends on your microcontroller PIC, AVR, etc.

Need hardware programmer (often very cheap)

Real Project: Ladyada’s MiniPOV3

Just like “Hello World”, but 8 LEDs and different timing

Etc…

Hacking! :

The easy way to make your cool microcontroller projects

Hacking!

TV-B-Gone from MiniPOV3 kit

Hacking!

TV-B-Gone Kit from MiniPOV3 hack

Hacking!

TV-B-Gone Pro from TV-B-Gone Kit

Hacking!

Trippy RGB Light from MiniPOV3 kit

Pulse Width

Modulation (PWM)

. . . . . . 1/2 brightness

. . . . . . 1/4 brightness

. . . . . . min brightness

Hacking!

Trippy RGB Waves kit from Trippy RGB Light

IR detector causes interrupt when it sees IR reflecting from your hand

Hacking!

Solar BugBot from MiniPOV3 kit

Hacking!

LED Cube from MiniPOV3 kit

(First NYC Resistor Project)

Hacking!

Brain Machine from MiniPOV3 kit

Synchronizes your brain to a desired brainwave sequence (and hallucinate along the way!)

WARNING: Blinking lights are not good for people with epilepsy

Brain Machine

What’s It Like?

Video by Bre P

ettis

Microcontrollers are fun to play with

Come by the Workshop Hardware Hacking Area

And anyone can learn!

Q & A

Mitch Altman Chief Scientist, Cornfield Electronics, San Francisco, CA USA Author of The Brain Machine in MAKE Magazine #10 Inventor of TV-B-Gone universal remote control

email: mitch@CornfieldElectronics.com site: www.CornfieldElectronics.com

Codebits November 14, 2008

Hacking Cool things With

Microcontrollers!

Recommended