Darlington transistors
http://en.wikipedia.org/wiki/Darlington_transistor
stacked transistors, to multiply the current gain!
Example part:
TIP102 http://www.fairchildsemi.com/ds/TI/TIP102.pdf
http://www.mouser.com/Search/Refine.aspx?Keyword=TIP102
Alternative for SMD mounting:
MJD122:
http://www.mccsemi.com/up_pdf/MJD122%28DPACK%29.pdf
http://www.mouser.com/Search/Refine.aspx?Keyword=MJD122
with a gain of ~1000 only little current is needed from the ATmega to drive the relay, and darlington transistors are common parts, easy to source and cheap.
Calculation:
Ic: 200mA (Relay current)
hFe: 200(min Value from Datasheet)
Ube: 1.6V (from Datasheet)
Ub: 5V (TTL from ATmega)
Ib: 1mA [Ic/hFE] (must be sourced from ATmega)
Rb: 3.4kOm [ (Ub-Ube)/Ib ] (in series from ATmega to Base)
next possible Rb is 3.3k, what will result in 1,03mA = 3,5mW, so every 1/8W or higher will work.
Basic circuit:
- TIP102baseCircuit.JPG (20.01 KiB) Viewed 47082 times
R1 = 3.3k (see above)
R2 = 100k (makes shure the TIP102 Base is grounded when the ATmega Pin is floating)
T1 = TIP102 Darlington transitor
D1 = 1N4007 (Flyback protection diode)