My first PCB desing - Page 1
Forum section: electronics / beginners

author: johnk
author_rank: Contributor
timestamp: March 02, 2014, 07:06:00 pm
content: Hey Folks,today I finished my first circuit diagram and PCB-layout in Eagle. It is a simple plant-watering machine-The µC shall be ISP-programmable via SV1.-A soil moisture-sensor will be connected to J1 (it gives a PWM, where its frequency correlates to the soil moisture).-Two push-buttons will be connected to JP1 and JP2.- A water pump will be connected to X1-1 and X1-2.-The power will come from a wall power supply.Could someone with more experience please take a look at it?Does the PCB look acceptable? (I'm quite happy that I managed to do it without having airwires left) - I do know that the mounting-holes are missing, I will add them later.Also: Are the four square-vias used correctly? Why haven't they got such a cross? (I use them for jumper-wires - to spread GND more evenly)

author: granz
author_rank: Regular Contributor
timestamp: March 02, 2014, 07:58:34 pm
content: One thing I noticed is that you have your N-ch MOSFET on the high-side of your pump connection. Your microcontroller won't be able to turn this on correctly in that configuration. You'll want to put the FET on the low side of the pump. Also you might want a pull-down on the gate to be sure the default state is off.Also you might want to re-organize you silkscreen labels for readability.Cool first board! Goodluck

author: cellularmitosis
author_rank: Unknown
timestamp: March 02, 2014, 08:01:35 pm
content: This is a great start, especially for a first board!A few points:1. What is the purpose of R1? That 10k will guarantee that no more than 0.6mA get through to your circuit, which is probably not what you want.2. Why did you choose a 7806? Are you sure that micro runs on 6v?

author: cellularmitosis
author_rank: Unknown
timestamp: March 02, 2014, 08:03:51 pm
content: Oh, my bad, that 10k is just to the rest pin, and you pulled a label off that net before the 10k and labelled it 5v.

author: johnk
author_rank: Contributor
timestamp: March 02, 2014, 08:14:58 pm
content: @granz: Thank you, that's really a point if I think about it - but luckily easy to change. But the silkscreen doesn't matter to me, because I will not order it@cellularmitosis: R1 is not between the voltage-regulator and Vcc, but between Vcc and Reset. And you're right, of course I will use the 7805, thanks for the hint!

author: M4trix
author_rank: Frequent Contributor
timestamp: March 02, 2014, 08:19:04 pm
content: Not sure, but it seems that clearance between tracks, pads and polygon pour is too small. Professional PCB manufactures recommend that a minimum clearance should be no less than 6 mils. If you're doing it home by toner transfer method or using a presensitized positive photoresist printed circuit board, then the clearance should be no less than 8 mils or even higher, 12 mils. This is important cuz too close tracks to polygons might cause short spots.

author: electronics man
author_rank: Frequent Contributor
timestamp: March 02, 2014, 08:20:10 pm
content: why do you have such a large diode you could save space if you used a smaller one

author: johnk
author_rank: Contributor
timestamp: March 02, 2014, 08:42:14 pm
content: None of my tracks or spacings are smaller than 16mil on this board, I think.I used the big diode, because the pump can take up to 2A, so (to be on the save side) I use 3A diode. (I read that the same current that flows through the motor will flow through the diode when the transistor closes)

author: electronics man
author_rank: Frequent Contributor
timestamp: March 02, 2014, 08:47:09 pm
content: 2A is not going to be passing through the diode its just for flyback protection.

author: M4trix
author_rank: Frequent Contributor
timestamp: March 02, 2014, 08:52:43 pm
content: Quote from: johnk on March 02, 2014, 08:42:14 pmThen it's ok .

author: zapta
author_rank: Super Contributor
timestamp: March 02, 2014, 08:54:28 pm
content: Quote from: johnk on March 02, 2014, 08:14:58 pmWhat country? In the US OSHPark will give you 2 layers + top silkscreen for a great price and you don't need to deal with gerber files.Also, a few suggestions* Why the capacitor on the reset signal?* You may want to put lower pullup resistors on the two switches (the internal pullups are 'weak').* Have some revision indication on the board (in case you will have to spin a new revision).* It's hard to follow how well the ground is connected. Highlight the ground net in eagle layout and verify that it is reasonable (post here layout screenshorts with ground and +5v highlighted if you want more feedback).* You can use a resonator with built in caps, e.g.http://www.digikey.com/product-detail/en/CSTLS16M0X55Z-A0/490-6001-1-ND/3845201* Do you plan to mount it somehow? Add mounting holes?* If you are not using silkscreen, have some indication of pin 1 of the headers, for example, buy having that pad square.* C3 looks small. What capacitor voltage are you using?* Add additional larger capacitor on the +5V? (I see only a single 0.1u).* If you light only one led at a time you can use a shared resistor.Congratulations for your first PCB!

author: zapta
author_rank: Super Contributor
timestamp: March 02, 2014, 08:57:35 pm
content: Quote from: johnk on March 02, 2014, 08:42:14 pmIf the pump has large current spike on start, consider to add a small diode between the 12V and c3/c4. This will isolate your logic.

author: zapta
author_rank: Super Contributor
timestamp: March 02, 2014, 09:00:04 pm
content: A question to the experts, does Q1 require a series gate resistor to protect the MCU from the capacitive load?

author: notsob
author_rank: Frequent Contributor
timestamp: March 02, 2014, 09:00:32 pm
content: AND just like the very first PCB I ever did, no SCREW holes, how are you going to mount it.

author: M4trix
author_rank: Frequent Contributor
timestamp: March 02, 2014, 09:12:22 pm
content: Quote from: notsob on March 02, 2014, 09:00:32 pmQuote

author: johnk
author_rank: Contributor
timestamp: March 02, 2014, 09:17:21 pm
content: Ok than. I will keep it in mind for future projects, where the space really matters. Thanks!Congrats too you 300th post btw.@zapta: Wow, thanks for you efforts! I live in Germany and I found the silkscreen to be quite expensive (15€ or so).* I just used the set-up from a tutorial - I guess it should stabilise the signal to avoid an accidental reset.* Does that really matter? As long as it gets pulled up it should work?! (I was planning to use the internal pullups)* Good hint.* I haven't thought about that feature and checked it the hard way, but I'll try it out now.* -* I haven't yet chosen the case.* Good idea! But how do I do it? I cant plant a via on an existing pad...* You've got a sharp eye! Actually I was looking at a 10µF capacitor when I took the measurement.* Yeah that's right. I thought the big one on the input-side would may do it.* I also haven't thought about that, but I will eventually use them at the same time to indicate an accepted button-push or something like that.

author: zapta
author_rank: Super Contributor
timestamp: March 02, 2014, 10:03:39 pm
content: Quote from: johnk on March 02, 2014, 09:17:21 pmCreate an empty library of your own, copy the component from the stock library to your library, modify that pad and use the 'change' tool to change the part to come from your own library.Alternatively, run this eagle ULP orogram while your schema is open, select the last option, select the checkbox and run. It will create a library with all the parts used in your schema. You can then modify the parts in the library and use them using the 'change' tool.https://github.com/zapta/linbus/blob/master/tools/eagle/exp-lbrs-filter.ulpAs for PCB fab, OShpark ships free internationally. It costs 5$ per three boards 1 square inch each, double layer, double solder mask and silkscreen on the top layer.http://support.oshpark.com/support/solutions/articles/123330-shipping-information-and-turnaroundEven if you don't use it, upload your file there and it will show you how your board looks, I found more than one 'aesthetic' error this way.Also, Dave have this directory in case it helps.http://www.eevblog.com/wiki/index.php?title=PCB_Manufacturers

author: johnk
author_rank: Contributor
timestamp: March 02, 2014, 10:08:15 pm
content: Thanks again!I'll definitely take a closer look at OShpark.[EDIT:] Just for fun I've uploaded my layout to OSHpark (seems to be an amazing website/project btw.) and the copper-layer looks weird. Should I take this as a real problem?

author: zapta
author_rank: Super Contributor
timestamp: March 02, 2014, 10:48:55 pm
content: This is how one of my boards with ground plane looks on OSHParkAlso, the text looks mirrored, is it intentional? (or is it a view from the bottom?)

author: free_electron
author_rank: Super Contributor
timestamp: March 02, 2014, 11:00:31 pm
content: if you move r1 closer to the connector you can get rid of the square jumper via's to connect your ground.rotate r1 horizontal , move close to the icd connector

author: senso
author_rank: Frequent Contributor
timestamp: March 03, 2014, 01:33:58 am
content: Only about the OSH park doubt, in all my bigger boards yes, the cooper render always looks like that, its a limitation or simplification of the code that generates the render and displays as that, but the output is perfect and solid ground.

author: johnk
author_rank: Contributor
timestamp: March 03, 2014, 10:31:39 am
content: Thanks senso. One problem less to be worried about.I've now slept a night over it, dreaming about OSHpark and decided to tweak the design (2-copperlayers + 1 siliconlayer) for OSHpark. The prices are too good to not try them[EDIT:] All right now I've spend a few hours to tweak the board (I also managed to make it a little smaller=cheaper)I think it should be ready to go to OSHpark now.There's only one little problem left: The values of the components are not on the silkscreen, but that's not really important anyway.

author: M4trix
author_rank: Frequent Contributor
timestamp: March 03, 2014, 03:01:14 pm
content: Speaking of which, OSHpark doesn't mention anything about the soldermask they are using. What type, what color, can you choose a different color.

author: Frost
author_rank: Regular Contributor
timestamp: March 03, 2014, 03:07:28 pm
content: Quote from: M4trix on March 03, 2014, 03:01:14 pmOSHpark always use their special purple soldermask.

author: M4trix
author_rank: Frequent Contributor
timestamp: March 03, 2014, 03:19:41 pm
content: Only purple? Hm, not my favorite color for PCB's. Let's say green should be the default color. Thanks Frost.

author: zapta
author_rank: Super Contributor
timestamp: March 03, 2014, 04:01:44 pm
content: Quote from: M4trix on March 03, 2014, 03:01:14 pmAny color that you want as long as it's dark purple ;-)Everything about OSHPark is deep purple, the website, the boards, the envelopes they ship the products, and probably the music they play at the office. Very effective branding IMO. Should be renamed to OSHPurple.Dave and Chris interviewed the proprietor on the Amp Hour, you can hear it herehttp://www.theamphour.com/the-amp-hour-149-purple-pcb-philosophy/A small OSHPark trick, if you place text on the solder layer you get beautiful golden letters on dark background, like the bottom of this one:

author: M4trix
author_rank: Frequent Contributor
timestamp: March 03, 2014, 04:19:51 pm
content: Thanks zapta for those purple infos.

author: Clear as mud
author_rank: Regular Contributor
timestamp: March 12, 2014, 05:31:03 pm
content: Someone already mentioned it, but the diode really doesn't have to be that big. Because it is used only as protection when switching, it will not have current through it most of the time. Your 3 amp diode is rated for 3Acontinuouscurrent. What you want is a diode that can handle a quicksurgecurrent of 2 or 3 amps. Check some data sheets, but you should be able to use a diode that is rated for much less than 1 amp of continuous current.Out of curiosity, I checked the data sheet for a 1N4148.http://www.fairchildsemi.com/ds/1N/1N4148.pdfIt is rated for a continuous current of 200 mA, but can handle a surge of 1 amp for one second, or 4 amps for one microsecond. You probably want something a little bit bigger than that, but you can do the calculations or estimate to figure out how long your surge current lasts.