My first PCB, see anything wrong?

Hello,

I’ve breadboarded my project based off the schematic and it’s working as intended. Going by what I’ve read here, I’ve tried to implement all the suggestions requirements into my PCB design. The board is about 2"x4". The n-channel mosfets are located where they are because I didn’t see a component in the sparkfun library that had the mosfet lying down like the PNPs. I plan to mount them the same as the PNPs. I let the autorouter do the work but specified 32mil for all the traces with a 16mil routing grid. I tried to miter the 90deg turns out as much as I could. The mounting holes for the PCB may not be used, but if they are, I plan to use non-conductive nylon screws.

Thanks

http://hemiclub.com/project/project-schematic.PNG

Schematic was cut off on right hand side, here’s a link: http://hemiclub.com/project/project-schematic.PNG

http://hemiclub.com/project/project-board.PNG

Some nice thick tracks there, have you run a DRC (Design Rule Check) ??

I get two errors:

http://hemiclub.com/project/drcerrors.png

The first error is pointing to the connection on the left of the BATT DIODE. It looks like the blue trace is low on the connection point but maybe that’s just the software.

The second error points to the date (the backwards 03-26-2012) on the right side of the board. I put that date in like the tutorial mentioned I should. I can just as easily have it silkscreened on the front somewhere if that’s not going to work.

Okay, I fixed the first width error. I somehow had a short 16mil trace amongst the rest of the bigger ones.

I re-ran the DRC check and the only width error left is the complaint about my date being on the back of the board. But now I have a bunch of “Stop Mask” errors like the following complaing about the silkscreen(?) on the middle pin:

http://www.hemiclub.com/project/drcerrors2.png

the blue tracks coming out the right of the pic look very close to pins above them, perhaps better to come out straight then angle up.

The blue tracks at the top of the board - can you space them apart a little more?

Just being picky :slight_smile:

Thanks. I spaced them further apart and was able to get at least 16mil separation (wire to wire, pad to via, wire to via) for everything.

It must be a top notch design since no one else has chimed in. LOL

I think I’ll send it off and see how it turns out. :slight_smile:

I have not worked with the Picaxe, but here are a few suggestions:

Schematic:

  • Add a 100n cap to ground from each power pin of each chip. On the board, it should be located as close as possible to the power pin

  • Wouldn’t you be better off using FETs to switch power?

  • Is it necessary to switch Vcc1 on the L293? With the chip disabled, typical draw will be 8mA. This way, don’t forget to drive the enable and direction pins low or Z before turning off power as Vih < Vcc1. Note also that the data sheet doesn’t specify how the part will behave if Vcc1 = 0 while Vcc2 > 0…

  • I would add pulldowns on the L293’s enable pins to prevent problems when the processor is tristated

  • Do you intend to use the solar panel to charge the battery? If so, you may need current limiting depending on your panel. If not, connect it’s diode to the other side of the battery’s diode

  • You may need additional filtering on the processor’s power (or ideally a second supply) to keep motor noise from causing problems

PCB:

  • Traces should meet branch or connect to pads at right angles; acute angles can cause acid traps

  • Traces should bend with 45 degree angles

  • It looks like there are some places on the blue side where traces come very close to pads (left of solar connector, Picaxe pin 14)

  • I’m not a huge fan of autorouters

  • You can route the control signals with finer traces (10 - 15 mils) and ease up on the congestion

  • I would put the L293 next to the motor connector; no sense running high current noisy traces around the board and under the processor

  • Pay particular attention to power and ground routing here as this is a motor driver. Try to make these tracks wide with as few vias as possible to reduce inductance. I’d even consider using a ground pour and trying to keep traces on the other side of the board as much as possible. If using the same power source for both the processor and motor, consider splitting it right after the diode so one trace goes to each

  • It looks like there are mounting holes under the TO220 transistors; you can’t use them if the transistors are mounted flat

  • Create the proper footprints for the transistors; when doing board designs, you always need to create some footprints, so you should learn how. Using the wrong footprint here means that there are no mounting holes for the FETs

  • The 4 ground pins on the L293 are used for heat dissipation; put a copper pour under the chip as shown in figure 7 of the data sheet

  • I like the labelling of the connectors

/mike

n1ist:
I have not worked with the Picaxe, but here are a few suggestions:

Schematic:

  • Add a 100n cap to ground from each power pin of each chip. On the board, it should be located as close as possible to the power pin
Ahh yes, I meant to change that. I have some 0.1uF caps I was going to swap out for the 100uF.

Since I’m switching off L293D with the PNP, I put the cap before the PNP thinking it would be better there than right at the L293D because when I switch it on, it would have to charge the cap in addition to powering on the driver, correct?

n1ist:

  • Wouldn’t you be better off using FETs to switch power?

I had the PNPs, so I was going to just use them since their specs are sufficient for the draw the driver will put on them. If you think it’s critical, I’ll pick up some p-channels.

n1ist:

  • Is it necessary to switch Vcc1 on the L293? With the chip disabled, typical draw will be 8mA. This way, don’t forget to drive the enable and direction pins low or Z before turning off power as Vih < Vcc1. Note also that the data sheet doesn’t specify how the part will behave if Vcc1 = 0 while Vcc2 > 0…

I’m using the SGS-Thompson L293D. With all inputs driven low, power consumption was still around 15mA. By switching VSS off, I get my consumption down to 1.5mA (basically the Picaxe and IR sensor). I want to do this for maximum battery life if we have too many consecutive days of no sunshine. This project will be installed very high and only accessible with a ladder/scaffolding so it will be a real pain if it needs attention too often.

n1ist:

  • I would add pulldowns on the L293’s enable pins to prevent problems when the processor is tristated

Okay

n1ist:

  • Do you intend to use the solar panel to charge the battery? If so, you may need current limiting depending on your panel. If not, connect it’s diode to the other side of the battery’s diode

The solar panel has an open voltage of about 6.3V, I’m using the solar diode to keep the battery from draining power back into the panel at night and the panel behind both diodes as a cheap way to drop the voltage to protect the Pic. It’s main purpose is keeping the batteries charged since it doesn’t have enough current to start the motor.

n1ist:

  • You may need additional filtering on the processor’s power (or ideally a second supply) to keep motor noise from causing problems

The motor draw is only about 60mA free running and 350mA stall. It seems to work fine on the breadboard so I’d rather not complicate things by adding another power source. This will need to be self-sustainable because it’ll be mostly inaccessible.

n1ist:
PCB:

  • Traces should meet branch or connect to pads at right angles; acute angles can cause acid traps

  • Traces should bend with 45 degree angles

  • It looks like there are some places on the blue side where traces come very close to pads (left of solar connector, Picaxe pin 14)

  • I’m not a huge fan of autorouters

So if you don’t use the autorouter, how do you make sure that you’ve connected every trace? The air wires still show up after I’ve manually run a trace. The only way I could see get rid of them was to run the autorouter afterwards and if it didn’t add anything, then I assumed the connection was good… but I didn’t feel comfortable with that so I just let it do the work.

n1ist:

  • You can route the control signals with finer traces (10 - 15 mils) and ease up on the congestion

  • I would put the L293 next to the motor connector; no sense running high current noisy traces around the board and under the processor

Good idea. I think I’ll switch the positions of the PNPs and mosfets and leave the mosfets standing up (clearance down the middle of the board would require they are lying down), then put the motor terminal at that end. I hadn’t planned to mount the PNPs so they were mounted completely flat. I was going leave them up enough to get a short screw in there… but with the mosfets on the outer edges standing up, that’ll make that a non-issue.

n1ist:

  • Pay particular attention to power and ground routing here as this is a motor driver. Try to make these tracks wide with as few vias as possible to reduce inductance. I’d even consider using a ground pour and trying to keep traces on the other side of the board as much as possible. If using the same power source for both the processor and motor, consider splitting it right after the diode so one trace goes to each

I’ll try that if you can answer my question about manually running traces and verification that they’re connected.

n1ist:

  • It looks like there are mounting holes under the TO220 transistors; you can’t use them if the transistors are mounted flat

  • Create the proper footprints for the transistors; when doing board designs, you always need to create some footprints, so you should learn how. Using the wrong footprint here means that there are no mounting holes for the FETs

  • The 4 ground pins on the L293 are used for heat dissipation; put a copper pour under the chip as shown in figure 7 of the data sheet

But there is no figure 7 showing this in the ST L293D datasheet… ahh but there is in the Ti datasheet! Even tho ST doesn’t mention this, that sounds like a good idea. I attempted to use some ground pours in other areas, but had the same issue as manually running traces… how do i know it’s connected and get rid of the errors complaining about “Overlap” when I run DRC?

Thanks a lot for the suggestions Mike.

okay, layout redone and with a ground pour (I figured it out!) on the bottom layer. A majority of traces hand routed:

http://www.hemiclub.com/project/project-PCB.png

That looks better, however the ground pour is very swiss-cheesed; for example look at the path the motor return current has to take to get to the battery connector’s ground pin. I would look into trying to move as many traces to the top side as possible. Rotating the L293 180 degrees may help things a bit. If the pinout on the ribbon connector can be changed, flip B+ to the other side to have all the grounds in a row; rotate the 240R resistor vertically between the two chips to clean up its routing.

As I mentioned, you can reduce the trace width on all the signal traces coming from the PICAXE; this will give more space for routing. I would also beef up the trace from the battery connector thru the motor power switch to the VSS pin on the L293D. Add a space for a bulk capacitor on +5 just in case it’s needed.

Sorry I can’t help with the Eagle issues as I use Kicad and PADS.

/mike

Thanks again for the suggestions. Other than the cap for the motor driver being a little farther away (because of height restraints down the middle of the board), I’m pretty pleased with it. The ground return path for the motor driver does have to loop around the top of the serial connector (or go around the bottom…so atleast it has a couple routes :lol: ), but I honestly don’t see how I could make it any more of a direct path. I think it’s much better than my previous version with a ground pour. :slight_smile:

http://www.hemiclub.com/project/project-PCB2.png

I’d flood the topside with ground as well and “stitch” it together with the bottom with vias

And move those red traces away from the mounting holes.

The screw head can break them or short them out to ground.

Top RH cap (Is that really a 0.1 uf electrolytic?) - bring it down closer to the pins it is feeding.

Your legend does not have ref names on all the components.

Legend Solar, Serial and Switches will be covered by screw head (if your using screws instead of nylon pcb studs).

I do not see a fuse anywhere?

You also appear to have a single via on this board, to get rid of it entirely simply swap the top RH 10k

with the one below it and then rotate it down to cross the red track.

Thanks. I made a few more tweaks. Swapped the two resistors in the upper RH corner like you suggested so I could eliminate that via, so i only have one (below the Pic) now that is unavoidable. I have the screw holes more room, although I’ll probably be nylon/plastic pcb standoffs (push in style). I moved some of the legends around and also labeled the components (r1, c1, etc). I moved the cap for the L293D down to the center so it’s closer…if i have height clearance issues, I’ll just bend it over toward the board. I sent it off for production :slight_smile:

http://hemiclub.com/project/project-pcb3.png

I sent it off for production

Oh dear, after a move around and before anyone can comment to let you know about the mistake you made that will make it not work? lol

Has the final legend also got the little crosses on it obscuring the text?

The other via could be got rid of too but I wont go any further on that as your getting it commercially made.

Well done, I have seen far worse (and I’m not saying yours is bad) from guys that have done far more than one board.

Out of curiosity, where and how much for how many?

LOL thanks for the confidence. haha

BTW, I’m using an inline fuse holder on the wire from the solar panel just in case. The ground pour on the top layer looked like swiss cheese, so Ieft it off. I can now see how I could have eliminated that last via if i swapped some connections around on the Pic.

No, the little crosses aren’t there on the gerbers. I didn’t see how to turn them off to get a screenshot but I didn’t look that hard either (they’re used for seeing the text orientation/snap point in Eagle).

I’m having BatchPCB produce 2 of them, about $28/ea. If they work, I’ll probably get another 4 made (i’m sure after some tweaks) and do more of the windows on the south side of our home.

This is my first electronics project and PCB. I’m hoping it’ll turn out well but realize I still have a lot to learn so I appreciate all the help.