← All talks

Making Your Own Cool Conference Badges!

BSides Cheltenham58:16192 viewsPublished 2023-06Watch on YouTube ↗
Speakers
Show transcript [en]

terrible um okay it was quite a big turnout isn't it thanks for um coming to this talk uh we're on something that's completely non-sibly really um so most of you've got these Deloreans hanging around your necks uh if you haven't get out um so today's talk is just on what it takes to make one of these things um so PCB art uh making confidence badges no this doesn't work so who am I um doesn't actually sound there my name's Simon I'm a co-founder of punk security which is a devsecops consultancy um still a work in devsecops consultant uh python developer security guy and all around geek really so anything flashing is going to catch my eye uh lights wise so yeah definitely a geek uh so who is book security is I say devsecops consultancy uh we've got to stand out there today pop by say hello um we were selling uh components for these but they've all gone um we have made four open source tools which we'll happily talk about and we ran a devsecop CTF uh in May that we're super proud of so uh just put that on every slide now so uh why are we here today to talk about PCB art um I don't know you you know it's a good turnout so it's obviously in the interest I guess um I first got exposed to this in Las Vegas last year over at Defcon if everyone has been to Defcon you walk around and there are people just lit up like Christmas trees with with badges it's a huge thing in the industry um mainly because everyone likes flashing lights uh but the the other thing really is a a couple of talks out in Defcon one was from a guy who's hacking starlink the satellites uh from SpaceX and actually he's talked with massively underwhelming but what he'd done is like produce um it it produced a bit of a PCB that you could sold onto a starlink terminal uh to get root so there's a theoretical attack there but actually then it's creating a PCB that you can sold on quite quickly and it turns out now with the cheapness of these that's quite achievable so uh it's good to just spread the knowledge on that um and then another talk I caught wasn't Defcon coming where it was was this one around um oh what's the little chips you get in computers now for encryption the TPM yeah so there's some research done a while back where someone had realized that the the TPM actually spoke back to the processor completely clear text so if you could tap that you could read off the the description keys and stuff so um Hardware hacking's fun and this provides a a quite a novel Gateway into it um so here's some examples of ones I've made the um obviously the punk one I'm wearing now the Cyberman uh I'm not but um there's a couple that I made and then these are some examples I found off the internet so there's a great website called hack a day um for sort of any sort of electronics tinkering um these are all stolen off there um from various sources uh I just really liked the um the grogu one baby Yoda um Dragon Ball Z so there's some examples of the sort of stuff we're going to be talking about today um so when we look at these badges the first thing that you'd normally think of is I need to get like uh an idea and then turn it into a badge whereas actually the process kind of works in Reverse normally because we have a very limited color palette um that we're going to use to do badges so if we go back to these examples um it's probably not by choice that they went with these characters you know got a character who's primarily green um costly the clown is it is primarily white and red they're very simple color palettes so this is taken from jlc PCB which is a Chinese PCB manufacturer they're really cheap that's where all these Deloreans came from today so uh you can pick your thickness of PCB there's a PCB color and that is going to reflect what we call the solder mask on the board so on these ones that's the black portion of your Deloreans that's solder mask the job of solder mask normally in a PCB is to stop solder flowing um from two different pads so if you imagine this is you know um has got some uh the the wheel for instance was two different pads you didn't want to bridge those the solder mask is there to repel the solder um but you get it in all fancy colors a green purple red yellow blue white black um and then silk screen on your DeLorean is the windscreen there so that's designed for you to print um if you look on the back like little icons labels that sort of stuff for your pcbs now all this is obviously not designed for you to turn into a DeLorean it's just designed for you to make a functioning PCB um so those are the things that we've got and the last thing is surface finish so Hazel is going to give you this uh sort of Steely color uh enig much more expensive is the gold plate so if we go back to crusty here um you can actually see this is back um of hack a day they actually put the color palette on this uh picture which I thought was super useful so when they went into designing this they're like okay I reckon with the enigplating I can get some gold um this is probably um enig behind the red solder mask so I get like an orange so I've got the uh copper plate but then the red Over the Top This will be no copper just red and we get a different color red so they're working out ways that they can produce a picture with a very limited color palette so um if you've got an idea for a badge that's where you're gonna have to start is what colors can I produce um this is another cool effect you'll see a lot of is where we basically don't have anything on the board the board is normally like a yellow fiberglass and we can shine through the back of it so to go into that again we've got uh baby Yoda here um so we've got the Hazel plating which has given us the Stillness of his weird floating cop thing um and then got green mask there with no copper underneath it um you can probably tell that as well because it's slightly um it's not embossed like this is so that's the green solder mask same as the black here with no copper behind it uh the yellow is raw board so no copper no shoulder mask uh you got the white of the eyes there that's uh silk screen just like the white on the DeLorean and the green mask on copper so to get slightly different green and make it stand out a little bit um you've got green on top of copper plate which leaves this light black where do they get black from it took me a while to work this out um they're actually using a four layer board which is more expensive and then you put metal in the mid layers so you have almost like a raw board with metal in the middle and you get a fourth color in this case which is you can unique on this one okay so there's some examples of PCB art so if anyone thought this was like cybery feel free to just like get out now um so that's what we're going to be talking about so how do you go about doing this uh the tools for the job really I've been using is AutoCAD Eagle which is free with some limitations um there's another one called Kai CAD which is actually probably better but um you're sort of limited by the blogs and stuff that you're going to find on how to do this most people you know aren't doing this for art so you'll find very technical engineering blogs on how to use these tools um so kai-cad's got some better features than Eagle but I just couldn't find anything cohesive to sort of guide me through the process Eagles really easy to use uh so I'd recommend that but um either those two is great the demos today will be using Eagle inkscape is a vector tool sort of like Adobe Illustrator um some of the guides you'll find for using Eagle will be to take an image off the internet and bring it in um from a bitmap format so um you know okay jpeg or PNG you're going to find a lot of pain doing that so I wouldn't recommend it so what we do is we can go via inkscape and turn that into a vector which is like a if everyone knows Vector images they're a series of lines and dots and arcs and things which is much easier to work with than a pixel representation of an image and then coding we I use Arduino because I'm not very good so uh AutoCAD Eagle is absolutely free up to 10 by 10 centimeters uh two layer boards so that um baby yody we couldn't do on it because it's a four layer board um and if you want to do something big like there's DeLorean you need to pay for the license uh but 10 by 10 like easily covers this on the free version um and then in there the three things you're going to look at today is schematic so how did you do a electrical diagram inside Eagle um then how are you gonna lay the board out so that's the actual um layer now where all these panels and the solder mask and all that stuff what does that look like and then Footprints so when you start putting components on where do you get the bits for your component so you can put on the board properly and and join up all the dots so this scary looking thing is schematics so electrical schematics but actually it's it's not as bad as it looks um so it's going to walk through it now this is the actual schematics for the DeLorean badges you've got on your next so over here we've got the battery so that is the the battery cell with its two prongs left and right which are your positive Terminals and then the ground plane which you don't see is underneath the battery uh from there we've got the updi connector which is your programming one um which is used for flashing that's optional but um I've started adding that to all mine now it's super useful um the actual microcontroller itself is obviously really tiny on the board but in the schematic it's big because you've got so many pins to break out uh then you've got the button down here the LED rail because I just did two really big long buzz bars uh it just shows there's one LED on a schematic and then you've got your headlights headlights across there um so slightly these um the way these headlights work is they're adjustable LEDs so we power and um ground them on Buzz bars so power and ground is common and then they feed digital in because out and in and out and in and out and enemy daisy chain four together um so um when you're first doing the badge stuff it's best to get your electronics done first so um the feedback loop for these is pretty big it's about three weeks to get some prototypes from China so don't just like do a schematic and think it's going to work and then wait three weeks to find out it doesn't um so over on the left is a breadboard so these are electrically connected uh in the in the columns here so you can quickly prototype on them this is protoboard this is the original uh Proto board I was using to test LEDs so if you look at like the blogs and angry engineering blogs because all Engineers are angry for no bad reason um then if you look at these they'll say you can't run them on the voltages of these batteries um we obviously you can so that's how I was testing that and then these things are great 60 pound of Amazon you can set a arbitrary voltage and current so these batteries for instance start at about 3.2 volts um as they drop off they get down to about 2.3 I think before they've been out so you'll notice that your badges will start to go redder because red works at lower voltage then blue so you'll lose blue first um so these allow you if you've got something you think I don't know if that's going to work or not get a breadboard get one of these dial your voltages in and just say yeah that would work on that battery actually because every blogger I went on and every sort of forum or Reddit thread around these neopixel LEDs angry Engineers were saying there's no way you're going to run them uh on those batteries um but we do um quick thing on the battery is actually they're super dangerous so just don't eat them or give them to your dog definitely don't do that um and use a good supplier this is another big tip so I spent a lot of time ordering stuff off Amazon like the voltage thing um and uh AliExpress and stuff which is great and it's cheap but when you especially when you're dealing with low power like these um you end up just chasing bugs that you shouldn't have so just use a good supplier so if you're buying the microcontrollers particularly they're like 30 Pence each I get everything from digikey now it's like a One-Stop shop same with the LEDs you might find that you get free batches of AliExpress and it's fine and then the fourth batch you've got some weird issue where you're losing power after two hours or something I built like a greenhouse sensor and it was losing battery because the sleep mode didn't work properly uh that was an Ali Express one so use a good supplier okay so now we're gonna go a quick demo of how to do schematics in Eagle so my theory behind this talk today is it took me a good while following Defcon and getting a bit of a bug for making badges to get all the pieces together so this won't be a deep dive in any one particular area I just want everyone to get an appreciation of the full flow and then if you want to do it and you haven't put you off then you know what to go and Google which is after battle I think so um let's try the schematic demo one-handed it turns out so this is Eagle by AutoCAD um probably written in Java or something so uh so yeah so this is the schematic view what you'll do is uh create a schematic first and we'll move on to the board later and it links these two up for you automatically um so you've got an idea of what you want to do in this demo I'm just going to do a coin cell battery uh with two LEDs on it so that's like previous the simplest circuit you're probably going to make for a badge um these have like an internal resistance so you don't need to put a resistor on um again angry Engineers will tell you that you should definitely put like um limiting resistors and all those things but I always advocate for like the least Parts possible because your good boy got a sold of these things so um battery in an LED will work you see some people just like sir type and led across the battery and then just like a magnet and stick it on a Lamppost and things um because they're yeah they're super good for that so um but don't eat them okay so let's make it a simple circuit so uh just to skip back over to that so once you've got Eagle open you add a part um these are all the built-in libraries you can add libraries I've got the Adafruit one so they make a load of stuff for raspberry pies and stuff so you probably come across other food before so we need a battery um which is in here CR2032 battery uh there's two formats here if you see these green like green circles they're holes so this one will be a through hole mounted battery casing uh and this one smt uh sometimes you'll see it as SMD the surface mount which is the ones that we use so they don't go through the board um so we're going to add one of those there we go that goes on there like that and then we're going to get some LEDs uh and we'll go for these so these are um through hole LEDs so all the stuff you see on the board today is surface mount uh well not on your boards unless you're a volunteer or a speaker or you bought a kit and you want some pain later on um all of them are surface mount and most of them are mounted the wrong way because they're not designed for PCB art to shine through the PCB they're designed to uh face upwards so what you end up with is these solder ramps and things on the back um yeah so a lot of components will all be surface mount like these where they don't go through the board or they'll be through hole stuff like these with the green circles on these are designed for pins to go through the board and you solder them from the back um so we're gonna go for those because they're easier so two LEDs and then you're gonna so the battery here we've got the ground pin over here and then the two positive pins they're unlabeled on this schematic um so the first three versions of these badges uh I had the batteries uh upside down um which eventually caused me pain so uh yeah these are the positive so literally we just drag these wires to do okay that was a terrible one and then I can just Bridge these cool okay oh oh dear I don't know there we go right so one chunky looking schematic so uh simple as it's gonna be really for these badges so we've got positive pins going to the positive side of these dioses lovely arrows and I've probably got it the wrong way around anyway but the um the positive sides of the LEDs and then down back to the ground plane and because the internal resistance of the battery won't blow up so that's a very simple circuit for making a badge um there's all sorts of things over here I don't know what most of them do with the um like copy and stuff's fairly obvious but I don't know what that is paint roller um cool oh you Muppet that was just a quick recap for your benefit right so now we're on to um they're on to board design so we've got a schematic and we want to put it on a board that's what we came for not for Simon's fundamentals of electrical engineering so we went to board design so let's have a look at that so here's a DeLorean all lit up looking great so um yeah so we're using the if you remember the hassle uh coating for the copper to give us that steel look we've got the solder mask being all the black bits silk screen provides the white to the windscreen and then raw board basically these two rails and here so there's no uh copper and there's no solder mask and that allows us to shine through if we put solder mask here or copper obviously putting a light through the back it's not going to show up so um so that's the sort of four things we need to do to make this board work so uh we end up with basically the copper layer in this case you can either say where you want Copper or you can say where you want Copper but then where you want exclusions okay you can't do this on most layers but on copper you can and it's it's um it's really convenient it's because and when you're doing circuits quite often they have big ground planes but you might say I don't want the ground plane here or you want the ground plane over everything apart from where the components are and it'll work out the magic for you so we can use that to our advantage so in this case the full board was designated um as being a copper fill and then actually all we care about is not having copper in these little bits so we can shine through so we've got copper everywhere and then we've got the um the bit where we don't want solder mask so salt this is a bit of an annoying one so the solder mask one is an exclusion so in this case everywhere we have silver we don't want the solder mask otherwise it'd be black the whole board would be black so you want the silver to show through so we need to take the solder mask off so all that bit there goes on to a layer that tells it not to put solder mask there and then we have the no copper layer you'll see that the solder mask the no solder mask is applying to the headlights and the rails as well and then we have the no copper layer which applies to the uh headlights and the rails so now we've got copper everywhere pop from there and solder mask not in those places either and then the final bit is the silk screen which is the white bit and this is straightforward you just basically draw whatever you want and it'll get printed onto the board at the end and then the back of the board is where the complicated electrical good bins will get hidden um but no fancy oh this was an absolute pain to do um Okay so so now we know what we need to do hopefully and it's it's I find it we still I still find it really uh mentally taxing trying to take an image and translate it to that like the DeLorean it kind of works out kind of um but for a lot of other stuff if you want to do a Pokemon or something um you're gonna it's just it's just mentally draining trying to work out how do I get that color palette uh in this um but yes that's most of t