Introduction to hardware hacking. Earlier today, Joe Grand gave a great talk about some advanced topics. But I'm going to step back a little bit and talk about sort of some introductory skills and introduction to hardware hacking if you want to start in on it. So why hardware hacking, for me anyway? Hardware hacking doesn't seem to get near the publicity as much publicity as computer or software hacking. I'd like to change that. I'd like to make hacking a more positive thing. Get more people introduced to it and more people doing it. So I always sort of start off with a definition. What is a hardware hack? And this is a little bit long, but bear with me. To me, a hardware hack is a sometimes clever modification or fix made to a piece of equipment that improves its performance or makes the equipment do something for which it was not originally intended. The results of the hack need not be useful in the strict sense of the word. They can just be fun. You can use the word hack as a noun or a verb. As a noun, you can say, well, that hack you made to your token. That toaster was great. Or, as a verb, you can say, let's hack your brother's TV set tonight so it can only tune to channel 13. Well, for me, hardware hacking has always been easier. Why is that? Well, when you buy a piece of hardware, let's say a toaster, for example, you can open it up and you can see exactly what's inside. You know, there's nothing obscured inside of it. Very often, repair manuals are available for most equipment. And your girlfriend's significant other can benefit from your skills as a hacker. You can fix stuff. You can go around the house. You know, when's the last time your girlfriend or significant other asked you to fix their copy of Word? Okay. So software skills are useful, too. But for me, you can fix electrical stuff. When you buy a piece of commercial software, you can't open it up and see how it works. Now, of course, the exception to this is open source, and open source is a great thing. But most pieces of software, you're stuck with an executable file and no source code. You can't see how it works or change it. Its behavior is fixed, usually. And, you know, to which things the original programmer intended it to do. You can't examine it and change it. Again, open source is sort of an example, is an exception to this, and is a very good thing. A little bit about me. I graduated too many years ago from MIT with a couple of degrees. I've been hacking since I was a kid. When I was probably eight years old, my father bought me one of those 101 electronics kits from Radio Shack. You know, it said ages 13 and above, but he didn't bother reading the recommended ages. So I just sort of put stuff together. You know, at first. Most of it didn't work. But as I got into it, I got more and more of the little circuits to work. And just enjoyed that. I also enjoyed taking apart stuff around the house. Old radios, toasters, stuff like that. I failed a bunch of different day jobs. I've been a toy designer many years ago. I designed digital cameras for Apple. I started a company a number of years ago called Pocket Science. And I'm a writer of the hardware hacking book, of which it is an example here. Took me about two years to write. And in it, I gather a number of hacks that I did and some other stuff. I've done. I thought it was cool and put it together. Okay. In this talk, we're going to cover a number of items. We're going to talk about some basic electrical engineering concepts. We're going to talk about some basic components, electronic components you'll see and what they do. We'll talk about cracking the case. How to open up electronics without really destroying it. Many times, you want the piece of equipment to be cosmetically clean when you're done, either for your own purposes or for purposes of not having it seen as being opened up. We'll talk a little bit about building circuits. How to restore. How to read a schematic diagram. How to breadboard, which is a way to quickly prototype circuits without picking up a soldering iron. And then we'll talk a little bit about soldering irons, how to solder stuff together, how to connect to different integrated circuits. We'll talk a little bit about where to get parts, some places online and some places offline. And then we'll walk through a couple of projects, stuff that I've worked on. I'll describe some of the parts and some of the motivations behind it, both some small-scale stuff. I've got a toaster I hacked up. I hacked up a self-cooling beer mug. And electronics. Electronic flashlight, where I've taken an incandescent flashlight and did a quick hack and changed it to use LEDs. And finally, I'll walk through a semi-famous hack by a group called the Chaos Computer Club over in Germany, called Blinkenlights, where they took an eight-story building and turned it into a giant display. So I'll talk about a few of the technical details behind that. Okay. There's sort of two basic classes of components that you can use when you build circuits. It's called passive and active. Passive parts are just that. They don't do anything active to a signal. Or do anything active to electricity. And there's sort of four that I'll call out right now that we can talk about. Resistors, capacitors, inductors, and transformers, which are actually a type of inductor. And then there's active parts. And that's sort of pretty much everything else, which is transistors, diodes, and integrated circuits, which are basically just a bunch of transistors. Okay. Resistors. What does a resistor do? It limits or resists the flow of electricity. A lot of times people like to think about the water pipe analogy when you think about electronics. Well, if you think about a pipe as a piece of wire with water flowing through it, a resistor would be a difference in diameter of that pipe that would either resist or allow more water to flow through it. Resistor values are measured in ohms. The equation that governs the flow of electricity through a resistor is V equals IR, where V is the voltage, I is the current, and resistance is measured as R. An example of how a resistor is used, a simple example, is that you can use it to limit current through a light-emitting diode or LED. LEDs are, you can't just hook them to a battery and let them light up. You need to resist or limit the flow of current through them. If you don't limit this flow, the LED will typically blow up. So that's what you use a resistor for. And what you do is you typically hook it in series. And I'll cover this in another slide. Resistors themselves, let me see, get a pointer here, come in lots of different packages. These are through-hole components. These are probably, you know, maybe five, six millimeters long. They've got little metal leads coming out. This other one over here is a surface mount part. It's a little tiny chip. And they're getting smaller every day. Joe in an earlier talk mentioned that resistors are getting so small that you can actually inhale them and not know. They're actually getting that small. The schematic symbol for resistor here is a line with a bunch of squiggly things. And we'll get into schematics in a little bit. But next to every component in a schematic diagram is typically what's called a reference designator. That's that letter R standing for resistor. And a number telling you which resistor. And then a value. Right here it says resistor, which is a default for a schematic capture package I use. Capacitors. Capacitors store energy in the form of an electric field. They act basically like small batteries in a circuit. The value of a capacitor is measured in farads, which is named after Michael Faraday. Voltage, current, and capacitance follow a slightly different equation. You'll probably have to dig out your calculus books and your old math books to really work with this equation. But basically, the current that flows through a resistor is equal to the capacitance, the capacitive value, times the change in the resistance. And then the change in voltage with respect to time. So basically what this means is, if you put a slowly increasing voltage across a capacitor, you can get current to flow through it. But if you put a constant voltage, just like if you touch a battery to the terminals, current will flow through it for a short amount of time. And then it will charge up like a battery. Capacitors are sometimes polarized. And what this means is that it has a plus side and a minus side. And if you hook it up backwards, it will pop. It will actually explode. So you need to look at the capacitor. You need to look at the capacitor you're using. Typically they have a little plus marked on one side. Capacitors are often used to filter noisy circuits. Most capacitors are used in power supplies. When you convert power in a battery to use from a laptop or power from the wall current, used to usually filter it. Okay, so let me get the pointer up here. So capacitors come in lots of different packages. This can here is a type of capacitor called an electrolytic capacitor. Electrolytic basically refers to a capacitor. It refers to the chemistry used to build it. Electrolytic capacitors are almost always polarized. This capacitor over to the left of it, this little yellow blob, is called a tantalum capacitor. They use a small dot of a metal called tantalum placed onto one of the metal pins inside of it. And it actually stores quite a bit of energy for a small package. And then they encapsulate it. Tantalums are almost always polarized. And if you do run a tantalum capacitor backwards, you'll get a nice little bang on the board. So if you want to have a capacitor like that, with an exploding circuit, you can put the capacitors in backwards and watch the fireworks. Capacitors also come in little tiny chip-scale packages. Let me get the pointer here again, which is over here. These are called surface-mount capacitors. The schematic symbol for a capacitor is here. It looks like two lines, like two plates. And that actually represents sort of the structure inside the capacitor. There's no wires that short across the two terminals of a capacitor. They're used to store energy. And again, you see the C1, C standing for capacitor, 1, the reference designator. And the value would be replaced with the word cap. Inductors. Inductors store energy in a slightly different manner. They store it in the form of a magnetic field. The value for inductors is measured in Henry's. The equation that governs the current and voltage and inductance of an inductor is given by the equation, the voltage equals the inductance times the change in current with respect to time. Now what that means is, an inductor, if you just took a battery across it and wait some amount of time, it looks like a piece of wire. And you get lots of current to flow through it. But if you were to suddenly, after you've connected this inductor across a battery, if you were to suddenly disconnect it, the inductor, because of the way it's built, would want the current to keep flowing through it. And you can actually get a fairly large spark from one end of the inductor to the battery as it attempts to keep current flowing through it. A lot of the hand shockers and stun guns use inductors extensively in just this way. They switch the voltage up by using this principle. Inductors are very powerful. They're often used to filter out what's called radio frequency interference. Lots of 80211 radios and other pieces of radio frequency equipment emit energy that sometimes you don't want your circuit to pick up. So you can use these to filter inputs. Inductors are used extensively in power supplies, typically to convert energy from one voltage to another efficiently. Transformers are a type of inductor. It's an inductor wound in a different way. I'll get to that in a moment. Basically what inductors do is they couple energy from one side of it to the other. You can see the diagram here where you have two terminals going in and two terminals going out. So you can basically send energy across the transformer. And you say, well, why is this interesting? Well, you can use it to isolate signals. There are times when you have circuits where there's an area where there's a very high potential voltage, a very high voltage on one side, and you want to protect the other side of the circuit from that. So you can use a transformer. A lot of times when you get hum, when you connect a PC to, say, a sound card or an external sound device, you'll get a buzz or a hum that can sometimes couple through. They often use audio transformers to isolate that. Transformers are also used in step-up voltage converters. And I won't get into the details of that, but there's lots of resources you can look up for that. Okay, let's talk a little bit about active components. Transistors, sort of a very basic element of an integrated circuit. Transistors basically act as a switch. And there's sort of two basic classes. And there's other types of transistors that we won't get into here, but that are related to these. But there's two basic types. One is called bipolar, and one is called a metal oxide semiconductor transistor. Diodes are another type of active device. They basically act as a one-way gate. And in that class of diodes, a number of physicists years ago found out that if you make a diode a certain way, you can get it to emit light, thus the emergence of the light-emitting diode. And then integrated circuits, which are basically lots and lots of transistors on a small piece of silicon. Okay, let's talk about transistors a little bit. Like I said, they're electronic switches. Two basic types. Bipolar, and this will be a little bit detailed here, but what bipolar transistors are, they're what's called a current-controlled current source. And what that means is you actually use flowing current to switch it on and off. There's two flavors, if you will, of transistors. There's NPN and PNP. And these refer to how the transistors are made and how they can be used in the circuit. Transistors typically have three terminals. Although some exotic types have more. They have what's called the emitter, the base, and the collector. The base is the input switch that controls current from the collector to the emitter. The other type of basic transistor is what's called a MOS transistor, a metal oxide semiconductor. And what these are, these are voltage-controlled current sources. The reason that MOS transistors are used extensively in integrated circuits is because they take very little energy to turn them on. Let me bring the pointer up here. If you think about when you build a large integrated circuit, you don't want to, excuse me, a lot of, you want to minimize the amount of energy used in the circuit. Well, with a bipolar transistor, you actually have to push energy into the base to make the transistor turn on. With an MOS transistor, you simply need to present a voltage. Current doesn't, or very little current actually flows into the transistor to turn it on. So you can save a great deal of energy. That's why most, in fact, all ICs are made using CMOS these days, most highly integrated circuits. There's two basic flavors, as there were for bipolar. There's P-channel and there's N-channel. And they have three terminals as well. And these call them different things. There's the drain, the source, and the gate. The gate is the switch that turns it off. And the drain and the source are where the current flows when you switch it on and off. Diodes are, actually, diodes, I believe, were invented first. But they're basically a one-way gate for electricity. There's different flavors of them, three common types. One is just a standard diode. Another type was called a Schottky diode. Another type was called a Zener diode. Diodes have a plus and minus side indicating which way current will flow through them. Diodes can often be used to protect a circuit. Let's say, for example, you want to keep someone from plugging in a circuit backwards where they apply power. You would actually be able to use a diode to keep current flowing only one direction and thus protect the circuit. Let's see. Diodes have what's called a drop. They actually lose a little bit of energy when you push current through them. Typically, it's 0.6 volts and above, depending on the style. And then there's actually a little bit more interesting type of diode, the light-emitting diode. When you put energy through it, it lights up. These have a little bit more of a forward voltage drop. But the good news today is they're available in all colors, including white, blue, red. The white is one of the newer types invented. In fact, most PDAs utilize white LEDs to backlight the screen. It's a very efficient light source. They're expensive, but the cost is dropping. A lot of people have been producing light-emitting diode flashlights. They're also very popular. There's a lot of work going on in actually replacing incandescent bulbs with LEDs. And once the cost gets below a certain point, light bulbs in your house will run for tens and tens of years with a fraction of the energy expended of an incandescent or even a fluorescent bulb. On LEDs, the way you can tell the plus and minus side is there's typically a flat spot on the minus side, as you can see here in the – let's see, this one here. Okay. When you're taking apart a circuit to try to figure out how it works, or, you know, for curiosity or other reasons, you often want to know what the different integrated circuits do. So it's often useful to be able to read the package, the numbers on the package to determine what it is. One of the first things I do is you look for the logo of the manufacturer. Typically, most manufacturers have a logo that's typically the first letter of their company. I'll show you a couple examples in a moment. And you can look for that on the package, and that will sort of give you a starting point of where to look to gather more information. And then there'll be a string of numbers. Typically, the first part of the numbers – let's see here – indicate the actual part number. And the rest of the numbers are typically production dates, you know, when it was built, maybe what batch it came from. And you can use this information to then go, you know, from the manufacturer's website once you've identified the logo. You can then go and look the part number up. And here's an example from – let's see the pointer up here. This is actually a Toshiba part number for a logic of buffer. And so Toshiba often uses the letters TC in their part numbers. So you can see the TC here, and that can give you a pointer. And then they have the part number here. And they often give the package type. And this is actually an ordinary number. But in this number, typically the first part actually is the part number. Here's just a few examples of some of the labels you'll see on the ICs stamped on it. And again, there's, you know, there's hundreds of companies out there, even more now that Taiwan and China are actually opening up foundries. So there's lots and lots of different logos. But after a while, you'll get a feel for what these logos – what the logo looks like. What the letter logos mean, which company they're referring to. And you'll be able to look it up yourself. Okay, cracking the case. Very often when you buy a piece of electronics that you want to hack or you have an old piece of equipment that you'd like to repurpose by hacking, you want to open up the enclosure without destroying it. Okay, well, how do you do this? Well, first is to have the right tools. I like to have lots and lots of small screwdrivers. Very often these PDAs and laptops use tiny, tiny screwdrivers, both Phillips and Flathead. The other thing that's important is to know how most enclosures are fastened together. They're typically fastened together with screws, very small screws. Plastic snaps molded into the sides of the case are often very popular. Glue is used, and in some cases, double-sided tape is often used. Okay, well, hacking the case is sort of like surgery. You wouldn't want – well, for example, you wouldn't want your doctor to use a battle axe to perform an appendectomy. Get good tools. I prefer hardened steel tools. One of the most frustrating things is to use an inexpensive tool you bought for a dollar or two to have it only strip the heads of the screws, ruining the screw and your screwdriver. So I recommend that you get some really good tools. A lot of the different cases, the electronics cases, are held together with some sort of obscure type of screwdriver or screw. And Joe mentioned this before. There's lots of different ones that are used out there. They call them security screws. And basically what they are is they're sort of security through obscurity. Most of these security screwdrivers are available through most Internet stores. But the common ones you'll find out there that are a little obscure are Torx drivers, which are star-headed screws. And they're not so much a security reason, but they actually provide a way to provide more torque onto the screws. So you can crank it harder without stripping the screw head itself. Hex drivers are also popular with lots of equipment. They have a hexagonal-shaped head. And again, the reason is because you can apply – you can crank down the screws harder without stripping it. I like to have a good pair of steel tweezers. And they're good for lots of different stuff – placing components, but also if you drop a screw into a case, you can use it to fish the screw out from the bottom of the case. The flat end can also be used as a very good pry bar if you need to pop the case open. I carry a set of dental picks with me from time to time. These are very often useful for opening up the seams on the side of a case when you crack it. I carry some razor blades as well. I prefer the X-Acto style. These are often very useful, again, if you need to cut a small piece of plastic open, pick open a small cover that's placed over screws very often. Collecting good tools can be an obsession. By having the better tools, you can often show off that perhaps you're a little bit better than someone else. You know what you're doing. I love the latest German hardened steel stuff is also very – is good to have. So common fasteners, screws, plastic snaps, glue, double-sided tape. The Palm 5 was actually completely held together. The case was held together with double-sided tape. And the way you would open it up is either you stick it in the oven or use a hair dryer for about five minutes and then the glue would soften and peel away. That's how you put it back together again. A lot of people who upgraded memory or tried to replace their batteries, you know, spent days cracking the case. You know, pulling on it would bend the metal. No, just stick it in the oven for 20 minutes. Screws are often placed in obscure places, not so much for security reasons but to make the product cosmetically attractive. They're often placed on the bottom of a product. Under labels. Under the little feet of the product. So it often pays to peel open those little round circles you see that look like they're the same colour as the plastic of the case but maybe a little bit different texture. You'll often find a screw behind those. So good ways to open up a case. I'm gonna switch over to a video here. I can show you some of the techniques I use. Clear a nice big tabletop. The screws on the small electronics are actually very easy to lose. I often place sheets of white paper on the table first. Simply because the screws are more easy to see when you drop it on a piece of white paper. Obviously you want to power down whatever you're taking apart. You want to unplug it and or remove the batteries lest you get a shocking surprise. The first step I take is you carefully remove all the screws you can find. Make sure you look under all the labels and feet. One of the techniques I found if you intend to put it back together again is to take a piece of paper and sketch out a crude outline of the product and tape the screws to the relative location from which you put them. And that way you know where they're gonna go when you put it back. If you'll excuse me for just a moment I'll bring up a webcam and show you what I mean here. Picture is often worth a thousand words. So let's see if I can show you this. That gets a little better. No, but there was no stand for it. So I had some black tape and I black taped it to the microphone stand creating a hacked up camera stand for just this purpose. Okay, so a good idea here. So this is actually from a digital camera I took apart a little while ago. I drew just a crude outline of the camera itself and I started... Sorry? Oh, it's not showing up? Uh-oh. Uh-oh. Yeah, okay. Oh well. I tried. Let's get back to this then. Well, you can come up after which and I'll show you what I mean. But basically I took a sheet of white paper I drew an outline of the product and I started taping the screws as I took them out one by one. And that way I knew exactly where they go. I sometimes number it as well so you know the steps. These things can have 10, 20, 30 screws and if you get even halfway through it you forget where things go. One of the things is once you pull all the screws out the case still may be stuck together. So what I do is you look for the seams and the key phrase is you gently pull at them. Don't force it. If you force it you're likely to break something. I use tweezers or a pick to open up the seams sometimes. Once you pull all the screws out that you found there's probably one or two you didn't. And the way I generally approach the problem is you pull at the two halves of the product and feel for resistance. If you see it coming from one corner you know there's either a screw there or a snap of some sort. And then you can go in with more detail with either a pair of tweezers or your dental picks and push and pull until it's released. Once you've released the electronics from inside the assembly it's careful that you don't damage the actual circuit boards with static electricity. Now there's a number of ways you can prevent this. One is you can use what's called static wrist strap which is basically an elasticized band that sits around your wrist with a metal plate that touches your skin somewhere and then it runs a wire to a grounding point. And this grounding point is often just a three-pronged plug assembly that plugs into the wall. Well if you don't have one of those around and you want to be a little bit dangerous what you can do is you can take a probably three, four foot piece of wire you can strip about eight inches from the end and you can wrap it around your wrist and you can take the other side strip maybe three, four inches and go to the wall plate and just pull the center screw out a little bit. That center screw if the plug plate was wired to code will be connected to actual neutral ground which is in theory plugged into the ground of the earth. Screw it back in such that the wire at that one end touches the wire and you've got a nice hacked up wrist strap that'll keep you from damaging the circuit with static electricity. Do not I repeat do not plug the wire into any one of the three sockets. You might think that neutral plug on the third one is ground and it typically is but it's safer to use that screw on the case on the outside of the wall plate. Okay, building circuits. Well, there's a couple of skills involved that you need to build circuits. The first one would be if you want to build stuff that other people have designed is how to read a schematic diagram. Another skill that's often useful for quick prototyping is what's called breadboarding. This allows you to quickly assemble circuits without actually soldering. It has some limitations which we'll talk about. And the third is once you want to build a circuit that's semi-permanent or permanent you need to use solder to connect the different wires and ICs together. We'll touch on different types of irons bench style, portable, cordless. There's some great cordless solderings out there that are powered off of butane gas. Don't require any plug-ins. We'll talk a little bit about solder and we'll talk about another type of material called a perfboard which is another prototyping tool. And we'll talk about some of the tools you can use to work with these items. Okay, I hope you can see this up here. Yeah, okay. So this is a simple schematic diagram for a little pick-based project I worked on. Okay. So let's walk through a couple of items in the schematic diagram. So down here is typically what's called the title block and this has typically the guy who designed it, his name, the project name, the revision number, when it was drawn. Around the outside you'll see a set of numbers and letters. And what this allows you to do is call out coordinates of an object within the diagram if you want to find it. So along the top I think there are numbers and along the side are letters. You could say A3 might be this area right here. So if you're communicating with someone else on a problem or a change to the circuit, they don't have a piece of paper in front of them, you can use these coordinates to tell them where to look. Let's look at a couple things in the circuit here, the schematic diagram. Every part will have what's called a part reference. And here on this integrated circuit it says, it's a little hard to read, but U2. The letter U is universally used to refer to any type of integrated circuit. And the number 2 means it's the second integrated circuit that was probably placed when it was drawn. Let's see, oops, where's the pointer again? Oops. Okay. Along the sides of the IC will be the pins that actually provide connectivity to the outside world. They have numbers and they have names inside the box that describes the IC. One of the connections that you need to give to almost every IC is power. And you can see here, and I apologize if it's a little hard to read, but it indicates a voltage connected to this pin. It's a number, usually 3.3, 5, 1.2, 12, and a letter V for volts. And a line indicates the voltage and a line connecting it to the IC. This is the power supply. Typically, every package will also have a ground to allow the current to flow through it and back out again. Now, not every schematic will have ground because some assume that the schematics are communicated within a company often in electronic form. So they often hide that ground connection. So you won't always find it on every schematic diagram you encounter. Let's see, get the pointer back here. Where did it go? There we go. Sometimes, you'll see words or letters attached to wires just floating in space. These are what are called net names. And basically, if you see two of the same word on different wires, that means those two wires are connected. It just keeps the schematic diagram from getting cluttered. And obviously, lines that connect two points indicate a wire. A dot at a connection indicates that those three wires should be connected. If there's two wires that cross without a dot, it means they should not be connected. So this is some basics on reading a diagram. These are different types of gates of the circuit. in the name of the integrated circuit, there'll be a letter A, B, C, D. What this indicates is a part, it's one of the logic elements or integrated circuit elements within one package. So, for example, these all will have the same U7, I believe. I'm sorry, U1. But they're labeled U1, A, B, C, and D. Well, these are all in the same electronic package, but they have, they're independently connected. And here's an example of what to transistor. These pieces, these blocks over here typically will be connectors and these allow you to get signals on and off the board. Okay, building circuits. Well, a quick and dirty way to build circuits is to use what's called a breadboard. What breadboard is, is basically, it's a piece of plastic with a bunch of holes in it. And underneath the holes are little metal trays that connect a series of these holes together. And what it allows you to do is take DIP style or dual inline packets. These are the integrated circuits that you can plug them in directly and then use just solid core wire to make jumpers between connections. These holes will actually hold the wire in place. So, within a few minutes you can breadboard simple circuits. Now, it's not particularly useful for high frequency circuits, radios, and so forth, but you can build microprocessor based stuff and simple audio circuits as long as they're not too high frequency. The reason is because these wires are hanging out in space and when you get to high frequency circuits those wires actually look like circuit elements and can alter the way the circuit works. These days, a lot of integrated circuits don't come in DIP packages anymore. So, breadboarding is not so popular anymore. There are a number of companies that make adapters. So, you can take that big flat part that has, you know, 150 pins around the edges and you can actually convert it to some sort of package that has lots of pins and you can then use breadboarding. Well, if you want to make something a little bit more permanent, you're going to want to solder the elements together. Well, what do you need? Well, you need a soldering iron, you need solder, flux, and then, it's not required but it's very helpful to have what's called some sort of solder remover system. Soldering. Well, there's two basic types. There's electric and there's gas or butane iron. So, electric irons obviously plug into the wall and butane or gas powered irons are like basically souped up cigarette lighters. So, here's a couple examples of these. These are very useful to have when you know you're not going to be near an electric power, electrical power outlet or where it's difficult to get the cord. You don't want the cord in the way. Lots of different types of solder. I'll touch on a few types. The most traditional type is a tin-lead mix. The lead gives it the little melting point. The tin gives it some electrical characteristics that are desirable. It obviously has lead so it's not being used as much these days. There's lead-free solder that uses other materials. There's silver-based solder that some people like to use. When you do solder, I often use what's called a tip cleaner. When you solder, you'll get solder blobs onto the end of the iron and the iron will actually oxidize a little bit because it's so hot and has all these chemicals on it. So, you can either use a sponge. You can take a kitchen sponge, cut it in half, put a little bit of water in it and you can quickly wipe the tip on it or you can use a copper sponge which is basically a scrunched up copper and you can dip the tip in that and that will clean the tip. Before you solder two things together, you can often, you want to make the surfaces clean and what you use that for is flux. It's a slightly acidic material that essentially cleans off any oils on the surface of the two things you want to solder together. Lots of different types. There's the traditional rosin core but there's newer types, ones called water-soluble. Basically, you can wash it away with deionized water. You don't want to use regular water to clean circuits because it has impurities and it can actually interfere with the circuit once you've cleaned it. So, if you use water-soluble, water-soluble and no-clean you can use the flux to clean the circuit when you're, the surfaces before you solder them and you don't need to wipe it away when you're done. If you use a rosin core or acid-based solder, you need to use a flux remover which comes in a spray can. Very often, you'll make a mistake in the circuit. You'll solder two things you didn't mean to solder together and need to remove that solder. Well, there's two basic ways to do that. There's a material called solder wick which is basically a braided piece of copper that acts like a sponge and they have what's called a spring or electrically-powered pump that you, that you cock, you put next to the two items in question that you wish to remove the solder, heat the joint, hit the button and it sucks the solder away. Solder wick can be more precision because you can place it at the exact point you want, you heat it and again, it acts like a sponge but solder suckers will often remove more solder in bulk. Okay, well, if you're soldering things together, you can't obviously use the proto-boards. You need to use something called perfboard and what perfboard is, basically it's a blank circuit board that you can solder to. It's made out of fiberglass typically and it will typically have evenly spaced metal holes that are plated through on both sides. So you can insert your components and then solder to the plated holes and use wires to connect your different integrated circuits. It holds it in place and makes it a clean and even layout. Tools. Well, you typically want a set of wire strippers if you'll be connecting circuits together. There's lots of different types out there, expensive, inexpensive. Wire of some sort, various gauges, both stranded and solid core wire are useful to have around. And a set of wire cutters are useful as well. Wire strippers often include the cutters with them but it's nice to have a small pair that's a little bit more precision to clip away leads. You notice the resistors had two metal wires coming out the sides. Well, once you solder them to a circuit board, those wires are hanging out in space. You want to clip those away. And I like a set of needle nose pliers again to bend things around to move them around once they've been soldered down. Okay, where to go to get parts? I have a couple of favorite places online that I go to. A place, a company called Digikey. There's the website. They have tens of thousands of different components most available for shipment within 24 hours. Another company I like to use is Mouser. They also have a large stock of products. A slightly smaller company called Jameco. They have a large stock of electronic components. A little bit more on the surplus side is a company called American Science and Surplus. They often have not just components but they'll sell the circuit board from an old toy that didn't make it or an old video camera components. So they're kind of fun to pick up pieces that you can use to hack yourself. And then there's a company called Halted. They have a website called HSA. They also have a real world store in Santa Clara, California. And it's almost like a museum. They've got computer equipment, circuit boards back to probably the 70s. They buy out surplus equipment from companies that are either going out of business or they've got So it's actually a great place just to sort of wander around. In California in parts I think out here they have a big store called Fry's. They actually carry electronic components. Although it's shrinking they still have a pretty good selection of parts. And of course Radio Shack. We all know about Radio Shack and the quality of their stuff. But they're everywhere and they can often be used to do the job. We'll do a couple project walkthroughs. A little while ago I hacked up a toaster. A little while ago I got a little buzz about in the UK about a design student who put together a weather toaster. Basically would toast a picture of a cloud or the sunshine on a piece of bread. And he got a lot of press for it. It was pretty complicated. All kinds of motors and gears and there was a little it was a Java based system so it would go out and grab weather from some website. I thought this was kind of complicated and there might be an easier way to do it. So I made sort of design trade offs and I hacked something together in a weekend. And basically what I did is I opened up the toaster and I clipped the toasting elements inside it. This is an example here of one of the sort of toasting walls inside your toaster. If you look inside when it's going you'll see these wires glow red hot. Well this is an example of how they're wired inside your toaster. So what I did is I cut it such that you would either be able to switch on the top elements or the bottom elements. And I used a high voltage relay so it could switch the wall currents through it. And rewired it slightly so that you would either select the top or the bottom to toast onto. And I put a switch and then I also put a computer controlled relay to control it so you could actually toast two different patterns. And the other part of the trick was I created what's called a toast mask. And what this toast mask would do is it would sit in front of the toasting elements here and prevent the bread from being toasted along the lines of whatever your mask looked like. So you'd have a piece of bread with the that would be mostly brown with the word hot or cool toasted onto it. And then you basically use wires that you hold on the inside of the toaster. This is in my book so there's some more but this was sort of a fun hack I put together. I've also been reading about overclocking and the use of these solid state coolers. They're called Peltier junctions. And I thought wow that's a little miniature solid state refrigerator. What could you do with that? Well I did a little more searching and I found a website of a German fellow or a Danish fellow who had put together a beer glass that ran with one of these. And he basically sort of mounted it on the bottom and didn't make real good contact with the glass. And I thought there's a better way to do this. So what I did is I had one of these that conducted heat a lot better than glass did. So I mounted the cooler to the bottom of a pewter beer stein. And I created these self-chilling beer mugs. And here's how it's connected. So you've got your oops your beer mug here. Mounted to the bottom of the beer mug is a layer of thermally conductive grease or thermally conductive adhesive. There's a heat pipe which is basically a block of metal. And then there's what's called the Peltier junction cooler which is the device that it's actually a heat pump. It moves heat from one side to the other. So you stack these up. This device is connected to the block which is glued to the bottom of the mug. And then there's a heat sink to pull the basically the bottom of the Peltier junction gets hot and the top gets cool. So you put a heat sink on this because you've got to remove the heat some way or else it won't work. And then a fan on the bottom. And the whole thing is powered from a 12-volt cigarette lighter adapter or an old PC power supply. And you can come up and look at it afterwards but here it is. It'll keep your beer very cold. And if you're in your car you're cool and you're driving along. Or other beverages. So here are some other views of it. You can see the large fan on the bottom. I just used an extra PC fan I had. And you can see that it's completely metal on the inside. And again, this was to allow it to get the maximum cooling capacity for the mug. A little while ago I had an extra flashlight and someone asked me if I could convert it to use an LED instead of an incandescent bulb. And I said, sure you can. It's a real quick, easy hack. Basically you replace the bulb. I covered the last part of the bulb with a towel and took a pair of pliers and crushed the glass. And then used some dental picks and needle nose pliers and I removed all the glass. Hollowed it out and you can see here's the bottom of the light bulb. And then I simply added an ultra bright white LED in series with a resistor. And I wired it into the metal parts of the can here. And you can see the resistors here. I actually did a cluster to get it a little bit brighter. I then mounted the whole system back into the flashlight bulb holder so I wouldn't have to modify anymore the flashlight itself. And oops. And voila. You have a flashlight that's been converted. How bright is it? Why is it half volt? This is actually a 4.5 volt flashlight. For this hack I actually used a three cell flashlight to make it bright. There's been some articles published recently in a couple websites. To use a two cell or one cell flashlight you have to use what's called a DC-DC converter. The reason is because the LEDs need a certain threshold voltage to turn on. And that threshold voltage 1.7 to 2 volts. So that's why a lot of people use multi-cell flashlights this or a DC-DC converter. But this is just a quick and dirty hack. So again, this is about as bright as the bulb was before. It's not as directional because the flashlight reflector was not designed to use LEDs. It was designed to use an incandescent bulb. But it was a quick and dirty hack and there's obviously more room for me to play with this. Let's see. So we'll quickly the last project to walk through is the Blink and Lights project. And I just thought it was interesting. It sort of captured my imagination. Basically, a group of hackers took an eight-story building and turned it into a giant display. They did it over a couple of weekends. They used about 5,000 meters of Cat5 cable to wire every single light in the front of the building. There's basically a halogen lamp in front of an individually controlled halogen lamp in front of each window. The whole system was controlled by a Linux PC with a 192-channel parallel I.O. card. So here's sort of their basic setup. They had sort of a master computer to wire these lights to a little relay. And the relay would switch on or off one of these halogen lamps. So lots and lots of wiring went into this project. You can see some of the pieces here. They used these wooden trees to hold the lamps in place. They had to use relay amplifier drivers because the Cat5 wire dropped too much voltage across that length. Here's the PC that ran it. Here's the rat's nest of wires. Here's another example. You can see the lights sitting in front of each of the windows. So I like to establish or I'd like to inspire a renaissance in hacking. Hardware hacking is actually pretty easy and it's a lot of fun. It's actually really akin to recycling. You take old equipment that maybe doesn't have a use anymore and you give it new life. You can learn a lot while you're doing it. I find the process of deconstruction to be highly educational. But be careful when you do. Make sure stuff's unplugged. High voltages are bad for your heart. So go home and hack something today. Thank you.