i am using a ds89c420 Ucontroller, using the ports as output to drive a relay. I know the Ucontroller has low current output so i use 2n3904 transistor but the problem is when the relay is connected the output of the ports, goes down from 5v to 0v.
Are you using a resistor from your IC to the base of the transistor? You should size this resistor for the current drive capacity of the chip. Try 1 mA as a first guess if you have no other information. The transistor beta should be about 100 so it can draw 100 mA with the collector.
as klystron said , using the relay driver chip (uln2003) is a very good solution but if you want to use transistors to drive your relay you should put diode as a reverse connection in parallel with the relay coil to avoid the effect of coil charging in the transition time when driving the relay ..
BR, Vonn
Another solution would be to use a fet off the port pin on to the fet`s gate then you will only need the drain connected to your realy with a diode to remove the back emf as the relay coil energises/deenegises.
as far as I remember the 8051 has a weak pull-up current source of about 100uA at his ports. It is not able to drive a ULN2803! You will need an external pull-up resistor. The current consumption is to high for more channels.
An external FET is only a solution if it is a logic-level FET ! You need a flyback diode.
The best way is to use a intelligent switch (HITFET) like BTS117 or smaller.
Or look for a driver like ULN2803 with CMOS inputs.
I usually use one BC517 npn darlinton transistor for driving relays. I noticed that if i change this to a single normal BJT, the relay won't work. Same like yours .
And what about driving single coil bistable relay? Bistable relay is wery good in power saving application. But single coil bistable relay is driving (switching On an OFF) by reverse polarity pulse. Any good schematic solution to this driver?
At the single coil latch relay coil is usually deenergized. Only for switching some short pulse is applied to coil. One polarity pulse is switch relay to On state and reverse polarity pulse is switch to Off state. Good appnote from Maxim for driving this relays is here
**broken link removed**