The diode eliminates back EMF.
Maybe you connected the pins of the transistor backwards? Look at the datasheet for the transistor to see which pin is what.
Like I said, 10k is too high for the base resistor. This will give you about 430uA base drive, and the collector current is 79mA. Base current needs to be around 8mA, which is why I recommended 560Ω for the base resistor.
I would thank you all for your support.
Ron, As you said, I used two 1k resistors in parallel to make it 500 Ω. (I didn't have 560Ω resistor. The transisor (BC547) is connected properly. (I checked the datasheet)
The power supply is 6.7V DC
If you looked at the pdf, you will notice 4 dip switches, based on different combinations, the controller sends a signal to trigger the relay. after a while the relay doesn't get triggered. But when I power off and power back on with a gap of more than 5 seconds. everything works normally.
**broken link removed**The problem is the relay gets triggered for the first 7 min. Later on the controller hangs (I get no output). If I plug the relay out then the circuit works fine. (I connected an led instead of the relay which glows)
I think I need to get the triggering part of the relay correct. (circuit)
I am using the following circuit in the pic which I think is wrong:
**broken link removed**
I would also like to say that relay would be triggering 40Watt bulb (230VAC)
**broken link removed**The problem is the relay gets triggered for the first 7 min. Later on the controller hangs (I get no output). If I plug the relay out then the circuit works fine. (I connected an led instead of the relay which glows)
I think I need to get the triggering part of the relay correct. (circuit)
I am using the following circuit in the pic which I think is wrong:
**broken link removed**
I would also like to say that relay would be triggering 40Watt bulb (230VAC)
Are you sure you have the transistor connected correctly? The collector and emitter of BC547 are swapped relative to most transistors (e.g., 2N3904). This would give you low beta, which would still possibly drive an LED but not a relay.
Also - are you sure you have a 5V relay, and not a 12V (or other) one?
Also check the relay data sheet. Some DC relays require the correct polarization. (+ to + and - to -). Those have a partially magnetized armature and will only work reliably one way.
Are you sure you have the transistor connected correctly? The collector and emitter of BC547 are swapped relative to most transistors (e.g., 2N3904). This would give you low beta, which would still possibly drive an LED but not a relay.
Also - are you sure you have a 5V relay, and not a 12V (or other) one?
I am positive. I also interchanged the emitter and collector. The relay does not get triggered at all. SO I think I have the transistor wired properly.