Electronic – First SMD Design Comments / Input before Manufacture

atmelpcb-designschematics

Just designed my first "real" PCB that I plan to send out for manufacture in the next day or so. I've milled out a few on a 3018 CNC. I wanted to do this one that way as well, but realized it would have been a bear to make DIY and mostly THT wasn't the direction to go. So, this is my first mostly SMD PCB with standalone ATMEGA328P-PU on a PCB at least. I used Diptrace initially, but then switched over to EasyEDA since I plan to send it to JLCPCB for the best cost and all their components from LCSC have the included the PCB footprint. (Side note: I wasn't looking forward to switching at first, but the component selection with included pattern was a real treat with EasyEDA compared to Diptrace).

Purpose:

This should actuate servos to control water flow to "zones" based on the feedback from the sensors of soil wetness.

I am a complete novice to this, but I think that the design is close. I learn by doing and iterations, so here goes. I figured you guys love this stuff and it is second nature to you, so I am all ears for any general feedback, criticism, and design improvements in general that I will take to my future PCB design endeavors and use this one.

The PCB Layout:

the components on the right will be exposed from the enclosure for user feedback, and the JST XH connectors are for the sensors. There is a DC 5.5 x 2.1 plug for a 12V 1A DC adaptor in top left. Key 1 is a "test" button that I plan to use to prime this thing. SW1 is the power switch. The U components connect to sensors for feedback that will be evaluated in the code. The H headers are connected to servos that respond in accordance with the settings provided by R1, R2, R3. H4 is ICSP header for programming. P1 is the motor. I increased the mil trace to 15 mils for the power and ground lines. U2 is the 5V regulator.

Edits: Added ground plane, moved decoupling capacitors for the MCU closer to their point-to-point, added some decoupling capacitors to the adapter feed. Increased trace widths to 24 mils (same as via diameter). Removed interior mounting holes that were too close (shouldn't be needed).

enter image description here

Specific Questions / Schematics:

enter image description here

Mid Schematic

Osc / MCU / ICSP

Test / Reset Pullup

  1. Is 4 and 5 for SW1 like chassis grounds / PCB grounds? I can just leave them unconnected right?
  2. Do you see U2 having any issues with regulating the 12V 1A supply for the 5V Reg that is provided downstream to all the other applicable components? In breadboard testing, amperage never really exceeded 500mA, but since the supply could provided 1A, I chose a "larger" package regulator. MC7805BDTRKG – Datasheet
  3. Oscillation, Stabilization, and ICSP look correct?
  4. The test button will pull PD7 (Test Net Port) to ground when depressed right and 3, 1 can remain unconnected?

Thanks in advance!

THT Layout:
enter image description here

Best Answer

enter image description here

#1-#8 beware of the autorouter routing traces really close to pads or at awkward angles, if the pcb fab is cheap and the soldermask is a little off, the track that is close to the pad could be uncovered and you get solder bridges. It costs nothing to space your SMDs (#5) a bit more, or push some traces around.

#8 without heat sinking, this 7805 won't be able to dissipate the power you intend. If the 1A load is frequent, I'd use a switching converter for efficiency and convenience of not having to bother with a heat sink. In fact it would probably be much simpler to power the whole thing with a 5V wall wart.

#9 The vertical barrel connector could make plugging connector #10 awkward.

If the three headers on the right go to analog inputs, then they need at least some filter caps. Possibly ESD protection.

When putting mounting holes, use pads instead of holes and make the pad a little bit larger than the size of the head of the screw you'll put in. That way you'll easily see if the screw head collides with something. If you use plastic standoffs that only take space on bottom layer, still a good idea to define a keepout zone to prevent a SMD from ending up in the wrong place.

I don't see any caps on the xtal.

GND routing uses the same thin traces for pots (presumably analog) and servos, could add noise to analog signal.

Image resolution is too low and bottom layer is not readable.

Placement of decoupling caps is no good, again beware of autorouter, it will route GND and VCC all over the place and say "done!" and then you get long inductive traces and therefore problems. The purpose of a decoupling cap is to reduce supply impedance at HF, and long inductive traces do the opposite. If you have a ground plane on the back, connect your decoupling caps to it with vias.

An extra 10 ground vias would remove lots of traces from toplayer, maying routing easier.

...and don't be afraid to put an electrolytic cap like 100µF on the power input... it costs 10 cents...