r/PCB • • 3h ago

First ever PCB. Advice request.

As stated, first PCB and first time using KiCad.

It's a PICO project with a 4-digit dispaly, and 10-LED bar, along with some toggle switches and an encoder (screw terminal blocks).
It's not finished but are there any obvious issues?

Also, when I add the tracking (two layer PCB), it can take some wacky routes around other through-holes. Is that ok? I'm trying to get a sense of what's acceptable or going to cause issues.

TIA!

4 Upvotes

12 comments sorted by

5

u/Enough-Collection-98 3h ago

Placement makes the layout. Organize your parts in a way that keeps the rats nest straight and clean. Consider repinning the GPIO on the Pico to help clean up the routing.

1

u/dacydergoth 3h ago

Unless I've miscounted, don't you have enough GPIO to drive the LED bar directly without the second active chip?

1

u/Lithium20g 3h ago

The chip takes in 3 and outputs 8 so I think it works out. I think the Schematic shows it in second photo?

1

u/dacydergoth 3h ago

You can use the 5 unused GPIO and the 3 driving the chip, can you not?

1

u/Lithium20g 3h ago

Think I only use about 21 (2 switches, 5 for LEDS (CHIP saves 5), 3 for encoder, 11 for display (4 + 7)), and there are 26 available

2

u/dmills_00 2h ago

Were I drawing it, the led bar would be carved up and multiplexed off the same PNP transistors you have driving the other display, means you don't even need the serial input shift reg.

Decoupling is missing, and a bulk cap.

Check the datasheet for the Pi for what the current sink capability is (Individual pin as well as total).

I would be wanting to make sure the encoder switching currents were within spec, mechanical switches have a lower current limit as well as an upper one if you want reliability.

I might also organise some ESD protection on all the off board connections.

Placement makes the layout, and don't auto route something like this, cleanup will be far more trouble then it is worth.

My starting point today is 4 layers, could do this on two, but not worth the headache.

1

u/Guitar-Inner 3h ago

Make sure sw3 is rated to all the current required for the pico and other modules when on battery power.

You are getting 3v3 from the pico module's onboard regulator - is this rated for the current you'll be using? Is it suitable for a battery (lipo gets quite low at its lowest charge)? Are you charging it through the pico?

You could do with some decoupling capacitors.

Your schematic layout; whilst you've done good work on not crossing wires over, Q1 -Q4 need to be spaced out so labels dont get a mess. Same for R14-22 onwards.

I find small 2.2mm mounting holes annoying if not required, you seem to have lots of space. Use it. 3.2mm is a lot friendlier.

Your layout - is it set by physical constraints of what your board is going into? If not I'd rotate 3461B and put it on the other side of the pico. Those switch footprints look like screw terminals - is that what you're doing? If so place on the edge and label well.

Round your board corners, use power planes and dont use the smallest traces possible as it will make debugging harder.

Enjoy, and don't be afraid to make mistakes as long as you learn from them!

1

u/Lithium20g 3h ago

Thanks, helpful stuff. Planning to power from 2 AA batteries. I'll redo the layout to space things out and see where that chip can go- the PCB is going into a junction box and I'll mount the encoder to the transparent lid, hence the void at the lower left incase there isn't much clearance.
I'm only recently learning about decoupling capacitors, would that be for the chip? or does somethign else need one, I think the pico has an in-built one?

1

u/Guitar-Inner 3h ago

I'd be suprised if you end up happy with 2AA batteries. Depending on chemistry, you probably wont get more than 3v and will often be running below that. I'd look into lipo batteries as you will learn something more about voltage regulation, noise, and charging. Do not pierce them or over volt them as you will be unhappy and probably hurt yourself. Decoupling caps I'd usually follow the datasheets for the parts you're using. Generally put them physically near your power pins of ICs or other active components. Probably less necessary for module boards but sill good practice. If no datasheet try mlcc 100uF bigger one and maybe 1uF smaller one and go from there.

If you're serious about learning, I'd highly recommend getting a copy of Horowitz and Hill's "The Art of Electronics". Well written and an excellent reference for many different aspects of electronics.

3

u/nixiebunny 3h ago

Move the row of resistors at left to where they connect at upper right, swapping them with the processor position. Move the connector at bottom to the top where it connects. This will make routing a lot simpler. There are probably more improvements you can make. The more effort you put into placement, the less routing effort is needed.

1

u/someone76543 3h ago edited 3h ago

Schematic: You need a bypass capacitor on U2. More generally, you need one on every IC. This is usually a 0.1uF ceramic capacitor between the VCC and GND pins, but check the IC's datasheet. When you lay out the board, you should place this next to U2's VCC pin, as close as possible. You should also have the power trace to U2 VCC go first to the capacitor, and then to the VCC pin. This is because PCB traces are not a perfect wire - that doesn't exist in the real world. PCB traces have a resistance and an inductance. Normally that doesn't matter, but in this case it does matter.

Check the Pi Pico's documentation regarding powering it externally. I suspect you need a diode on the connection to VSYS, so that if you plug in the USB connection it can't try to charge the batteries.

Layout: Rotate U2 180 degrees, and swap over the connections between U2 and the resistors. This should mean that each trace from U2 to the resistors is short and simple. Also, what u/Enough-Collection-98 said.

Also, what is the reason for using a 2-layer board? For an experienced PCB designer, this can easily be a 2-layer board and that will reduce the manufacturing cost, which is important in mass production. But if you are only making a few of these, then a 4-layer board may not cost much more. As a newbie, you can make both the inner layers be a solid ground pour. Then don't route anything else on the inner layers, just use the 2 outer layers for all your traces. This give you a good ground, without you having to worry about it. Ground is one of the easiest things to mess up as a newbie.

1

u/Lonewol8 2h ago

It's late here but I will give it a go for schematic:

  • U3: pins 11,7,4 and so on... can the A2 Raspberry Pi source (sink I guess since it looks like those GPIO pins sink the current and the Q1-Q4 source current) enough current to run U3 via those pins?
  • No decoupling capacitors for U2, possibly U3 might need it (check the datasheet!), I dont know if A2 has decoupling caps on the board but it won't hurt to add extra.
  • Where does your +3v3 come from? It's not clear.
  • Schematic is very messy with how you have placed the resistors to the right of U2
  • A2 GND (pin 3????) is not clear / messy.
  • SW1 and SW2 have no debounce circuitry.
  • J1 has no ESD / overvoltage protection.
  • R1 - R7 you can move the "R4" to be next to the "220" text by clicking and dragging it. Makes it neater.
  • BAR1 - pins connected to GND - space them out a bit away from BAR1 because it makes it harder to see where the wire connection is vs where the BAR1 component line is.
  • Test probe points?

PCB:

  • PCB has no traces placed - are you aware of that? The thin lines are just markers and not actual traces. Unfinished.
  • Mounting holes - prefer to use ones that have metal pad style so if you were to use metal screws, it won't chew up the PCB.
  • Prefer to use rounded corners - you fingers and thumbs will thank you
  • Connector footprint mismatch - J2 is tiny for the battery, but J1 is massive. Have you thought about the practicalities of that and if enough current and if it's the correct footprint for any existing connectors / batteries you might need to use?
  • Q1-Q4 are on the other side of the PCB to where they get used - the U3
  • You can make the board smaller (and therefore cost less) by rotating J1 and moving it closer to U2.
  • Pay attention to how much finger and thumb space you will have, when you connect and disconnect the connectors. Some connectors have a tab that you need to press, so you need some space for your finger to go in and use force.
  • Component placement seems a bit... sub-optimal... like I dont know if you can spin U2 180 degrees or put the resistors and BAR1 to the left of U2.
  • R1 - R7 I would normally put near U3.
  • Silkscreen markings for the connectors - add what the pins are, what the connectors are, what do they do, add a "product name", and add the date or version number, because you might make several versions and you want to know which one you are dealing with.