Author Topic: My first complete schematic  (Read 901 times)

0 Members and 1 Guest are viewing this topic.

Offline AnasMalasTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: jo
My first complete schematic
« on: October 22, 2021, 03:40:13 pm »
TL;DR: would you please have a look at this schematic, in case I made mistakes?

Hello! I dont know if this even belongs here, I finally completed the schematic for a board ive been working on for years (learning as I go, and trying to verify every single thing. Normally not the right course of action, I know, but there were reasons).

I'm working on the PCB now, but in the meantime, I would really appreciate it if you had a look at the schematics in case I missed somethin. Thanks :)

Ive had help previously on the forum when I didnt quite grasp some design concepts, I thought to include this in case it is relevant (its a bit embarrassing and very long): https://www.eevblog.com/forum/beginners/low-speed-mosfet-switching-do-i-need-a-decoupling-capacitor/

Quick possibly unrelated notes: some signals arent connected to the microcontroller yet because they will depend on the PCB. The PCB is 4 layer (also my first). It will attach to a Raspberry Pi, This project is a one-off made to stay alive 5+ years after im gone hence the ESD focus. It is right next to an RFID 860 MHz antenna and I dont trust that ill shield it well enough.

(btw, should I add photos in addition to the PDF?)

 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5026
  • Country: ro
  • .
Re: My first complete schematic
« Reply #1 on: October 22, 2021, 04:57:52 pm »
I'm a bit confused by your schematic

why r20 and r21 in parallel for just a couple indicator leds, and why r23 and r24 in series? did you intend those to be parallel as well, or it's just so you won't use a higher resistance value ?

are you sure 470 ohm resistors are proper for scl and sda pins? r25 and r26

you're probably going overboard with the 8.2 pF capacitors on the rgb bit...
 

Offline AnasMalasTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: jo
Re: My first complete schematic
« Reply #2 on: October 22, 2021, 08:08:12 pm »
I'm a bit confused by your schematic

I guess that makes me a beginner after all  ;D

Quote
why r20 and r21 in parallel for just a couple indicator leds, and why r23 and r24 in series? did you intend those to be parallel as well, or it's just so you won't use a higher resistance value ?

One set of indicators are for the 12 V line, the other is for the 5 V line. This entire board is a learning exercise and one part was unique BOM part reduction. This board only has 5 different resistance values! So, taking only the green LED in this example, it has a 235 ohm resistor on 5 V, so 10 mA goes through. The other one on 12 V has an 940 ohm resistance and thus also passes 10 mA, so it works out well and both come out equally as bright. Yes maybe they dont need to be that bright, but idk what a suitable current/brightness would be

Quote
are you sure 470 ohm resistors are proper for scl and sda pins? r25 and r26

Yes! The I2C bus is expected to be connected to an external ADC which uses a 4.7 kohm pullup resistance. Per the NXP "I2C specification and user manual Rev. 6", at a pullup of 4.7 kohm, up to 700 ohm can be used in series, so I chose a 470 ohm resistor. In case the series resistance proves to be too high, I have DNP pullup spots which I can populate

Quote
you're probably going overboard with the 8.2 pF capacitors on the rgb bit...
It certainly felt pretty ridiculous to me, I mean the trace might itself have 2-6 pF of stray capacitance, so I dont know really. I dont want the CMOS microcontorller pin to create tons of noise on each edge, so I guess with it there, worst case scenario is that the signal is too filtered and I need to desolder it.

Is there anything else confusing about it? I do have some documentation, though I dont think anyone would want to take a look at that (I dont mind sending anything over, im going to opensource the project when its done)
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21684
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: My first complete schematic
« Reply #3 on: October 23, 2021, 07:24:16 am »
Schematic layout is nice and tidy, labeled.

Not clear to me what the Pi header needs; seems suspicious that there's a "INT" line with a whopping 0.1u on it.  But the reset paired with it, does not; though following it down there's a whopping 1u (C3).  I doubt this actually causes problems, but it may be counterindicated for best results -- the slow transition time allows the receiver (MCU input) to read an indeterminate value for a long period of time, making it more sensitive to noise or oscillation.  (I think those pins have, or usually do, hysteresis (Schmitt trigger) so it shouldn't lead to oscillation, so that leaves sensitivity.)

Don't worry about doubling up cap sizes, just spread around a few larger values (1-10uF say, preferably with ESR to dampen the supply) and keep smaller local values (so, C9-C16).  I would also be fine with sharing U1 pins 2, 44 between a single cap.

You do have C5 in there, so it might be an opportunity to drop the 1u's for fewer 10u's, give or take what impedances/time constants you need or can adjust.

What are R28-R30 doing?  Forgot to assign some GPIOs..?

Sure got a lot of use out of that SMAJ15A.  I wouldn't have a problem using a smaller (cheaper?) diode in some places.  Can drop D10.

Hm, I'd put F1 on the other side of D9.  Not a big deal.

The one thing I really wonder about is all the pulse filtering: the fan tach is just open collector, isn't it?  So you won't get proportional PWM to voltage filtering, the source impedance is bouncing between ~470R (pulled down hard) and 5.57k (pulled up gently, uh in parallel with whatever might be in the fan itself too).  The slopes are unequal and so the filtering will not be linear.

Better to just capture the PWM directly, using the timer and input capture.  This might be a bit bothersome on a MEGA32, not sure.  Fancier ones (XMEGA, MEGA0, DA etc.) do have more advanced peripherals that can count duty and period nearly automatically; YMMV.

Oh or uh, it's not really PWM since it's a tach, but the filter sets the maximum pulse rate that can be measured, which seems rather low with these values, and again, it's asymmetrical so it falls below threshold much sooner than you might've expected.


Likewise, PWM from MCU into C23, C28 isn't going to be happy.  That's a lot of current through the pin driver.

Does the fan even need filtering anyway?  Would it not be fine to just run logic level into it and let it deal with it?

You still want some EMI filtering but 1u's aren't necessary for that; maybe adding a 1-10n to the BOM would be worthwhile.

Also if you need a solid logic level so can't afford much filtering resistance, try a ferrite bead.  A 330R (@100MHz) bead into 1-10n will do a good job for the most part.  So, just an L filter, not Pi, should do.

Likewise on the RGB strips, those values are completely out of whack, 1u heavily loads the MCU and 8.2p does absolutely nothing.  If those are the ~us pulses usually needed for that style of LED, I'd use a ferrite bead and a few hundred pF.  Maybe an LCL (tee) filter with two ferrite beads, to give the MCU pin a somewhat higher load impedance plus add damping for the cable (so it doesn't resonate too much under ambient EMI).

Speaking of ambient EMI, for any connectors/cables, you can consider putting ferrite beads on them, whether on the cables themselves, or something equivalent in circuit.  Note that individual beads per line, is not the same as one bead around the whole cable; to reproduce that on board, you need to use multi-line chokes, wired in parallel so they act together.  For slow signals and power, it won't make a difference; for data signals it matters.  (USB most of all, which has to be shielded -- make sure its grounds are tied into the circuit ground plane.  That shield then covers the signals along their length, preserving logic levels.)

Finally, supply filtering, let's see: there's three 100u's on +12V?  Probably fine.  Make sure Q8-D11 is near one of them and that's fine.  Actually that's the only active-switching thing on this side, could probably just cluster everything together around a 470uF or something.  Just needs enough filtering to keep things not-too-bouncy between here and the 12V supply.  Likewise for 5.  C33, C37 seem rather overkill.  If you need especially stable power for the MCU (not really, I don't see anything obviously analog needed here?) maybe consider running it at lower voltage (3.3 to 4.5V?) from an LDO, that way there's more voltage swing available on the 5V before disturbing it, and less capacitance is needed (even if the loads are strong).

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline AnasMalasTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: jo
Re: My first complete schematic
« Reply #4 on: October 24, 2021, 06:38:05 pm »
Thanks for the long reply, Tim! I truly appreciate it.

What are R28-R30 doing?  Forgot to assign some GPIOs..?
They are waiting on the PCB layout, probably not a good idea for my first PCB to be extremely cramped, but it is, and it's taking a ton of time to optimize placements

Quote
Sure got a lot of use out of that SMAJ15A.  I wouldn't have a problem using a smaller (cheaper?) diode in some places.  Can drop D10.

Hm, I'd put F1 on the other side of D9.  Not a big deal.
They cost 15 cents a pop from JLCPCB so im not sweating it, D10 is the only protection for poor PMOS Q8's gate, felt rude to omit it ;D
As for the PPTC fuse F1, it is undersized so that it opens after 1.08 seconds (the pulse is just 0.1 s), this is a failsafe so that if the nmos under it stays closed we do not have a fire. I placed it there because when it does go open, the inductor will become really really angry and will send it a high voltage. Is my logic here sound?

Quote
The one thing I really wonder about is all the pulse filtering: the fan tach is just open collector, isn't it?  So you won't get proportional PWM to voltage filtering, the source impedance is bouncing between ~470R (pulled down hard) and 5.57k (pulled up gently, uh in parallel with whatever might be in the fan itself too).  The slopes are unequal and so the filtering will not be linear.
I dont get what's happening here, I think that you swapped the MCU's high impedance input (tach120) with the fan connector. The 470 ohm resistor shouldnt do anything apart from filtering, right?

Quote
Likewise, PWM from MCU into C23, C28 isn't going to be happy.  That's a lot of current through the pin driver.

Does the fan even need filtering anyway?  Would it not be fine to just run logic level into it and let it deal with it?

You still want some EMI filtering but 1u's aren't necessary for that; maybe adding a 1-10n to the BOM would be worthwhile.
D'OH! How did I miss C23/C28! I'll change them to T filters. Also, its not the fan I care about, the filtering here is just so the wires dont radiate too much EMI with the sharp CMOS edges. Ill swap the filter capacitors for other values right away, but quick question: If I have a 100 Hz signal, is it too excessive to have a cutoff at 300 Hz? Ive calculated that having the cutoff at 3 times the frequency leaves 99% of the voltage level intact. Should I just throw in "generic" 1/10/100 kHz filters instead?

Quote
Likewise on the RGB strips, those values are completely out of whack ... I'd use a ferrite bead and a few hundred pF.  Maybe an LCL filter
Ferrite beads go out of my comfort zone, they are like voodoo magic to me (I get the basic principle, but not how to order one). Ill give myself exactly one day to understand how to use them and then move on (last time you told me about the ESD devices like the SMAJ it took me 3 weeks to understand them :palm:. Im hoping all my new experience will help me get it quickly, if not, the LED strips get a consolidatory resistor and nothing else)

Quote
C33, C37 seem rather overkill
Those are recommended by the strip manufacturer (Adafruit) as the LEDs can switch very rapidly. I didnt have any way of calculating a value for myself so I just went with it, but ill go ahead and remove one to reclaim some much needed board space, and if I find one inadequate in testing, I can always shove it down the terminal block :)

Quote
could probably just cluster everything together around a 470uF
Thats what happens when you design each part alone and forget the big picture lol, yes ofcourse I can consolidate the 12V caps into one, back to mouser we go!

Thanks Tim  ;D

 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21684
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: My first complete schematic
« Reply #5 on: October 24, 2021, 07:44:41 pm »
They cost 15 cents a pop from JLCPCB so im not sweating it, D10 is the only protection for poor PMOS Q8's gate, felt rude to omit it ;D
As for the PPTC fuse F1, it is undersized so that it opens after 1.08 seconds (the pulse is just 0.1 s), this is a failsafe so that if the nmos under it stays closed we do not have a fire. I placed it there because when it does go open, the inductor will become really really angry and will send it a high voltage. Is my logic here sound?

Doubt it's a big deal, it's not like it's a transistor, it can't make microsecond edges.  Milliseconds maybe, but meh, it takes so much energy to open I doubt it matters.


Quote
I dont get what's happening here, I think that you swapped the MCU's high impedance input (tach120) with the fan connector. The 470 ohm resistor shouldnt do anything apart from filtering, right?

Maybe. They're not labeled with direction or level or anything, can only guess.  Tip, set the off-sheet port direction to suggest signal flow.


Quote
D'OH! How did I miss C23/C28! I'll change them to T filters. Also, its not the fan I care about, the filtering here is just so the wires dont radiate too much EMI with the sharp CMOS edges. Ill swap the filter capacitors for other values right away, but quick question: If I have a 100 Hz signal, is it too excessive to have a cutoff at 300 Hz? Ive calculated that having the cutoff at 3 times the frequency leaves 99% of the voltage level intact. Should I just throw in "generic" 1/10/100 kHz filters instead?

10-100k is fine, sure.  Radiated is 30MHz+ and conducted is typically 150kHz+ (but may include down to 9kHz for certain standards), and you might not need full filtering (like, 60dB worth) up there if your source is switching at a lower frequency.

So, somewhere between there, and what you actually need in the signal (mind edge rate specs/requirements as well, there can be reason not to filter something heavily even if you only need some maximum fundamental frequency), is good.


Quote
Ferrite beads go out of my comfort zone, they are like voodoo magic to me (I get the basic principle, but not how to order one). Ill give myself exactly one day to understand how to use them and then move on (last time you told me about the ESD devices like the SMAJ it took me 3 weeks to understand them :palm:. Im hoping all my new experience will help me get it quickly, if not, the LED strips get a consolidatory resistor and nothing else)

It's a simple enough thing -- it adds impedance on the line.  Using it in an EMC system, is harder, yes.  That's no accident, EMC isn't easy to understand.  The best thing I can recommend is to understand what ground really means; that voltage is a local difference and ground is not absolute.  Learn to understand the common mode equivalent of a system.  Learn how to use RF ports.  Etc.

If this takes more than three weeks, don't worry about it. ;D

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: AnasMalas


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf