??? 07/18/06 02:57 Read: times Msg Score: +1 +1 Informative |
#120427 - 12V relay driver for 80C52 Responding to: ???'s previous message |
Asok said:
I normally use 5 Volts 100 Ohms relays (GOODSKY GS-SH-205T-DS) with a BC557/8B and a 10 KOhms resistance connected between the port pin and the base. The collector goes to ground and the emitter to the relay coil, the other end of which is connected to the Vcc +5Volts,the usual IN4148 is across the coil.This unisolated arrangement works faultless even with inductive loads like fridge.
When the same arrangement is used with 12Volts relay connected to 12v,the relay is put on only once by the microcontroller as desired, by clearing the port pin;but the relay cannot be put off by setting high the port pin.It appears that the transistor is leaking. It isn't leaking, the base emitter junction is still forward biased, because, due to the relay, the emitter is still on higher potential than the base. I guess that an internal and invisible port protection diode is allowing enough emitter base current to flow to keep the transistor turned-on, even when emitting high state at port output. You can check this by measuring the potential at port pin: Is it one pn-junction forward voltage drop higher than Vcc, then it happens what I described above. Asok said:
What is the proper design or shall I forget 12 Volts relays in this context? Because the standard port of 80C52 cannot drive big currents when emitting high state, you should use the following scheme: ![]() How does it work? 400R at 12V means a relay current of 30mA. To reliably turn-on the involved transistor a base current of 1/10 the collector current is needed. So, the BC337 has 1k2 base resistors. The same thoughts with BC556. So, the 10k base resistors. Emitting low state at Port x,y turns-on the BC556, which then turns-on the BC337 and by this the relay. The resistors across base emitter junctions increase the turn-on threshold of transistors to about 1.4V. This makes this stage immune against noise on the supply rails. Kai |