Hiya!
I had great help on here before and I'm needing it again.
I was playing around with a 16f84a interfacing the portb.0 bit to a 2n3904 npn transistor that activates a 12vdc 270ohm relay(with a diode of course). Now when I omitted the Rb (resistor from pic pin to base of transistor) it worked in a strange way. Within the code I set the port bit high and then a delay. The relay turns on. But once the delay finishes the relay turns off even though my code doesn't set it low.... Without the delay the relay doesn't even turn on.
Now if I put a Rb in place (calculated so that Ic have enough current), everything works fine. No issues.
So my question is, why does the relay turn on then off without Rb and why does it somewhat work when there is a delay?
Thanks.
I had great help on here before and I'm needing it again.
I was playing around with a 16f84a interfacing the portb.0 bit to a 2n3904 npn transistor that activates a 12vdc 270ohm relay(with a diode of course). Now when I omitted the Rb (resistor from pic pin to base of transistor) it worked in a strange way. Within the code I set the port bit high and then a delay. The relay turns on. But once the delay finishes the relay turns off even though my code doesn't set it low.... Without the delay the relay doesn't even turn on.
Now if I put a Rb in place (calculated so that Ic have enough current), everything works fine. No issues.
So my question is, why does the relay turn on then off without Rb and why does it somewhat work when there is a delay?
Thanks.