grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a...

52
Behind the Scenes of the DEFCON Badge Joe Grand (Kingpin) [email protected] DEFCON 14 Friday, August 4

Transcript of grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a...

Page 1: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

Behind the Scenes of the DEFCON Badge

Joe Grand (Kingpin) [email protected]

DEFCON 14Friday, August 4

Page 2: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

2 © 2006 Grand Idea Studio, Inc.

Thanks for Waking Up Early!

We had to keep actual session title a secret until the badge was releasedWe’ll look at the entire development process of the badge from conception to production unitsRead the short story in the DEFCON programSorry if you were looking for a different kind of hardware hacking!Interrupt me and ask questions!

Page 3: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

3 © 2006 Grand Idea Studio, Inc.

Development Process in a NutshellDefine the Specifications Preliminary SchematicInitial BreadboardingCode DevelopmentFinal SchematicCreate Bill-of-MaterialsPrinted Circuit Board (PCB) DesignPrototype TestingParts Sourcing/AcquisitionPlace the Quantity Order

Page 4: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

4 © 2006 Grand Idea Studio, Inc.

Specifications: Initial Proposal

The Dark Tangent and Ping had a good idea of what they wanted before they called me

– Quantity of 6,055 (that’s a lot!)– Total cost of under $5– Badge in the shape of DEFCON logo– Blinky LEDs– Battery needs to last at least the length of DEFCON– Must look wicked pissah (east coast) and/or totally rad

(west coast)

Page 5: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

5 © 2006 Grand Idea Studio, Inc.

Specifications: Concept Sketch

Page 6: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

6 © 2006 Grand Idea Studio, Inc.

Specifications: Defined Feature Set

After some back-and-forth discussions, we settled on the functionality and artistic elements:

– DEFCON logo and icons on top copper layer– Crossbones and smile to be cutout– Different soldermask colors for different DEFCON

clientele– Single button for user control (no power switch)– Multiple LED states:

o Both Steady Ono Both Blinko Alternatingo Random (Pseudo-random, actually)

Page 7: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

7 © 2006 Grand Idea Studio, Inc.

Preliminary Schematic

Page 8: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

8 © 2006 Grand Idea Studio, Inc.

Breadboarding/Code Development

1. Turn preliminary sketch into something physical 2. Evaluate different types of LEDs3. Write the embedded code for the Microchip

PIC10F202 processor4. Fine-tune and tweak hardware and code until it

functions as specified

Page 9: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

9 © 2006 Grand Idea Studio, Inc.

BreadboardingBreadboarding: A method to build circuits without soldering or creating custom PCBs

– The ideal method of prototyping– Utilizes a plug board and 24AWG solid wire– Not recommended for high frequency/RF circuits

Page 10: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

10 © 2006 Grand Idea Studio, Inc.

Breadboarding: LED Evaluation

Page 11: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

11 © 2006 Grand Idea Studio, Inc.

Breadboarding: Prototype Circuitry

Page 12: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

12 © 2006 Grand Idea Studio, Inc.

Code DevelopmentUsed CCS PCM compiler for Microchip PIC10F202 with MPLAB IDE v7.30

– Ex.: www.ccsinfo.com– Free development tools are available, too

(www.microchip.com)

Simple state machinetypedef enum{

SLEEP,STEADY, BLINK,ALT,RANDOM

} state_type;

Page 13: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

13 © 2006 Grand Idea Studio, Inc.

Code Development 2

Page 14: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

14 © 2006 Grand Idea Studio, Inc.

Final Schematic

Page 15: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

15 © 2006 Grand Idea Studio, Inc.

Drawing Schematics

Many professional tools available, mostly in the $5k-$10k range

– Ex.: Cadence/OrCAD Capture, www.orcad.com– Ex.: Altium/Protel DXP, www.altium.com

Demo licenses for some professional tools– Usually expire after 30 days

Some fully-free software available– Ex.: gEDA, http://geda.seul.org, complete open-

source PCB, schematic capture, and simulation for Unix platforms

Page 16: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

16 © 2006 Grand Idea Studio, Inc.

Drawing Schematics 2

Microsoft Visio can perform rudimentary schematic capture using common symbols

– Cannot easily create custom parts– Cannot export a Netlist for use with PCB design

Page 17: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

17 © 2006 Grand Idea Studio, Inc.

Bill-of-Materials

Cost issues (had to keep around $5/unit total)Had to make sure that all selected components were available in large quantitiesUsed trusty Digi-Key and Mouser catalogs to create first draft BOMEnlisted Future Electronics to help with cost reduction and large quantity ordering

– Typically 30% of the cost of Digi-Key, Mouser, etc.– More on this later…

Page 18: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

18 © 2006 Grand Idea Studio, Inc.

Bill-of-Materials 2

Page 19: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

19 © 2006 Grand Idea Studio, Inc.

PCB DesignThree general methods to create custom PCBs:1. Homebrew w/ PCB etching kit2. PCB prototyping systems3. Professional fabricationPrinted Circuit Board (PCB) etching kit

– Low-cost method for quick homebrew hacks (practically instant gratification)

– Uses hazardous chemicals (ferric chloride) which etch away any copper on the circuit board that isn't protected by resistant ink or toner

– Ex.: MAKE Magazine issue 2

Page 20: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

20 © 2006 Grand Idea Studio, Inc.

PCB Design 2

November 1993April 2000

Page 21: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

21 © 2006 Grand Idea Studio, Inc.

PCB Design 3PCB prototyping systems

– Highly specialized, accurate CNC machine– Allows quick in-house creation of prototype PCBs– > $10k for a decent system– Not practical for most hardware hacking purposes– Ex.: LPKF Laser & Electronics (www.lpkf.com) and

T-Tech (www.t-tech.com)

Page 22: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

22 © 2006 Grand Idea Studio, Inc.

PCB Design 4

Professional fabrication– More convenient and better quality than homebrew,

why bother with dangerous chemicals anymore? – Can handle very fine pitch, tight tolerances, etc.– Prototype and production quantities– Competition between firms leads to good deals for us

o Prototype specialso On-time guaranteeso Price matching

– 2-layer board costs ~$20-30 each (~$1-$5 in quantity)– 4-layer board costs ~$50 each (~$3-$10 in quantity)

Page 23: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

23 © 2006 Grand Idea Studio, Inc.

PCB Design 5

Many production houses available online– e-Teknet, www.e-teknet.com– Advanced Circuits, www.4pcb.com– Sierra Proto Express, www.sierraprotoexpress.com– AP Circuits, www.apcircuits.com– Express PCB, www.expresspcb.com

e-Teknet fabricated and assembled the prototype and production DEFCON badges

– Check them out in the exhibitor area…– (No, I didn’t get paid to put this in here!)

Page 24: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

24 © 2006 Grand Idea Studio, Inc.

PCB Design 6Design tools…

– Many professional tools available, some upwards of $5k-$10k

o Ex.: Altium/Protel DXP, www.altium.como Ex.: McCAD EDS, www.mccad.com, 200 pin limit for free

– Some fully-free software availableo Ex.: gEDA, http://geda.seul.org, complete open-source

PCB, schematic capture, and simulation for Unix platformso Ex.: Protel EasyTrax, www.protel.com/downloads/files/ easytrax.zip, DOS freeware version, complete PCB layout package with output support for printers and Gerber

o Ex.: Express PCB offers a free captive design tool for use with their own manufacturing

Page 25: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

25 © 2006 Grand Idea Studio, Inc.

PCB Design 7High-level process:1. Create schematic2. Output Netlist3. Import Netlist into PCB design software4. Create PCB5. Output Gerber plots6. Submit Gerber plots to PCB fab house

Page 26: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

26 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Process1. Verify desired size of badge & artistic elements2. Create mechanical outline of board3. Add logos to top side copper4. Place components in desired locations5. Import Netlist (based on final schematic)6. Route board (keep all traces on bottom side)7. Add logos to bottom side silkscreen8. Run verification tests9. Output Gerber plots

Page 27: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

27 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Verifying Sizes

Page 28: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

28 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Mechanical Layer

Page 29: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

29 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Top Layer

Page 30: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

30 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Bottom Layer

Page 31: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

31 © 2006 Grand Idea Studio, Inc.

Badge PCB Design: Mock-up

Page 32: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

32 © 2006 Grand Idea Studio, Inc.

Prototype TestingBefore placing large order of PCBs, need to verify that the design functions as expectedOrdered a few bare prototype PCBs from e-Teknet

– Had careful discussions with them to ensure that our complicated cutout areas and features were conveyed properly to their Chinese factory

– I’m sure they’re sick of me by now! ☺Hand-assembled some boardsSent to The Dark Tangent and Ping for final sign-off

Page 33: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

33 © 2006 Grand Idea Studio, Inc.

Prototype Testing:Current Measurements

Page 34: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

34 © 2006 Grand Idea Studio, Inc.

Prototype Testing:Current Measurements 2

Page 35: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

35 © 2006 Grand Idea Studio, Inc.

Joe says “A-OK!”

Page 36: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

36 © 2006 Grand Idea Studio, Inc.

Parts SourcingEnded up being the most difficult/time consuming part of the processOn strict deadline to obtain parts for 6,055 units and ship to e-Teknet to begin assembly

– No parts == No badges for DEFCON! Placed all quantity orders with Future ElectronicsSince Future (and most large distributors) has minimums and multiple requirements, ordered remaining pieces from Digi-Key & MouserUsed Digi-Key to purchase and program code into PIC10F202s

Page 37: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

37 © 2006 Grand Idea Studio, Inc.

Parts Sourcing 2Issues w/ Future:

– Misquoted leadtimeso “They’ll be here in 3 weeks” – parts arrive after 6

– “Lost” partso Only 500 LEDs were shipped – sales couldn’t find the other

11,700!?– Slow shipping

o What part of “I need these parts tomorrow” do you not understand?

After much pressure, I was “upgraded” to a more competent sales contactAll problems were finally resolved!

Page 38: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

38 © 2006 Grand Idea Studio, Inc.

Parts Sourcing 3

Page 39: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

39 © 2006 Grand Idea Studio, Inc.

Quantity OrderPlaced 6,055 unit order with e-TeknetWhile components were being acquired, they helped us decide on the seven soldermaskcolors and began PCB fabricationSent them BOM, Parts Placement, and Test Procedure to aid in assemblyTested and approved First ArticlesPulled the trigger on the full quantity build!

Page 40: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

40 © 2006 Grand Idea Studio, Inc.

Quantity Order: Color Samples

Page 41: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

41 © 2006 Grand Idea Studio, Inc.

Quantity Order: Final Colors

Page 42: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

42 © 2006 Grand Idea Studio, Inc.

Parts Placement

Page 43: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

43 © 2006 Grand Idea Studio, Inc.

Parts Placement 2

Page 44: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

44 © 2006 Grand Idea Studio, Inc.

Test Procedure

Page 45: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

45 © 2006 Grand Idea Studio, Inc.

Test Procedure 2

Page 46: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

46 © 2006 Grand Idea Studio, Inc.

Test Procedure 3

Page 47: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

47 © 2006 Grand Idea Studio, Inc.

Test Procedure 4

Page 48: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

48 © 2006 Grand Idea Studio, Inc.

Test Procedure 5

Page 49: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

49 © 2006 Grand Idea Studio, Inc.

First Article Approval: Front

Page 50: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

50 © 2006 Grand Idea Studio, Inc.

First Article Approval: Back

Page 51: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

51 © 2006 Grand Idea Studio, Inc.

DEFCON Badge Hacking Contest

What can you do with two LEDs, a switch, some discretes, and a Microchip PIC10F202?The most obscure, obscene, or mischievous badge hack will be recognized and awarded at the DEFCON Award Ceremonies on SundayMicrochip development tools are available at the show for your useFind me later if you want to check out what I’ve done to mine ☺

Page 52: grand making the defcon badge DC14 · 2009. 11. 1. · zWe had to keep actual session title a secret until the badge was released zWe’ll look at the entire development process of

Thanks for Coming!

Joe Grand (Kingpin) [email protected]