I am trying to build a relay circuit that when the base of a transistor is supplied 3.3v it allows current to flow and turn on a relay. I put a diode in parallel to prevent blowing my mcu or transistor. I am using a 12v relay, a arduino, a npn 222a transistor, a IN4002 diode, a arduino (sets pin high and supplies power to base of trans). It won't work at all for some reason? Any suggestions? Thanks.
Vcc to the coil #1 of the relay (pick one and it becomes #1)
coil connection #2 to collector (the other coil connection on the relay)
emitter to ground.
you are using an NPN, so it goes between the device and ground.
you need to add a relay from the Arduino to the base of the relay.
proper selection is important, but anything close would work.
You need a base resistor to prevent burning out the transistor and the
Arduino - the Vbe on a transistor is limited to 0.7V or so, so without
the resistor you would be shorting the Arduino pin to ground (almost).
Large currents would flow and the transistor and Arduino would be
beyond their abs. max. specs.
Arduino output pins are limited to an abs. max. of 40mA (that means stay
at ~25mA or below for reliable trouble-free operation). The switching
transistor needs a base current of perhaps 1/20th of the collector current
to saturate (means turn properly on)
For instance if the relay needs 0.2A, give the base 10mA with a 470 ohm resistor.
Thanks mark!!! Does anyone know of any good software to design schematics as well. Also does anyone know of any good "how to" tutorials for designing schematics the right way? I feel like mine are so improper compared to other people
ilovearduinosomuch:
Also does anyone know of any good "how to" tutorials for designing schematics the right way?
I feel like mine are so improper compared to other people
Don't forget the eraser at the other end of the pencil.
Emulate proper examples which, evidently, you can recognize.
For schematic drawings, I use an excellent piece of "Windows" software call SPLAN from German based developer. I think Eagle schematics are awful. There is no need to use all that red color when a nice black and white drawing is fine.
It's a fine product. Custom parts are easy to add. Most people pass it of as "not for them" because It's not free. It's aimed at hobbyists. I've used it for nearly 10 years and am still quite happy. It is NOT integrated with PCB software... it is a drawing tool and I like it that way. There is a demo version to see if you like it.