Another "seeking advice on first PCB design"

Looking for advice, pointers, or big no-no's I may have done on my first PCB design. The general operation of the board is to interface with a vehicle exhaust valve by looking up values on the microSD card and monitoring vehicle status over CAN. An nano is used to control all of this along with a basic mosfet step up from a 5V to a 12V pwm control signal.

The board is basically a few sub-circuits typically found on small breakout boards that are combined onto a single PCB. On the PCB, the upper right contains the adafruit microSD circuit. On the lower right is a generic MCP2515/MCP2551 vehicle CAN interface. In the middle is a connector for a breakout panel to some LEDs and a button. On the right is another connector that will go run out to the vehicle valve, power, and CAN lines.

In general, 12 mil traces were used for all signal wires, 32 mil trace for main power in, and then 24 mil for all power/grounds aside from the main power in wires.

eagle_files.zip (111 KB)

Use a ground pour, not traces for ground - this makes a better ground, and greatly eases routing. Use the polygon tool to draw the outline of the pour (eagle will handle clearance from holes, traces, and board edges), and then click one of the edges with the name tool and change it to the name of your ground net (which you should name GND, but probably haven't because you say this is your first PCB)

Where is power coming in? How is it supplied? Be particularly careful when powering something from automotive 12v supply, as the voltage on it can be significantly higher than 12v when the battery is fully charged, and it is notoriously noisy, with large spikes.

DrAzzy:
Use a ground pour, not traces for ground - this makes a better ground, and greatly eases routing. Use the polygon tool to draw the outline of the pour (eagle will handle clearance from holes, traces, and board edges), and then click one of the edges with the name tool and change it to the name of your ground net (which you should name GND, but probably haven't because you say this is your first PCB)

Where is power coming in? How is it supplied? Be particularly careful when powering something from automotive 12v supply, as the voltage on it can be significantly higher than 12v when the battery is fully charged, and it is notoriously noisy, with large spikes.

Thanks, I started off using ground traces (the ones you see) and then had the major "DOH" moment and did a ground fill for the remaining half. Didn't include that in the picture though since it makes everything else hard to see. I should really go back and remove the first half of ground traces and do it all with the pour like you said though.

Input power will be coming from the vehicle, but it fed to the recom r-78E9.0-0.5 for constant 9v to the nano and then branches off 5v/3.3v from there. This setup hasn't appeared to have any power spike issues on the prototype breadboard versions (probably just jinxed myself).

Wiring on the red activity LED is wrong too.

Don't level shift it, and CS is active low, so you want the negative side of the LED connected to CS before the level shifter, through a 1k resistor, with other end tied to 5v.

Don't feed the nano with 9v, feed it with a regulated 5v direct to the Vcc pin.

Thoughts on the layout;

I would consider moving the input connector to where U1 is and moving the U1 etc up to next to the SD card. It just seems the major input traces end up at the bottom of the board.

Where ever the input connector lands, you need to add 0.1µF from each input pin to ground. You need to have the resulting "cluster" in a very tight layout. You should also have your regulator in the same area, keeping all the "power" components close to each other with a ground plane around it (i.e. the above mentioned ground pour)

On your led and button I/O you will need to put capacitors resistors and a zener on each one. If not you will slide across the seat touch a button and the ESD will fry your Nano.

Automotive +12V has some nasty characteristics. There are fast high voltage spikes and some lower longer ones. It also runs from 8V starting to 15V (intermittent) charging. Can your regulator handle the power at the higher voltages?

John

I'm not a board designer but I've worked in electronics a long time and I have a couple of comments & suggestions -

Try not to "push" the manufacturer to their limits on trace widths, gaps, or vias. It's easier to make a board with fat traces with plenty of space-in between. You are less likely to get a defective board, plus you are less likely to create a solder bridge or to damage the board during soldering/assembly/testing.

Of course, you also have space/layout limitations so you can't always make the traces as wide as you'd like, but don't make them too small unnecessarily just because the manufacturer says they can do it...

Board fab defects/rejects are not that common, and usually the whole batch isn't defective. And usually the manufacturer does some inspection & testing so the customer rarely sees the defects. But, at "hobbyist prices" you're not paying for a lot of quality control and manufacturing defects do happen.

I think I remember a board design coming-out perfect on the 1st try ONCE, or maybe NEVER. So be emotionally and financially prepared for "rev 2". And if you have a schedule or deadline, allow for that. Sometimes it takes more than one revision. Where I currently work we have a different rev-numbering system for the prototype/pilot phase so we don't even get to "rev 1" until the design & layout is (hopefully) debugged. Then we make any final changes before the first rev 1 production run. Occasionally the "last prototype" is perfect and we go into production with the prototype rev and we don't see rev 1 until some change is made later down the road.

You can have errors in the original circuit design, or you can get layout errors such as opens, shorts, wrong connections, or a layout that doesn't physically fit/match the component. There's lots of opportunity for errors... Sometimes you can fix the board with "cuts & jumps" and sometimes it's back to the drawing board for another revision.

P.S.
I remember once (previous employer) where we had a rush job and we paid expediting fees to have the board fabricated and assembled in a couple of days (some small quantity). Somebody forgot the data bus or address bus... I wasn't involved and the whole thing was just funny to me! No time to do it right the 1st time, but there's always time to do it over!

DrAzzy:
Wiring on the red activity LED is wrong too.

Don't level shift it, and CS is active low, so you want the negative side of the LED connected to CS before the level shifter, through a 1k resistor, with other end tied to 5v.

Don't feed the nano with 9v, feed it with a regulated 5v direct to the Vcc pin.

While I don't disagree with what you're saying, the schematic for the microSD portion (including the red LED), is pulled straight from the adafruit microSD breakout schematic they have on their site (link here). For the breadboard prototypes, I've just been using the prebuilt breakout cards with these connections to a nano and everything has been working.

Regulating with 5v does make a lot more sense. Take load off of the nano regulator and already have a regulator that's sole purpose is powering the nano. The main reason was that I have a bunch of the 9v regulators on hand, but it would be worth it to buy the 5v versions. Swapping in a 5v regulator would also help clean up a few extraneous traces as well.

JohnRob:
I would consider moving the input connector to where U1 is and moving the U1 etc up to next to the SD card. It just seems the major input traces end up at the bottom of the board.

Where ever the input connector lands, you need to add 0.1µF from each input pin to ground. You need to have the resulting "cluster" in a very tight layout. You should also have your regulator in the same area, keeping all the "power" components close to each other with a ground plane around it (i.e. the above mentioned ground pour)

On your led and button I/O you will need to put capacitors resistors and a zener on each one. If not you will slide across the seat touch a button and the ESD will fry your Nano.

Automotive +12V has some nasty characteristics. There are fast high voltage spikes and some lower longer ones. It also runs from 8V starting to 15V (intermittent) charging. Can your regulator handle the power at the higher voltages?

I agree, moving U1 up and the input connector down would clean up quite a few connections.

On the "input connector", the only real inputs are the input +12v vehicle power, vehicle CAN_High, and vehicle CAN_Low. The "+12v" and VLV_PWM pins are actually outputs to the exhaust valve. So the input VEHPWR_IN+ needs a 0.1 uF to ground. Do the incoming CAN_High and CAN_Low lines also need these caps since they aren't power traces?

Do you have any schematic examples of the resistor, cap, zener protection? The RC filter part of it makes sense, but I'm seeing a few different setups with standard zeners and TVSs and don't know how their performance compares.

The regulator should be fine - input voltage specs from 8v to 28v.

DVDdoug:
Try not to "push" the manufacturer to their limits on trace widths, gaps, or vias. It's easier to make a board with fat traces with plenty of space-in between. You are less likely to get a defective board, plus you are less likely to create a solder bridge or to damage the board during soldering/assembly/testing.

No time to do it right the 1st time, but there's always time to do it over!

Fair enough. I don't have any real hard size limitations on the board, so it's definitely doable to add a little more space between traces and maybe widen them up a bit.

::slight_smile: and I thought it was just the company I work for that operates in that manner! Never enough time at the start and the 0.01% cost increase for the more robust part isn't worth it.........then when part A doesn't work out near the finish line, it's a rush to fix it and end up paying 50% more for part B that would've only been a 0.01% cost increase at the beginning.

Working on including the changes and improvements suggested here and I'll post an updated version when done for further review.

dtbingle:
Regulating with 5v does make a lot more sense. Take load off of the nano regulator and already have a regulator that's sole purpose is powering the nano. The main reason was that I have a bunch of the 9v regulators on hand, but it would be worth it to buy the 5v versions. Swapping in a 5v regulator would also help clean up a few extraneous traces as well.

Don't get a linear regulator: you have to drop 7V to get from 12V to 5V, that's a lot of heat to deal with!

Instead look for buck (step-down) converters, much more efficient, and they can easily deliver 1-2A without breaking a sweat. A linear regulator needs a good heat sink to do the same.

wvmarle:
Don't get a linear regulator: you have to drop 7V to get from 12V to 5V, that's a lot of heat to deal with!

Instead look for buck (step-down) converters, much more efficient, and they can easily deliver 1-2A without breaking a sweat. A linear regulator needs a good heat sink to do the same.

Something like this?

Something more like this: dc-dc step down for sale | eBay, Pololu - Step-Down Voltage Regulators or https://www.digikey.com/products/en/power-supplies-board-mount/dc-dc-converters/922?k=&pkeyword=&sv=0&pv183=6782&sf=0&FV=ffe0039a&quantity=&ColumnSort=0&page=1&pageSize=25
Ebay parts are cheaper, but bulkier and of generally cheaper design (you should also derate their max current by about a third).

Don't try to design your own DC-DC converter on your first pcb design. DC-DC switching converters are highly layout sensitive.

pcb .png

sch1 .png

sch2.png

DrAzzy:
Something more like this: dc-dc step down for sale | eBay, Pololu - Step-Down Voltage Regulators or https://www.digikey.com/products/en/power-supplies-board-mount/dc-dc-converters/922?k=&pkeyword=&sv=0&pv183=6782&sf=0&FV=ffe0039a&quantity=&ColumnSort=0&page=1&pageSize=25
Ebay parts are cheaper, but bulkier and of generally cheaper design (you should also derate their max current by about a third).

Don't try to design your own DC-DC converter on your first pcb design. DC-DC switching converters are highly layout sensitive.

When you say "highly layout sensitive", what are the consequences of a poor layout? Does voltage become less regulated? Current capacity reduction? Lots of noise?

Actually looking at the LM2596 instead of my original post with the LM2678. The LM2596 seems to be the IC of choice for those cheap DC-DC bucks. The datasheet (here) has a "typical application", which looks almost identical to the ebay buck boards. What about just using the PCB layout of the cheap boards, but integrating onto the main PCB?

Ensure ground and power traces are wide, especially between a chip's pins and the nearest ceramic decoupling capacitor - this reduces stray inductance between chip and capacitor helping the decoupling be effective, and its
really handy when checking a board as the power traces are obvious to follow. Logic signal traces should generally be narrow for low-capacitance.

Check the board completely afresh before ordering - its really easy to get over-ethusiastic doing a layout and only later realize you forgot a connector, or power to some chip!

Check every device has all its power.

Check every pin that should be connected is connected on each device and connector
The electrical rule check should identify unconnected inputs - they are usually a problem, fix it. You have a 4050 with floating inputs for instance.

Run a design rule check always.

Make it easy on yourself for commisioning a board - add test points to important signal traces (even a single
via can serve this function - wire from a CAT5 cable will usually just fit vias and enable a 'scope probe to temporarily clip onto the signal. This is an argument for using vias free from solder-mask.

dtbingle:
When you say "highly layout sensitive", what are the consequences of a poor layout? Does voltage become less regulated? Current capacity reduction? Lots of noise?

Actually looking at the LM2596 instead of my original post with the LM2678. The LM2596 seems to be the IC of choice for those cheap DC-DC bucks. The datasheet (here) has a "typical application", which looks almost identical to the ebay buck boards. What about just using the PCB layout of the cheap boards, but integrating onto the main PCB?

Consequences: All of the above, plus reduced efficiency.

Yes, you could copy the layout (that's what the Chinese did for those modules). When you see the price of new LM2596 compared to the assembled modules from china, you may change your mind :wink: - I'm not sure if the '2596's in those are counterfeit, or if they just get a much better price than we do for the chip. BTW the LM2596 has no short protection. If you short the output, the LM2596 chip cracks open and emits smoke and sometimes a brief puff of flame, it's somewhat impressive.

Again, consider the linear regulator replacement parts I linked from digikey - they are not that expensive for low current units, and dead simple to use. That is probably what I would do if I wanted a dc-dc converter on a board and wasn't doing something wacky that precluded using such a module (I've made my own boost converters on a PCB when I needed specs I couldn't get from an assembled module, and for my ATtiny43 breakout board - the '43 has an integrated boost converter, just add inductor, diode, and caps - it's just a pain that's usually not worth the effort)

On a different topic - I default 16mil traces for signal lines unless I'm working with a fine-pitch part where I need to use thinner traces.
Be sure to get the design rules for your board house - most will supply an eagle DRC file. The default eagle design rules are not typical.