First PCB design, am I missing anything?

Hi Everyone,

I've been getting to know KiCad for the past few weeks and getting some help from their forum as well. I think I have something that should work, but I don't have any technical education.

I'd be most grateful for any pointers or tips regarding my design!

The goal is to make a hat for the Arduino Giga R1 that let's me connect sensors on the I2C and digital pins, run 2 sets of fans with PWM outputs and has a small TFT and joystick interface. Also saving my settings to EEPROM, using the RTC with NTP updates for timekeeping and muliple sensors for redundancy. At the moment I have this protoboard connected with most of the things soldered on top and it's been working for a while now, connected to a USB-C power supply. I'm not running the fans yet though.

As it stands I have the layout and connectors worked out with some decoupling capacitors. My main question at the moment is should I add another big capacitor between the barrel jack and the Vin connection to the Arduino? I'm not sure if I'll use 12v or 24v to power everything.

Since the Arduino can handle 24v I'm considering adding another connector to power a LED light unit I already have (specific spectrum).

Anyway, here is what I have:



KiCad project:
APC_PCB_2.zip (678,1 KB)

1 Like

I see you're running I2C out on two RJ12 (6P6C) modular cables. Have you explored the length limitations of I2C, and have you tried your implementation under less-than-ideal conditions? I2C is generally recommended for on-circuit-board, less than 1m applications, though you can get longer than that in some circumstances(for example, running the bus at less than normal clock rates...).
Not directly a PCB comment, but not much point in making a PCB for a project that will fail regardless.

I had not accounted for this, so great tip!

At the moment I have 1 DHT22, SHT31 and BME280 connected on 15 cm cables and another set of those 3 connected with a Cat. 6 UTP cable of about 2 meter (connectors cut off and soldered on pin headers). The readings seem to be similar enough, each sensor polled every 2 seconds. If I get NAN returns the readings will be printed in red, wich I haven't seen so far.

Does this mean I'm alright at the moment or is the current situation not an indication of any underlying problems?

edit: in the 3D render you can see the break-away part on the right, it's designed to hold 3 sensors and be connected to the 6P6C (RJ25) connector. I'm expecting the cable lenght to be about 1,5 meter.

There are some barrel jack power supplies with inverted +/-, so you could add a protection diode in series (between barrel jack and Vin). It's also good to have one led on pcb for indicating power - ON.

"it depends", is unfortunately the best I can say. At a minimum, I would attempt a configuration with at least 2x the length of your final installation.
To improve your chances of success,

  • strengthening I2C pullups by lowering resistance(your design has none that I see, so you're dependent on those added by your device manufacturers, a bad move; I'd put 2.7K on each signal as a start),
  • consider adding an LTC4311 to your design(can always leave it off until needed)
  • keep SDA and SCL away from each other by routing GND between them to reduce crosstalk

The diode would sit between the GND of the barrel jack and the Vin, correct? not a bad idea, I'll have a look. Although I've never seen an inverted power supply it doesn't hurt to apply.

The Arduino underneath has 2 LEDs I'm using to indicate on or off and wifi status, it's at the edge so good visibility.

This is a new concept for me, so thanks!

If I understand correctly I can put a 2.7K ohm resistor between the V+ and the SDA and another one from V+ to SCL for better performance? And if I'm not getting good data I could lower the resistors.

Can I reduce crosstalk by putting SDA and SCL on opposite sides of the PCB or is it simply better to have the gnd plane between them on the same side?

And I'm looking into the LTC4311. Thanks so much for educating me on this!

edit: after reading about the LTC4311 I'm assuming it replaces the pull up resistors?

Two options.

  • Reverse-biased, across the incoming supply between GND and +, so that if a reversed-supply is connected, the diode is forward-biased and acts as a short-circuit. Not foolproof, as it could simply sit there and radiate heat, with the supply clamped to 0.6V and furiously pumping out current, but eventually you'd figure it out(burnt fingers, possibly).
  • In series with V+, as was described, so that it's reverse-biased if a backwards supply is connected. This is safest, but results in a full diode-drop of lost power in normal conditions. You may or may not care.

yes; bear in mind, I2C is nominally spec'd for 3mA drive(don't have a reference, it's out there), so you shouldn't lower the resistance too far; keep your eye on what pullups exist on I2C modules you connect, as they'll be in parallel with the ones you put on your board.

both are improvements, the opposite-sides arrangement only marginal. What you're trying to prevent is long runs of two conductors in close proximity, where changes on one are 'picked up' and appear on the other. Unfortunately, putting both signals on adjacent wires in a flat cable like the RJ series use is a worst-case. Put your power and ground between SDA and SCL, at a minimum.

Yes, it would normally do so. I would suggest simply reserving room on your PCB for both, as depending on your circumstances the LTC4311 may be overkill, but leaving room for it is cheap insurance. It's not a cheap component, so there's savings to be had if it's not needed. That consideration is tiny in a one-off project, but if you intend to spread this project 'like butter' the savings could add up. YMMV.

No, in series , between barrel jack + and Vin.

Hi,
Rather than screen capture, KiCad should have an EXPORT facility to make jpg images of your pages.
Look under the Files tab for EXPORT.

Definition of your pages will be so much better.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

  • Indicator LEDs are nice to have.

  • Confirm trace widths between pads.

1 Like

Hi, @arneko

:+1: :+1: :+1:

As are some test points like gnd and power supply and signal points.
You may/probably will, have to trouble shoot at some stage so think about how you will trace signals.

Tom... :grinning: :+1: :coffee: :australia:

I did make 2 test pads at the top right, I figure since most things are pins I can test there without much trouble.

@TomGeorge
I don't see the option to export to jpg though

Do you mean clearance for manufacturing?

From what I was able to find all sensors (SHT31 BME280 and DHT22) have a 10K pull up resistor onboard.

It's for personal use, so I might as well spend the few extra bucks to have the peace of mind.

I was planning on putting a RJ25 connector on a Cat6 cable with twisted pairs. Matching SDA with GND and SCL with either V+ or an unused wire. But I'll check the PCB and see what I can do for the routing on there.

I've put some space between SDA and SCL and added vias so both sides could be filled in with the GND plane. Is this acceptable?

Thera are few places with too small clearance, for my taste, between some pads and lines and you have space to move them apart..

Ok, as I understand, you want to supply the main board and your shield, via barrel jack on the shield?

Understood, I'll have a look. ATM I've used 0.4mm lines where I can. Is it best to keep 0.4mm tracks or, if it improves clearance, reduce this to 0.3 or 0.2mm?

The barrel jack powers the Arduino and the Arduino powers everything else. If I do add the 24 or 12 V connectors, these will be supplied from the barrel jack, not the Arduino.

Yes

I found a LTC4311 I can order here, found a custom symbol and footprint here and added them to the schematic and PCB.

It's much smaller than I thought and I've placed it where it would be most convenient but I feel I'll get reprimanded for it :grimacing:

(top left of the PCB, directly between the SDA and SCL lines)

update with the current state of things:

After looking into the JLCPCB assembly service I've decided to try and convert everything to SMD and make some final adjustments.

I've added a 22 uF cap to complement the 100nF caps after I read something about high and low frequencies. Not sure if 22uF is correct, or if the placement is good though...

Also still wondering if I can get away with the LTC4311 placed like it is in the top left.


For production I had to add pin headers to the PCB, but this results in about 500 DRC errors. I suppose I can fix those by adjusting the schematic but that seems like a nightmare. Is that somehow fixable by using a bus?

Total project including BOM and almost finished pick&place file: APC_SMD.zip (997,9 KB)