Friday, October 31, 2014

Getting your PCB done from A to Z

PCB or printed circuit board is a major step up from the veroboard for DIY hackers. I learnt about PCBs or PCB printing during my final year project as I realised that dangling wires, ugly solders points and loose parts would be a pain. So I produced a lot of sub par PCBs before finally getting to really good ones. In this post, I want to have you skip this steep learning curve and jump right to a good work. That explains why this week's post is so long.
Okay, let's first compare veros and PCBs. Figure 2 shows a veroboard which housed a microcontroller, a 5V regulator and a few pin outs. Figure 1 is exactly the same circuit, but on a PCB. The gap in terms of quality and neatness is blatant.


                                                      Figure 1: PCB version Print Layer


Figure 2: Vero version 

Okay, so in this post I want to have you build your own PCB. Now, I've been thinking hard on what circuit to work with. I looked at the 555 flasher, 555 timer and I realised it would be great to work with a much more useful circuit(no disrespect to the living legend that is the 555). So, my very first post was about regulating a 3s lipo(about 12V) to 5V without having to bother about heat sinking issues. Well, this is the circuit that we'll be laying down on PCB. I think it is a extremely useful circuit that will come in handy. If you want a neat design to shift a 3s Lipo or even Car battery voltage to 5V,we've got a deal.
So where to start in any PCB project, make sure you get your circuit diagram right. Figure 3 gives the circuit diagram for our regulator.

Figure 3: Circuit diagram

Now, I've tested this circuit and it works. Everytime you come up with your circuit diagram, make sure you just test it on the good old breadboard(fig 3a). I know its a pain and you are probably in a hurry but it's important that the circuit works before going to PCB printing. 


Figure 3a: Bingo 1 - The LED is on

Here's a video demo of the circuit at work:

      

Bingo 2 - We have 5V


Okay. For this circuit, we'll be need the following components:

1. MC34063 - Switching regulator
Now I've not seen this in mauritius but I've got quite a pile of them lying around. Just get in touch and I'll get you one.


Figure 3: The switching regulator

2. A 180uH inductor. Actaully, you could even use a 200uH. I've done the maths and it does not differ much. Now, be careful with this one. At a local electronics store, I ended up with a capacitance! So here how it should look like.



Figure 4: The inductor

3. A 0.33 ohm resistor. Figure 5 shows how it looks like. Well, there are variants ;)


Figure 5: The 0.33 ohm resistor

4. Capacitors.
   - One non polarized 470pF cap
   - One polarized 47uF cap
   - One polarized 100uF cap

5. Resistors(1/2W to be safe)
  - One 1kohm resistor
  - One 3kohm resistor 

6. One fast switching schottky diode 1N5819. Now, here I got the 1N5822. It's huge! But it does the job :)

7. Two 2 port screw terminal, shown in Figure 6.


Figure 6: 2 port screw terminal

8. 8 pin IC socket

Okay, now that we've got the parts, its time for PCB design. So it's time to transpose our circuit to PCB. How do we do that? A software. Now, I've been using Pad2Pad. It's a fantastic little CAD program that offers a powerful interface and great simplicity. You'll pick it up in no time!
(Disclaimer: Pad2pad belongs to its respective owner. Snapshots used are not meant as copyright infringement and are used only for educational purposes)
So, once you have the software installed, time to move to design. Now, open up pad2pad.
Figure 7 shows the startscreen. Just click 'OK'.



Figure 7: Pad2Pad startscreen

Next, you'll be ending up with a black screen with grids as shown in figure 8.



Figure 8: Screen 2

Now, for this project(and most porjects actually!), we'll be using only two tools. The pad tool and the trace tool. They are shown in figure 9. The rectangle profile(blue) represents the limits of our PCB.  Don't worry about that for now. We'll tweak it later.


Figure 9: The tools

Before moving to design, we need to tweak the thickness of the pads and the thickness of the lines. The pads are where you'll be drilling holes for your components. The lines are actually connections. So, set the pads diameter to 1.91mm. Click on the pad tab. Then move to the top right. You'll find something like 1.00mm. Scroll down and select 1.91mm. 


Figure 10: Setting Pad diameter

Similarly your are going to change trace width to 0.64mm. This is shown in Figure 11.


Figure 11: Setting trace width

Okay, simple stuff first. Try to replicate figure 12. You are going to breeze through this. Simple drag drop stuff.


Figure 12: Getting started

Pretty easy! Next up, our voltage regulation circuit. It's given in figure 13. You'll notice the holes are different.We are using the padded hole option. Why? Drilling would be less tedious.


Figure 13: The final layout

Now, this may look daunting, but you'll get it right! Okay, once you've done this, you have to print it. ALWAYS make sure to select MIRROR when you print(Fig 14). Otherwise, you'd be getting a circuit that is reflected.

Figure 14: Printing it right

Finally, you'll be ending up with something like this.


Figure 15: Print out

As you see, its inverted or reflected. Now, the next thing to do is to get the PCB printed. Now, I'm scared of chemicals. I was horrible at chemistry experiments. So, I stay away from those stuff. What you can do if you have the same issues is to take your printed sheet to local electronics store that do PCB printing.
When you get there, there is only one thing to say - "This is the solder side". That will do the trick. It will probably take a day or two. Around Rs 75 is what I paid. From what I observed, it's based on the size on the PCB.
Now, you'll notice I did not inscribe the components on the PCB. I didn't because it does not look good on the finished PCB.
So, fast forward a few days later and you have got your PCB. Figure 16 shows mine. The borders may not look perfect but please be careful if you attempt to cut it. The dust is hazardous.


Figure 16: The PCB

Time for some soldering! Now, there is a very old feud between me and soldering irons. I've had 4 or 5 of the cheap ones and they kept overheating. Finally, I found the one. Never failed me. Behold the Stanley(Figure 17). If you have no background in soldering, I'm planning to have a complete soldering tutorial in 2 weeks(Friday 14 November).



Figure 17: "The" Stanley
Okay, when you look at that PCB, it's pretty difficult to know what goes where since there are no labels. Here are the labels. 


Figure 18: Labels

This is how the PCB would look it were transparent.
Finally, your populated PCB should look like that. 


Figure 19: Populated PCB

I replaced some of the resistors which were not available. You may have to enlarge some of the drilled holes. That's it.
Next week, how to control your arduino from your phone via bluetooth!

2 comments: