start	end	text
0	3760	I haven't spoken at DEF CON in quite a while, so I'm kind of excited to be here.
3760	7240	I'm glad that we're in this room and not one of those other big ones.
8160	9940	How many of you have made badges before?
10900	13460	How many of you have used badges before?
13700	15200	How many of you like badges?
15340	17180	How many of you like badges that work?
17500	19060	How many of you have badges that work?
19500	21760	How many of you have badges that don't work?
21760	23900	Not necessarily this conference, but have you ever been at a conference and you get
24000	25060	a badge and it doesn't work?
25440	26480	Yeah, me too.
27340	29620	How many of you didn't even bother turning it on because you weren't sure it was going
29620	30380	to work anyway?
31840	38140	So the point of this talk is because I have made a few badges and I have a habit of reusing
38140	42900	as much as absolutely possible because the chief virtue of an engineer is laziness, right?
43140	47140	So if I'm going to put the effort into making a badge that I can reuse, I want to make sure
47140	49460	other people know that it's available and they can do that too.
49620	53940	I know there's tons of badges, but like, and many of them are open hardware, open source.
54240	57580	And rather than, of course, you know, just taking an existing open source one, I figured
57580	59700	why not do another open source one?
59960	62380	Because, you know, so that's how it goes.
62400	66820	So I'm going to tell you about an open hardware badge design that I've worked on and that
66820	71280	I think will be useful because it's been tested, been through two conferences already.
71280	73300	It's going to be on track for a third one.
73520	77280	And I want it to be open hardware so that anybody who wants to make a badge doesn't
77280	78220	have to start from scratch.
78220	82400	You can just take this open hardware, change it how you want, however you want to do.
82440	83680	Just change the artwork.
83680	84640	You can change software.
84640	86080	You could keep it exactly the same.
86080	87760	Just like change the conference name.
88140	89080	And you've got a badge.
90060	93680	So a little bit about badges, or me, I'm Joe, hi.
94480	96800	I teach classes on hardware hacking and reverse engineering.
96800	100360	I've been in Las Vegas for a week already because I was doing training at Black Hat.
100400	101560	So I'm a little bit exhausted.
101740	104780	But after this, I'm going to go hang around the pool, which is what I've been looking
104780	106080	forward to for the past week.
107680	109440	Yeah, I do hardware stuff.
112240	115660	So let's talk about, this is what I'm going to talk about today, why we have badges, what
115660	120080	this thing is that I'm talking about, what my vision for it is, what we can do today,
120080	122240	and some logistics and pitfalls.
123240	127740	And it started out as kind of like a workshop-y thing, but the space and the venue worked
127740	130800	better for us to do kind of more of a talk slash demo.
131280	134500	So I'm going to talk a bit, and then I'm going to show you some software and hardware.
134800	136900	And then we'll have some time for questions.
136900	137560	Sound good?
137720	138840	Any questions?
139120	139920	Everybody ready?
140220	141420	Okay, listen carefully.
142640	143740	What are badges?
144240	145240	Why do we have badges?
145240	146240	Well, it's pretty much access.
146480	150020	Whether it's a wristband or a badge or something that hangs around your neck or something you
150020	153060	tattoo on your forehead, we need a way to know who's supposed to be here, who's not,
153060	155700	who paid, who didn't, who gets free drinks, and who doesn't.
156220	157740	So we're going to have them anyway.
157740	159320	We might as well make use of them.
159640	161520	So we want the cool factor.
161920	163700	This is a handful of badges that I designed.
163700	166520	My first one over here was for B-Sides Portland ten years ago.
167160	172680	It was a bus pirate, but the PCB shape was changed, so it was the shape of a Nyan cat.
172680	177720	So the rainbow ribbon cables that come out of the bus pirate were like the trail of rainbow
177720	178740	behind it.
179440	186320	And a couple of these were B-Sides Portland, some 503 Party badges, 44Con in London, TRCon,
186320	190460	which has kind of evolved into the Dan Initiative now.
191380	192980	So yeah, they look cool.
192980	194480	And you want them to look cool.
194480	198340	And as a conference organizer, you want people to say, oh, this is a cool badge, take pictures
198340	202180	of it, post it on social media, say, I can't wait until I come back next year.
202180	204880	Conference organizers get more people coming and yada, yada, yada.
206800	208200	Why else do we want badges?
208200	211740	Electronic badges hopefully have some sort of interaction.
211820	215780	And you can do interaction with a paper badge, but electronic badges are a little bit cooler.
219780	227380	So this is a few years ago, Joe Grand's previous DEF CON badge, magic tokens, they had a piece
227380	228620	of stone on the front.
228620	234180	And he used a type of NFC, not like standard NFC, but like a near field communication,
234180	236620	inductive communication method, which is pretty cool.
236860	240720	But what happens, people go around, they go up to people they don't know, they interact
240720	242480	with the badge, they meet people.
242740	245840	That's kind of like the best part about an electronic badge.
247160	251540	And also, like hopefully there's a lot, how many of you have ever designed a PCB before?
251880	256840	How many of you have ever written embedded microcontroller code before, right?
256840	259980	How many of you have hacked on a badge, an electronic badge?
259980	263580	So hopefully the badge is an opportunity for you to get your hands on some hardware that
263580	264980	you might not have otherwise done.
265100	271040	So this one required a somewhat pricey programmer, but like once you had that, you could do whatever
271040	271380	you want.
271380	274640	There was also a serial port that you could interact with it, but like getting people
274640	278420	to interact with tools and learn something is kind of a great goal.
279620	281440	So why OpenTaxus?
281640	284440	So anybody know what a badger is?
284440	287720	The American badger, Taxidea Taxus.
287820	291100	So this is the open badge, open badger, OpenTaxus.
291680	297220	Not tax is like, you know, things you pay, not tax as the big state, but like taxes.
298200	302080	And at some point I'm going to have a cool logo and it's going to be like a badger with
302160	307100	a badge on that says OpenTaxus, but you can just visualize that right now.
307520	311480	Or you know, go ask Dolly to make that during the talk and we can post it up there.
311480	312700	You can do a pull request.
313180	314880	So it's open, right?
315020	317880	This is the URL right now, OpenTaxus.
317880	322720	And that is kind of like the sanitized, cleaned up version that has like all the strings for
322720	325860	specific events and all the logos and stuff removed.
325860	330060	So you can go and like copy this and make it and not have to worry about like infringing
330060	333680	on anyone's artwork, copyright, or all these detailed crappy things.
334960	340220	So yeah, I'll put this URL up later, but I think it's the only thing on GitHub called
340220	341600	OpenTaxus right now.
342800	344420	So it's custom, right?
345160	349400	Off the shelf is kind of cool, like if you have something interesting, but there's really not a
349400	350640	lot of off the shelf options.
350640	357660	And one cool one we did a few years ago for besides, for 503, DC503's badge was we had
357660	358340	these little devices.
358340	360780	They were like this big.
360780	365400	They were smart response things, so they're made for classrooms where you like you answer
365400	367100	questions, the teacher pops up on the screen.
367100	367920	But we took them.
367920	371100	We've reflashed the firmware with a couple games and use that as a badge.
371100	372540	So we didn't design hardware.
372540	375820	We just took pre-made hardware and programmed it, which is kind of cool.
376620	377640	But this is the process.
377640	380040	I mean, we go through prototyping phases.
380040	383460	We, you know, have an actual badge and then like we have a second iteration.
383460	386480	This is besides San Francisco's badge, which is essentially the same hardware.
387460	392540	But, you know, like two conferences, two badges, somewhat similar, but it's okay because
392540	394460	there's a lot of conferences and there's a lot of badges.
396040	398800	So open, custom, and we also want it to be cheap.
399980	404680	My objective is that, like, there's a lot of change in the microcontroller world lately.
404680	410240	This uses the RP2040, which is the predecessor to the fancy chip that's on a Defcon badge.
410380	412060	It's amazing because it's dirt cheap.
412060	417360	In quantity, it's like 60 cents, and that includes, like, USB interface.
417360	421420	So, like, there's a lot of extra chips you need sometimes to interface with the badge
421420	423420	easily, and this doesn't need them.
423420	425040	So it is extra cheap.
425920	429000	Something else I've learned is when you get stuff assembled overseas, you know, if you
429000	433200	go to a manufacturer that, like, does a lot of it, you know, if you wanted to assemble
433200	435220	100 badges, you need 100 chips.
435220	437580	You buy those chips, you get the 100-chip price.
437820	442140	If you go and get them assembled and you get 100 badges assembled, they get the chips at
442140	448560	the 1,000 or 10,000 or real price, right, real R-E-E-L, which is also the R-E-A-L price
448560	450720	that, you know, manufacturers get to pay.
450720	455460	And so I've actually found that, like, for prototyping, it's cheaper for me to get a
455460	460440	prototype assembled than it is for me to get the PCBs and buy the parts and assemble it
460440	464880	myself, which is kind of a weird world we're in.
464880	467100	So, yeah, right now, this is the last iteration.
467100	475800	These were $5.70 each plus some engineering costs, which I think is pretty cool.
475800	479280	$6 for a hardware badge that interacts is kind of a nice target.
479280	480140	I was aiming for $5.
480140	484180	Actually, I started aiming for $10, and then I went and did some cost reduction and managed
484180	487480	to swap out some cheaper components and got it down to almost $5.
487480	489360	So long run, $5 is the goal.
489600	492500	Oops, cancel, cancel.
494380	496500	Apologies for the AV situation.
496500	498120	It's a little bit interesting.
498460	500900	So I want to encourage interaction.
500900	503160	So a badge has to have a way to communicate.
503760	506380	However, we're hackers, we're privacy-minded people.
506380	508800	We don't want these things broadcasting all the time, right?
508800	511880	So what I opted for was infrared communication.
511880	516420	What I like about infrared is that you can make it pretty short range, right?
516420	520420	You can have it only work when you need it to work, and you can, like, you know,
520420	522220	not use it if you don't want to.
522300	529740	So this device has a little IR LED, right, right here, and an IR receiver right here.
529740	533620	So when you line badges up, they, like, kind of flash lights at each other.
535240	539760	And yeah, bill of material costs for the communication on this badge, $0.08.
541140	546940	So compare that to, like, an antenna, which is going to be more than $0.08, or yeah, anything else.
547000	551420	So I thought that was kind of awesome that I was able to get it that cheap.
551820	554120	Braden Lane, he has done, like, e-challenge coins.
554120	559060	He actually designed this IR circuit, and I asked him for a schematic and parts,
559060	560340	and he shared it with me.
560340	564760	So, you know, I appreciate his contribution to this, because, like, yeah, he was in the same boat.
564760	566900	He wanted IR communications, but he wanted it to be cheap.
567660	571260	I literally just got my DEF CON badge, like, an hour ago.
571280	576040	So I haven't poked at this infrared communication, so I don't know what it is, whether it's modulated.
576060	578240	But what this does is it basically speaks, it's a UART connection.
578240	579120	You know what UART is?
579140	580220	Serial connection.
580540	583920	And, like, nothing fancy, just spit that UART over an LED, and it goes up and down,
583920	586100	none of the modulation, no extra transceivers.
586240	588200	And in the other end, you just have to do a little bit of cleanup.
588200	590240	Downside, it's wicked slow.
590520	592200	Upside, it's dirt cheap.
592400	593280	Tradeoffs.
595520	597700	So I want to encourage learning.
598040	604580	And the original idea for this badge came from B-Love, Brandon Levine,
604580	608540	and he wanted to do something in CircuitPython, because he was not an embedded programmer,
608540	609560	but he knew Python.
609560	612860	I had never used CircuitPython before, and so I was introduced.
612860	615920	At first, I was like, yeah, that's a little high overhead for an embedded system.
615920	619160	We're going to do, like, C, and we're going to maybe do some hand-coded assembly.
619380	621740	But that's because I started doing microcontrollers 20 years ago,
621740	623000	when that's the way to do it.
624260	627720	25, 30 years ago, when, you know, you had to pay for a compiler.
628200	632900	And then, you know, I kind of did work for a while, and then when I left work,
632900	635760	it's like, oh, I can play electronics for fun, and Arduino happens, right?
635760	638600	So now we could plug things in with a USB cable, download one thing,
638600	641060	get our compiler and all our tools, and that was great.
641060	644760	But now, CircuitPython, you don't need a compiler, you don't need anything,
644760	648720	you just plug in a USB cable, you have a USB flash drive that shows up,
648720	653920	and there's a code.py file, and you edit it, and it runs, right?
653920	658560	So your IDE is whatever text editor you want, and, yeah,
658560	660280	you don't have to download or install anything.
660280	661860	I think it's amazing and wonderful.
662200	665540	It does have tradeoffs, but, like, objective here is something accessible,
665540	666960	something that gets people playing with stuff.
666960	668340	How many of you know Python?
668880	672300	How many of you can hack your way through and, like, edit something in Python,
672300	674560	even if you don't call yourself someone who knows Python?
674720	678460	Well, how many of you have used CircuitPython or MacroPython on an embedded device?
678600	680000	Okay, give it a try.
680000	684740	I actually, so I've only got, like, 80 of these with me, but I'll give them out afterwards.
684740	688600	And so if you feel like you want to either tinker with this or think you might have interest
688600	691420	in contributing anything to this project, I've got them for you.
691420	694720	If you just want something to, like, hang on your neck, then, like,
694720	698300	let people who want to work on them first get them first, and then we'll have the rest available.
698300	698940	Sound good?
701000	703060	So, easy.
703380	704780	Badges are not easy.
704780	706080	Hardware is not easy.
706080	709160	It's not called easy-ware, okay?
709160	710880	So, it's hard.
710880	712200	It's going to be difficult.
712200	714260	You need to go through multiple revisions.
714440	716300	And, yeah, so you should do that.
716560	720280	So, here is, so, actually, the background story for this one.
720280	722180	This is the LabsCon 2023.
722180	725600	LabsCon is a threat intelligence conference down in Phoenix.
725600	726920	It's pretty cool.
726960	728700	It's very unique and niche.
729880	737280	But, I got home from DEF CON at, like, August 16th or 15th or something.
737280	738440	I don't know when it was.
738440	740440	And it's like, okay, we've got five weeks.
741020	742060	We can do this.
742820	744280	And we did, right?
744300	748080	So, we've got the cardboard mock-up to kind of, like, figure out what we're going to do.
748080	750360	We've got the little PCB mock-up.
750360	752760	This is the IR communication circuit that I prototyped.
752760	756080	I'm like, okay, I know I can get a RP2040 working.
756080	757740	I can get an IR communication working.
757740	761340	I did a PCB layout and I milled a sample one.
761340	763660	I didn't actually mill a functional prototype.
763660	766860	I just kind of used it to make sure I got the sizes and placement right.
767420	772960	And then a quick turn prototyping from, I believe, this one was JLCPCB.
773120	775860	So, for, I think these were, like, under 10 bucks each.
776340	778520	I ordered them on Monday.
778520	780340	No, Sunday night, so Monday in China.
780340	781820	I received them Friday.
781920	783460	I was kind of, like, amazed.
783880	787200	Of course, during that time, I did, like, you know, like, little updating tweaks here and there.
787200	788180	I added some artwork.
789020	789580	But, yeah.
789920	792820	And, of course, you see, you will make mistakes.
792820	796440	So, like you see here, I've got that little blue wire that happens to be black.
796780	797640	Because, oops.
799180	800680	And DRC is your friend.
801700	802560	Unless you're lazy.
802560	803160	Then you skip it.
803160	803720	But, whatever.
803960	808540	And, actually, you can see up here, I had a pinout wrong for what I was using at the time, which was an IR transceiver.
809740	811500	And, yeah.
811960	814900	So, I had to add that, change it a little bit.
814900	815900	Screen goes on top.
815900	817720	I like it because it hides all the components.
818740	820500	And that was the prototype.
820500	821140	And it worked.
821140	821900	Which was kind of amazing.
821900	823560	Just one blue wire and one component.
823560	824880	So, we cleaned up that component.
825700	826860	Got the PCBs made.
826860	830860	So, what I did at the same time is I did the bulk order from JLCPCB.
831420	834280	As well as, like, a small batch order.
834500	838120	So, what happened is I got the small batch prototypes a week later.
838420	839120	You know, I ordered.
839140	840380	So, I received Friday.
840380	841560	Spent all weekend working on it.
841560	845740	Monday, ordered the second batch of prototypes.
845740	848800	Thinking they're going to be perfect and just work.
849300	850840	And those came the following Friday.
850840	852080	Which, again, is amazing.
852960	854180	And in the meantime,
854940	856320	finalized all the artwork and everything
856320	858440	for the actual, like, production run.
858600	860440	I did make a couple other tiny tweaks.
860680	863020	Turned out we got the production run in.
863060	864800	Took them two weeks.
864800	867280	Was kind of incredible for a few hundred badges.
867600	868820	And they shipped.
868820	870420	And, actually, we had room for
870960	873520	a week of customs holdup on these badges.
873640	874560	Because I was
874560	877320	renovating my house, so we were living somewhere else.
877360	878480	So, apparently,
878480	880480	it was a unique address that
880480	883000	I don't know, maybe customs just let stuff go to my home
883000	885080	address and thought that this was a different
885080	886820	address, so it's not Joe. I don't know.
887540	888940	That, or they put too high a price
888940	890320	on the invoice.
890980	892680	So, but that's the badge we got.
892680	894820	I did have to manually solder on the battery
894820	896820	holders and the screens. That was a time constraint
896820	898340	issue. I really
898940	900860	am frustrated by screens. It's very difficult
900860	902460	to get screens that are
902460	904880	quality and reliable and consistent.
905000	906860	So I use modules, right? You can get
906860	908740	the modules cheaper than you can get the bare LCD
908740	910920	OLED displays. So I might
910920	913040	as well just use those, right?
913080	914700	And the second
914700	916360	iteration, so we went from
917120	918820	this prototype for what was
918820	920660	LabsCon, and then B-Side
920660	922800	San Francisco was looking for a badge. And I
922800	924760	had a conversation which roped
924760	926520	me into another project. And
926520	928800	so, basically, the only change in
928800	931240	the circuit had to do with the IR circuit.
931240	932640	I took off that transceiver
933160	935020	that was up here. That was an IRDA
935020	937400	transceiver. It was a
937840	939680	$3 part. It was there
939680	942180	because I had it and tested it and it worked.
942180	943700	And that's when I changed it to these
943700	947160	$0.08 of components, which were great.
947160	948080	So, yeah.
948080	951440	The prototype was pretty quick. The production
951440	951780	badges took
951780	954180	a little longer than expected. I used a contract
954180	956420	manufacturer that I use regularly for
956420	958300	Tigard. Shameless plug, Tigard is
958300	959220	a little orange PCB that does JTAG, UART, and
959220	961140	SPI. And I make it and use it for my
961140	963140	classes. But, apparently, other people
963140	964980	like it, too. So, you can get it on a crowd
964980	965580	supply.
967380	968960	So, I had that manufacturer do it because I've
968960	970960	worked with them in the past and they will do
970960	971940	stuff like custom
973020	974900	solder mask color. And what they did
974900	977060	for this badge... Oops. Do I not have
977180	978660	a picture of it? Oh, no.
978820	981660	So, what they did for us for the
982040	982920	B-Side San Francisco
982920	984520	badges, we had two different
985800	987240	colors of silkscreen.
987620	989460	So, they lined up perfectly.
989580	991140	Actually, I want to do something
991140	993420	silly. I'm going to modify
993420	995540	my presentation on the fly.
995660	997640	I'm going to take a picture.
1001390	1003090	You don't see this on the screen yet, but...
1006950	1008030	There we go.
1011110	1012090	Can you see it?
1013330	1015130	How come you can't see it? It's right there on the screen.
1015130	1016530	Maybe I have to go back and forth.
1017310	1018230	No?
1019210	1020690	I see it right here on my
1020690	1022790	slides. Oh.
1023210	1025190	I'm very confused right now.
1032070	1033570	I hope that you've been seeing the
1033570	1035750	same thing as me all along because I'm
1035750	1037490	literally looking at my slides right now and it's different
1041970	1042430	from...
1042430	1043470	Sorry.
1045830	1047370	Oh, well.
1048050	1049970	This badge is cool because it's got
1049970	1051630	two different colors of silkscreen.
1051690	1054310	It's like a cream, kind of off-white, grayish
1054870	1055910	solder mask.
1055910	1057710	And then a red and a black silkscreen.
1058610	1059670	We'll talk about it in a second.
1059670	1062150	The reason you pay for a contract manufacturer instead of a quick turn
1062150	1064030	place is they'll do things
1064030	1066030	like make sure those colors line up perfectly.
1066030	1067590	And they did an amazing job.
1067590	1069010	It was better than I expected.
1069230	1071790	We have to realize that PCBs are precision things.
1071990	1074150	There is some effort to make things precise.
1075330	1076050	Silkscreen is
1076050	1078230	kind of like the last thing and it's usually only documentation.
1078230	1079690	It's not functional.
1079870	1081890	There's some more slop in the silkscreen
1081890	1083990	than there is in the solder mask
1083990	1085230	and metal layers.
1085830	1088110	Anyway, afterwards you can come up
1088110	1089490	and see some of these badges.
1089490	1090630	There's a bunch here.
1090630	1093050	You can ogle the artwork.
1093790	1095190	So what's my vision?
1095210	1098030	I mentioned before I don't like doing this over again.
1098330	1100010	And people are frequently asking me
1100010	1101830	for badges and others. And rather than
1101830	1104070	have to be involved
1104070	1105930	in the loop, it'd be really cool
1105930	1107510	if I had a website. You go to the website
1107510	1109350	and you type in your conference name.
1109730	1111130	You upload the logo for the
1112530	1113410	conference.
1114790	1116070	And you click go.
1116070	1118050	You get your board files, your bill of materials,
1118050	1120370	your code, everything ready to go.
1120370	1121390	Does that sound cool?
1122250	1123450	So what you can do then
1123450	1125630	is instead of having to start from scratch
1125630	1127310	and go through three iterations of prototypes
1127310	1129390	and test everything and find the right components,
1129390	1131210	you start with something that works.
1131490	1133010	And change what you want to.
1133010	1135430	If you want to do board changes
1135430	1137290	and layout changes or add components,
1137290	1138950	you do that. But you start with a board file
1138950	1140210	that's functional and works.
1141050	1142950	You want to make just artwork changes,
1142950	1145110	you can do that. But you've already got a board that works.
1145130	1146690	If you want to keep the hardware exactly the same
1146690	1148630	and change the game that it plays or whatever,
1148630	1150750	how it interacts, you can do that.
1150990	1152550	And that's actually what, besides Portland's going to
1152550	1154650	likely use the same hardware, but they're going to have a completely
1154650	1156030	different game that it plays.
1156270	1158910	So customize what you want to do
1158910	1160690	and keep what you want to keep.
1160690	1162610	Make sense? Again, chief virtue
1162610	1164690	of an engineer is laziness.
1164890	1166610	So be as lazy as
1166610	1168810	you think is appropriate and you'll be able to
1168810	1171310	spend your time doing the things you want to do.
1171310	1171970	So how many of you
1172610	1174290	like PCB design?
1174990	1177110	How many of you like embedded software?
1177610	1178590	So you can go
1178590	1180750	meet up with each other and work together
1180750	1183130	or do one or the other. Make sense?
1183710	1184370	Cool.
1184650	1186670	So what can we do today? Because of the AV
1186670	1188830	stuff, I'm going to finish my slides
1188830	1190670	first and then I'll flip over to my laptop
1190670	1193150	and do some walkthrough demo-y stuff.
1193210	1194750	I'm not going to build a badge from scratch because
1194750	1196790	it's not there yet, but maybe someone will
1196790	1198590	submit a pull request and we can do that.
1199930	1200870	So what can we do
1200870	1202770	today? If you are a hardware person,
1202770	1204870	you can just change the logo. That's easy.
1204950	1206570	You can adjust the board footprint.
1206890	1208790	I find the cutout shape of the
1208790	1210730	board is really a neat thing to customize
1210970	1212790	a badge because it looks neat.
1213930	1214750	You can rearrange
1214750	1216690	the layout. As it is right now, it's kind of
1216690	1218150	ergonomically designed.
1218230	1220230	I happen to be left-handed,
1220230	1222690	but I wanted righties to be okay with it too
1222690	1224630	so I put the button in the middle so all you people
1224630	1225750	can use it.
1226830	1228750	And also it hangs down
1228750	1230690	so you see the logo and if you want
1230690	1232710	to use it... okay.
1233110	1234690	I still have power.
1235050	1236250	I'm going to keep talking.
1236910	1238610	You grab it and you point it at
1238610	1240510	someone else and you trade.
1242350	1242750	Ergonomically
1242750	1244530	they hold each other edge-to-edge.
1245110	1246690	Just making sure the screen is still on.
1246690	1249170	You hold them edge-to-edge and they communicate.
1249530	1250650	One of the flaws of the
1250650	1252470	current design is I need to
1252470	1254510	tune the IR transmission a little more because you
1254510	1256370	literally have to hold them together like that
1256370	1257990	for them to communicate. Maybe like
1258670	1260570	a half an inch, but if they're more like an inch or more
1260570	1262650	they don't work. Which is kind of good
1262650	1264670	because then you're not transmitting and receiving noise
1264670	1266310	and other people's stuff and whatever.
1266630	1268390	Also by using a module, the module kind of
1268390	1270330	shades the IR stuff so even
1270330	1272590	if there happen to be lights,
1272590	1274170	something crazy like that,
1274170	1276610	you don't have some interference from that.
1277130	1278550	Cool. If anybody's got
1278550	1280590	any questions as I ramble on, please, yeah,
1280590	1281470	what's up?
1283490	1284530	Maybe we'll do that
1284530	1286570	later. Sorry. Unless there's another
1286570	1289050	mic. Nah. Okay. Sorry.
1289650	1290690	I'll repeat your question
1290690	1292290	if I could hear it, but I hear that more.
1292290	1294690	I don't think he's asking any questions about boards.
1295010	1296370	So what can we do? Change the logo,
1296370	1298710	adjust the footprint. We can re-arrange
1298710	1300430	the layout. So if we wanted to
1300430	1302330	have it wider or different
1302330	1304290	layout or if you really wanted to change the
1304290	1306610	infrared to something else, you totally could do that.
1306750	1308510	And you can hack it to pieces. The way I did
1308510	1310530	the layout, I'll show you when I look through a key cad,
1310530	1312730	is I have a bundle that's the microcontroller, I have a
1312730	1314750	bundle that's the power circuit, I have
1314750	1317150	a bundle that's the, what's it called?
1317150	1319390	Infrared circuits. So you can drag those
1319390	1321250	blocks around and route those blocks together
1321250	1323230	or you can drag every single little
1323230	1325710	resistor and component together.
1325710	1327790	So, if you're a software person,
1327790	1328530	you could change strings,
1328530	1330350	you take the badge, instead of being open
1330350	1331330	to access, you call it
1332390	1332750	besides
1334910	1336470	Gallifrey or something like that.
1336650	1338510	And you can change the game text.
1338510	1339690	Right now the game it plays,
1339690	1341210	ever played Clue?
1342230	1344470	So in Clue you have a deck of
1346110	1346830	suspects,
1346830	1348130	weapons, and locations.
1348370	1350390	And you shuffle them, you draw one of each
1350390	1351950	and you put them in an envelope to the side.
1351950	1353830	And then you deal the rest out to everyone.
1353830	1356230	In the process of the game, you're trying to figure out what
1356230	1357910	everybody else has so you know what's missing.
1358330	1360150	Same thing, what it does right now is it deals
1360550	1362090	one clue to each person.
1362650	1364130	And you can
1364130	1366210	trade those around, you meet people, it trades the handle
1366210	1368050	that you put into the badge as well as
1368050	1369930	your clue. And when you get them all
1369930	1371750	but one, you know the solution.
1372250	1373790	Right now it's set up for eight games, but
1374230	1375910	we won't go into the details of that.
1376210	1377870	Besides, Portland's going to do a slightly different
1378610	1379610	game as well.
1380230	1381990	You can change all the game text.
1382130	1384210	Right now, besides San Francisco, the AI
1384210	1385690	theme they used, so it was a bunch of
1386950	1388330	AI, it was a bunch
1388330	1388590	of
1391190	1392070	doomsday scenarios
1392070	1393890	and it was a bunch of fixes, so you
1393890	1395610	randomly put those together like
1396110	1397390	T-800 saved
1398570	1400250	something from Whopper or some weird
1400250	1401250	thing like that.
1403110	1404470	So, badge logistics.
1404770	1406630	This can be very interesting, right?
1407010	1408310	Did I miss a slide there?
1408670	1410150	No, I think I got it.
1411750	1412630	Sorry.
1412630	1414290	So, who
1414290	1416250	likes hand soldering?
1416390	1418490	Who likes hand soldering
1419330	1420250	a hundred badges?
1420290	1422770	Who likes hand soldering a thousand
1422770	1423810	badges?
1424270	1426410	When I
1426410	1428550	solder, I design around
1428550	1430370	0603 surface mount components
1430370	1433470	because I used to be able to see them and do it by hand.
1434030	1434810	I can't
1434810	1436470	anymore because I'm old.
1437530	1438730	So I use a microscope
1438730	1440390	and I can still do them by hand.
1440390	1442170	But if you're going to do something
1442170	1444250	this is designed for mass manufacturing.
1444250	1445950	This is not designed for hand soldering.
1445950	1448610	So I use 0402 components, the really tiny ones.
1448790	1450270	Which means I can fit them all
1450270	1452270	on there easily and they're small
1452270	1454450	and 0402 is a
1454450	1456350	pretty reliable size. It gets smaller than that
1456350	1459450	and sometimes you get a higher failure rate.
1459450	1460390	So if you're going to hand solder
1461590	1462330	what I often do
1462330	1464610	is I actually will get the
1464610	1466750	prototypes with all the small components
1466750	1468090	assembled, right? And then I get
1468090	1470310	those prototypes and I solder on the big stuff.
1470890	1472230	For example, if I'm like trying to
1472770	1474130	fine tune which microcontroller
1474130	1476630	or I get parts locally that I want to use.
1477430	1478550	Next is small batch.
1478550	1480890	This is like JLCPCB, PCBWay
1481350	1482230	and others.
1482670	1484010	Macrofab in the United States.
1484210	1486190	You just give them your design and tell them a little
1486190	1487910	bit about the parts and they'll
1487910	1490070	make the PCBs, assemble them for you and ship them
1490070	1492490	to you. Which is pretty cool.
1492850	1493770	And like I said before,
1493770	1495870	sometimes it's cheaper for me to do that
1495870	1498230	than it is for me to just buy boards and buy parts
1498730	1499750	and waste my time
1499750	1501210	assembling them.
1502370	1504310	And then last is contract manufacturing.
1504310	1505270	This is, you know, basically
1506510	1507790	there's a weakening line between
1507790	1509910	the small batch stuff and the contract manufacturing because
1510390	1511770	a lot of the same companies do the same thing
1511770	1513810	or outsource it to each other. Again, I have
1513970	1515750	a contract manufacturer I've used for Tigard
1515750	1518210	and also BitMagic's the logic analyzer.
1518230	1519010	If you've heard of like
1519910	1521670	NETV or the FOMU, like mini
1521670	1524250	FPGA, those were all done by the same folks.
1524250	1526210	The reason why I chose them is because they'll do
1526750	1528710	custom solder mask colors for me.
1528750	1529630	Yay!
1530930	1532210	But yeah, once you're
1532210	1534150	hitting a threshold of more than 100
1534150	1536210	you probably want to consider this. It will
1536210	1538330	take you longer, it will cost more
1538330	1540190	but it's more likely to get it right the first
1540190	1542350	time which is really what you want to do.
1543370	1544250	100 badges
1544250	1546290	in a contract manufacturer with one mistake is
1546290	1548310	100 badges you need to rework.
1549870	1550470	And finally,
1550470	1552170	flashing. Once we've got these badges
1552170	1554090	even if we didn't change anything
1554090	1555670	we still have to provision them.
1555990	1557450	I've got a flashing rig here
1557890	1559890	which basically you slot the badges in
1559890	1561690	it pops into a USB port
1562710	1563910	and they're all connected
1563910	1566070	to a 7 port USB hub and
1566070	1567890	I've got a couple scripts in there that will go through
1567890	1570150	wait for a device to be attached and flash
1570150	1572070	it. There was a small
1572070	1574250	bug in that though because what it does is it's a
1574250	1576470	Linux script and it goes, okay you've attached
1576470	1578390	a device, let's mount it. What's the
1578390	1580010	mount point? Okay, and now we want to
1580010	1581590	wipe it first. So rm
1585050	1586010	mount point
1586010	1587310	slash star
1588350	1590030	and then dash rf.
1590030	1592230	So you want to remove everything on that drive
1592230	1593870	and force it.
1594010	1595570	Which is great until mount point
1595570	1597850	for some reason doesn't exist. You pulled it out before
1597850	1599950	you got the mount point and so that string is blank.
1599950	1602170	So it's rm dash rf
1602170	1603890	rm slash star dash
1603890	1604970	rf.
1606090	1608550	You know what I'm saying. It was bad.
1608550	1610530	Luckily I was using a utility called
1610530	1612550	p mount which runs as a user as
1612550	1614510	opposed to having escalated privileges and running
1614510	1616470	it as root and mounting because that would have
1616470	1618330	been a much worse rm dash rf
1618330	1620570	slash star. For those of you who
1620570	1622370	are like more in the Windows world, that basically
1622370	1624370	slash star is your root directory and everything
1624370	1626450	on your system. So like it basically would hose
1626450	1627910	your system if you did that.
1628470	1630690	Yeah, that could have been a lot worse.
1630690	1632210	Luckily it was discovered and found and fixed
1632610	1634750	before we flashed all of our laptops
1634750	1636150	instead of the badges.
1638630	1640670	Flashing. We just talked about flashing.
1640890	1642490	So common pitfalls.
1642690	1644010	We got about halfway in
1644470	1646350	which means I have about half the time to go and
1646350	1648810	either look at questions or
1648810	1650990	walk through the designs.
1650990	1652570	Common pitfalls. I'm really
1652570	1655170	going to emphasize one. Schedule.
1655290	1656690	Give yourself more time
1656690	1658510	than you need. Once you've done that, give yourself even
1658510	1660470	more time. Add some buffer for
1660470	1662670	manufacturing issues. Add buffer for
1662670	1664470	an extra prototype run. Add buffer
1664470	1666570	for testing
1666570	1668610	and software and flashing and whatever.
1668930	1670730	You'll use them. You'll make good use
1670730	1672230	of them, but you'll use them.
1672830	1674330	Part of the idea here is
1674330	1676990	if you're starting with a known good badge,
1677390	1678830	you can go get those started
1678830	1680410	and get the badges manufactured
1680410	1682170	and work on the software in parallel.
1682450	1684750	Then you don't have to worry about getting your hardware,
1684750	1686290	testing it, making sure it works.
1686470	1689150	Just remove the steps you don't want to have to deal with.
1689690	1690250	Cool.
1691350	1692550	So, I'm going to go
1692550	1694650	back and for those of you who wanted
1694650	1696790	where did I put it? The URL.
1698410	1699050	Somewhere.
1699050	1700610	I put a URL. It's
1700610	1702690	GitHub. Forget it. I'm going to switch over
1702690	1704670	to my laptop now. I'll get
1704670	1706470	that set up. I have some hardware
1706470	1708350	design and code I can walk through.
1709230	1710670	If any of you have questions,
1710670	1712650	just come on up here and you can ask a question
1712650	1714250	and I'll repeat it and then answer it
1714250	1717030	as I do the walkthrough. Give me a moment and I'll swap up.
1743510	1746310	Cool.
1777590	1783330	Okay. I'm connected to this wire which goes straight to the TV. It was just where I was
1783330	1796790	on a second ago. First device. Ah, checking that. Looks good. 1080p.
1804410	1814850	Input 1, I'm outputting to it right now. It's on the internal Google TV right now.
1815590	1817290	It's showing a Google TV.
1837110	1844090	Well, that's not what I want to show you. We know the TV works. So, fingers crossed one more time.
1855010	1863070	More and more. Thank you for your patience.
1888310	1904840	Well, that's what I get for using Linux. So, I'm going to try something. If we can get this back up on the screen.
1908560	1917860	So, let's see. Nope. No, we're good. We're good. Okay. We're doing it live.
1922040	1925800	So, where am I? Can I get a volunteer?
1926860	1928760	Jake, come on up.
1935040	1937960	Do you want to just hold it and show my screen?
1938000	1938560	Just hold it?
1938560	1942600	Just hold it so we see the screen. Thanks. Everybody see that? I'll make it bigger.
1943080	1950080	So, there's the slides. First, let's look at... can you hear me good?
1951620	1955940	First, let's look at the B-side San Francisco badge so you can kind of see what's going on.
1956240	1959200	We've got a schematic. I'm not going to go into the details of the schematic.
1959200	1962140	We've got... can you see anything at all?
1962620	1968000	We've got the RP2040, right? We've got some flash. We've got some IO pins.
1968000	1971620	We've got our IR circuit that, you know, just kind of works.
1971660	1977040	And we've got a USB interface that works. USB-C, which is great because everything should be USB-C.
1978020	1984380	But, let's look also... so this is what the finished badge looked like.
1985500	1990300	So, this is just in black because that's what I usually do, but you see it...
1990700	1994400	Silk screen on the front, no components, makes it really easy to see, you know...
1994400	1997160	Can you look closer? Yeah, there we go.
1997380	2001380	Makes it easy to customize it because we don't have to worry about stuff.
2001380	2004320	There are a few holes, like through holes. That's where the battery connector is.
2004320	2006900	That's where the USB connector is. And that's where the string goes on.
2006900	2008940	But I try to keep them near the edge to make it a little better.
2010280	2014680	One thing B-Side San Francisco does is they use stickers to differentiate their badge types, which is kind of cool.
2014680	2020380	So, if you really just want to fab this badge as is and just make stickers for your conference, like, you can totally do that.
2020380	2023100	Like, you literally don't even need a logo when you go and order the boards.
2023420	2027000	But, what we've got here is the controller in the middle.
2027200	2034340	Up here, we've got the Raspberry Pi 2040, some flash, an I2C connector so you can, like, attach things to it.
2034380	2036480	And then, yeah, IR circuits.
2036480	2040660	So, let's look at the layout.
2040780	2042400	How many of you have used KiCad before?
2042440	2046060	How many of you have used any circuit board design software, CAD software?
2046560	2049580	So, basically, it's a whole bunch of layers, right?
2049580	2054140	And you make a schematic and then you make it into the layers of the board.
2054140	2056440	And you actually physically place stuff around.
2056520	2059420	I had mentioned before we have, oh, I de-grouped it.
2060840	2062560	I have most of the things in groups.
2063600	2066400	Here, we've got the IR, TX, and RX.
2066400	2072400	So, if you wanted to move that around, you can move this whole bundle at once instead of having to go and move every single component and lay it out.
2072520	2076560	And we'll flip the board over, view, flip board view.
2077160	2081540	Oops, and then we'll, oh boy, the resolution is just kind of making this wild.
2085820	2090400	Anyway, what we see here, footprint back, there we go.
2090400	2095500	So, that's the silkscreen. That's the layer that we would want to remove and replace.
2095500	2097800	If you wanted to see one example of what it looks like.
2097800	2103080	Of course, boards are kind of looking top-down, so it gets flipped and rotated a lot.
2103540	2105100	But, yeah, that's what you do.
2106140	2106940	Next.
2109440	2114860	Let's go over to, this is OpenTaxus straight out of the repository.
2114880	2117020	The question before was what the URL is.
2118220	2120740	GitHub slash securely fits slash OpenTaxus.
2120740	2123860	But if you just search GitHub for OpenTaxus, you should get it.
2123860	2125040	T-A-X-U-S.
2125800	2127100	What's the difference here?
2127400	2130020	There's none of the logos. My logo is not on there.
2130020	2131800	The open hardware is on there.
2132880	2134760	The conference logo isn't on there.
2134760	2135900	There is the URL.
2136780	2137860	So we can see it.
2139900	2141980	Take a picture if you want. I'll wait a second.
2143440	2147820	Take a picture of the screen, showing the tablet, taking a picture of my laptop,
2147820	2152120	showing a device that happens to have the URL text rendered as an image.
2152800	2154420	I mean, I think we need to do this anyway.
2154440	2157280	I would take a picture with my phone right now, but I cracked the screen yesterday.
2157280	2157820	So, oops.
2159060	2161680	But, yeah, you can see it's the same layout, same design.
2161680	2164380	And besides, Portland is literally going to use this exactly the same.
2164380	2165200	Actually, that's not true.
2165200	2169920	We're going to change R11 to a slightly different resistor value.
2171340	2174220	But we don't need to worry about that right now.
2174220	2177680	So, yeah, and then, again, this should look very similar.
2177680	2181860	This is the... get it nice and close so we get the screen as the whole screen.
2181920	2183120	There we go. Perfect.
2183300	2185400	So, yeah, here is the board.
2186640	2189160	Blank on the back and stuff on the front.
2190080	2194560	One thing I'll mention, some people kind of like to shortcut and sometimes...
2194560	2195880	Oh, you can see me in there, too.
2197440	2201940	You try and shortcut and say, oh, well, you know, it's cheaper if we just get the plain boards.
2202300	2206120	And the default selection is HASL.
2206120	2210240	It's a leaded kind of metal cover, so it makes it easier to solder on the copper.
2210720	2211960	But that's leaded.
2211960	2216040	And if you're doing these badges and you're handing them out to people, don't use lead.
2216140	2216740	Okay?
2216960	2219180	There are a lot of people who will be like, oh, yeah, I'm old school.
2219180	2221260	I'm just going to use leaded solder because, you know, whatever.
2221260	2223080	It tastes salty when you eat it, but too bad.
2223960	2224780	Use unleaded.
2224780	2228880	It exists for a reason, and especially if you're going to be handing this to people and kids,
2228880	2231280	and they're going to hang it around their neck and show it to their kids when they get home,
2231280	2232520	and they'll put it in their mouth.
2232780	2236240	You may want to put a bit of it on there just to make it like game cartridges.
2236240	2238640	But, yeah, don't use lead.
2238720	2239700	Figure it out.
2239700	2241460	Get the equipment and learn how.
2241460	2249160	I use SAC 305 solder, which is 3% silver and 0.5% lead tin.
2249160	2251320	No, not lead. Tin. I don't know.
2251320	2255240	But just do it. Get practice doing it if you're a soldering person,
2255240	2261660	because it's the right thing to do for people who would otherwise get injured by lead.
2261820	2264860	Anyway, so let's look next.
2265320	2267600	Actually, I'll skip over because it's a little more visual.
2267600	2270640	This is the dock, right?
2270640	2273880	And so let me try and change it so you can see the dock better.
2273880	2276360	Has anybody ever used OpenSCAD before?
2277120	2284820	I love OpenSCAD because I'm like a console person, and OpenSCAD is like CAD for console people.
2284820	2285560	There we go.
2285560	2286140	So here...
2286140	2290460	What do I do now?
2294540	2296580	Oh, there's a button down here.
2297260	2300320	No, that was the wrong button.
2300580	2301940	There we go.
2301940	2307580	So OpenSCAD lets you just basically draw boxes and spheres and all that stuff.
2307580	2310720	And what you can see here is I've got... oh, why is it doing this?
2311200	2313560	I must have a sticky key or something.
2313560	2315300	So we'll look at it sideways.
2315340	2317920	I've got a groove for each of the badges to slot in there.
2318140	2323660	What I also have is it's parametric, so we can change the badge size right here without having to worry.
2323660	2325860	So if we change the PCB, it's pretty straightforward.
2325860	2328600	I like to put the USB port in the middle. It just makes it easy.
2328780	2334440	And if we wanted to do a two-column version of it, not 23, we can go do that.
2334440	2336240	And bam, you've got two columns.
2336240	2343580	If we only wanted to do a double one, we can do two columns and one row.
2344580	2346660	Bam, just a skinny one.
2347020	2347820	Make sense?
2349120	2353800	I've got that up here, so when I'm done talking, y'all can come up and take a peek at it.
2353980	2361800	And again, I've got badges, so if you stick out all the way to the end and you're interested in contributing something or even just want to try these things out, come on up.
2361800	2363520	I didn't bring batteries. I'm sorry.
2365120	2368980	And actually, now I'm realizing that there's something in my slides I forgot to mention.
2369000	2370360	But I'll get back to that in a minute.
2370360	2372560	The last thing I want to talk about is code.
2373080	2374600	It's all Python.
2374620	2378120	Anybody who's used Python, you look at this like, okay, we import stuff.
2378180	2382060	I have a bunch of libraries that I use specifically for this game.
2382060	2384400	And then it's Python, right?
2384400	2387740	We write Python code, and it actually works on hardware.
2387740	2389140	And it's pretty awesome.
2389140	2393700	The downsides of Python on embedded hardware is it sucks power.
2393740	2395400	It uses a lot of battery.
2395880	2400420	Which is why I used AA batteries.
2402020	2404180	Yeah, no, I'll go back to that later.
2404220	2408000	I used AA batteries because they're cheap.
2408740	2412280	And because they have a battery holder that's inexpensive.
2412280	2416840	You can ship them, you can transport them, you can take them through TSA.
2416840	2420760	You don't have to worry about accidentally puncturing them and starting a fire.
2421200	2425980	So unless you really know what you're doing, stay away from lithium batteries on badges.
2426620	2431140	It's not as bad as lead on PCBs, but I feel like...
2431140	2434240	We've got a badge here that was well done.
2434240	2437020	Where they actually made an enclosure and protected the battery.
2437020	2441500	If you aren't enclosing your lipos, then be extra super careful.
2441880	2444220	Anyway, AA battery.
2444220	2446500	Actually, I started out with a triple A.
2446500	2450300	I used a double A because it didn't last very long the first time I did it.
2450300	2453440	But then I've added some power save features.
2453440	2455980	Somehow I should be able to look down here.
2456560	2461280	Right there, tiny, maybe you can see it, is some circuitry.
2461520	2464540	And what this does is it takes the 5 volts in over USB and boosts...
2464540	2467600	Sorry, the 1.5 volts from the battery.
2467760	2473740	And boosts it up to 3.3, which means you can use that battery all the way down to 0.8 volts before the thing cuts out.
2473740	2478180	Use your whole battery. I used a lot of coin cells in the past.
2479000	2480460	Which is great if you have a very small thing.
2480460	2482680	If you're not running CircuitPython, 10 minutes, cool.
2483220	2486040	Let me wrap this up and we'll chat.
2486640	2491240	It's Python code. If you know Python, you can learn it pretty quickly.
2492060	2494100	CircuitPython is made by Adafruit.
2494100	2497320	They're a hobbyist electronics company based out of New York.
2497620	2501480	And they make reference boards, development boards, all sorts of stuff.
2501480	2503640	If you want to prototype something, that's where we started.
2503640	2508220	We started with a bunch of Adafruit components, prototyped on breadboards.
2508360	2511100	And ended up here with a custom PCB.
2512160	2514880	And the last thing I'm going to show you is...
2515860	2517600	Yeah, so let's skim through this.
2517600	2519960	This is basically the provisioning.
2524930	2526670	Not LSD. There we go.
2526850	2527950	So this is the configuration.
2527950	2531470	We've got a check.sh, which actually checks when you've got a solution.
2531470	2534470	The genfiles.py is what...
2536810	2539190	basically generates all the files for the game.
2539190	2542830	So down below, you can see we have our strings.
2542870	2543950	So our company options.
2543950	2546710	Terral Corporation, Neodym Pulsion, Weyland-Yutani.
2547010	2550150	The startup is Algify, iTech, whatever.
2550150	2551690	And the tool is something else.
2551690	2555170	And the string is, blank company has just announced an intent to acquire a startup
2555170	2557970	to build the industry's most advanced AI-powered tool.
2557970	2561030	And the solution is randomly chosen.
2561130	2562730	And it comes out here.
2562910	2566310	The way it does that is, basically, it goes through the options,
2566310	2569310	randomly chooses one, generates a bunch of files that go on the badges,
2569310	2571450	and then it signs the clues.
2571950	2575070	And gives the public key out, with RSA-512,
2575070	2579110	because just enough to last you a day, without someone wasting a few grand.
2580190	2582750	And that'll let you make sure that people don't mess with your game
2582750	2585510	by giving out fake clues, which could screw everything up.
2585510	2587850	So, I'm going to stop here.
2588430	2590450	I've said all the things I think I wanted to say.
2590450	2592390	If you've got some questions, come on up here.
2592850	2595130	And I can continue to talk to those out loud.
2595150	2597590	But you can also come on up and grab some badges if you want.
2598170	2599750	So, yeah, go for it. Thank you.
