Relay Driving Problem

Discussion in 'The Projects Forum' started by eric_s88, Nov 23, 2012.

  1. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    Hi everyone, I've got a problem in driving a 12V relay. here is my schematic, my problem is that this circuit turn on the relay but cant turn it off!
    it remains on until I turn off the supply. even when I disconnect the base resistor from uController, it remains on. :mad:


    [​IMG]


    I use a 12V power supply for relay, and a L7805 for providing 5V for uController.
     
  2. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    I replace BC238 with a BC107, and the relay go on and off easily, but I dont know the reason .. :(
     
  3. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    How much current does the relays need?
    The BC238 has a absolute maximum collector current of 100 mA.
    The practical maximum will be around 50 mA.

    Your base resistor is also quite small.
    A resistor of about 470 Ohms should be used.
    The ideal base current for saturation will be about 1/10 of the needed collector current.

    In the attachment of the following post there is a transistor selection table:
    http://forum.allaboutcircuits.com/showpost.php?p=247364&postcount=16

    Bertus
     
    Last edited: Nov 23, 2012
  4. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    Hi Bertus, this relay needs 30~35ma current, and I think bc238 will be able to provide this current in its collector. what is the reason of not switching of the relay ? the R1= 100ohms is too small ???

    thanks for attachment
     
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    With a base resistor of 100 Ohms, the base current can be (5 - 0.7) / 100 = 43 mA maximum.
    This might burn the base connection of the transistor and short the complete transistor.
    A 470 Ohms resistor will reduce this current to a max of about 10 mA, enough to switch an 100 mA load (theoreticaly).

    Bertus
     
    eric_s88 likes this.
  6. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    thank you so what about BC107 ? why does it work with 100 ohm ? its collector current is 100ma(max) too
     
  7. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    The BC238 is made in a plastic housing, wich will not spread any heat easy.
    The BC107 has a metal housing, wich will absorb the heat better.
    Even the BC107 is driven to hard.

    Bertus
     
    eric_s88 likes this.
  8. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    but I tried a 470 ohm base resistor, the both transistors bc107 and bc238 did not switched on.. :(
     
  9. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    The current is dependend on the output voltage of the MCU.
    As I said the max will be (5 - 0.7) / resistor value.
    When the MCU does give less voltage, the current will be lower too.
    Best way is to measure the output voltage and adapt the resistor to it.

    Bertus
     
  10. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    I use an attiny13 avr mcu, and the output voltage is 5V(20ma) , so there must be something wrong that the transistors does not switch with 470 ohm on their base .. :-??
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,022
    3,236
    Are you sure the transistor is connected properly, perhaps interchanging the collector and emitter?
     
  12. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    Did you actualy measure the voltage?
    I would expect a bit lower voltage.
    The low base resistor values could also stress the outputs of the MCU.

    Bertus
     
  13. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    yes, because it works with lower resistor on base
     
  14. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    its about 4.7~4.8 V with no load on it, and maybe a bit lower with transistor connected to it
     
  15. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    and as the last question, is that ok that I used 10k resistor from base to ground? to make sure about turning the transistor off
     
  16. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    with 470ohm its working but only with bc107 , the bc238 is still unable to switch off. maybe ist damaged.
     
  17. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    The resistor of 10K to ground will not be the problem.
    You could try a resistor of 270 Ohms on the base.
    This will limit the current to (4.7 - 0.7) / 270 ≈ 15 mA, wich is safe for the MCU.

    Bertus
     
  18. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,574
    230
    Deleted text
    OOPs! was thinking of another thread on another forum. Must still be hungover from all thea turkey. ;)
    Ken
     
    Last edited: Nov 23, 2012
  19. eric_s88

    Thread Starter Member

    Apr 20, 2011
    157
    1
    hmm.. It seems that is sthing wrong with my bc238s .. they dont turn off with all of these resistor taht we discussed about in this topic
     
  20. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    Is the BC238 not burnt already?
    The BC107 is more rigid, as it has a metal case and a peak current of 200 mA.

    Bertus
     
Loading...