lordpil's blog

it depends on what youre doing
and how the board is fabbed
like, total shit fab, keep it above .012 space/trace
good fab, down to .004
for current use a pcb calc
and turn the temp rise down or turn the ambient temp up
.010 is a bit light for 200mA
itll do it
http://www.4pcb.com/trace-width-calculator.html
this says youre fine with 3 mil internal traces
but for an inch, you drop 30mV and resistance is .15 ohm
so yeah, parasitics are not so small
anyway i would prob use 16-20 mil for that
because maybe you short pins

bus grounds create ground lift, lifted grounds create errors
star ground avoids this
ground pours are low impedence, which is good, but their ground 'bus' and 'loop' issues are random and unpredictable
but you can cut up pours so currents cant loop, and they are common at a star
like, star/tree/leaf ground is ideal, but ground pours are usually better than spaghetti grounds
but china does a lot of single side spaghetti ground, and shit works
not great, but works, shrug

you should put 0.1uF across power pins of U1 and U2
always try and star ground
no
i cut up my ground pours
so they are effectively loopless paths to ground
i think kevtris does the same on his stuff
https://i.stack.imgur.com/gge26.png
this is good
ideally, you bring your power grounds to a single point in isolation
and do the same with analog grounds
and bring them together at power supply output, which is basically your bulk psu caps

its a 2khz low pass
and 100pF is like 2MHz low pass
if you switch close to or above those frequencies, the transistor wont go into saturation
itll run linear, so itll get hot and steal power from the fan
but the caps are good for rf immunity
if you are just switching the fan on and off, no pwm, you can prob just do the 0.1uF cap
the resistor and cap should go close to the transistor
your flyback diode should go close to the connector

you have 5v for the attiny?
anyway
say the fan is 500mA
assume 50 for Hfe, beta, current gain of the bjt
its usually like 100-200
so you need >10mA to put the transistor into saturation
for a 100mA fan, you would need >2mA
lets say we decide on 5mA of base current
yeah but its less per port and i think thats abs max?
you set base current with the resistor across Vpin and Vb
Vb = Vbe = 0.6V
so, R_base = ( V_pin - V_be ) / I_base