help regarding at89s52 output

Discussion in 'The Projects Forum' started by nuclearsam, Jun 13, 2008.

  1. nuclearsam

    Thread Starter New Member

    Dec 7, 2007

    i m using at89s52 in my project... i need to drive a relay using it. i m using a transistor to drive the relay and the output from the microcontroller goes to the base of transister via resistance... the relay works properly when base is connected to 5 volt supply and it consumes 4.2mA but when i connect the base to the pin of at89s52 (through a resistance) the output voltage of the pin drops significantly to 0.67 V from 5 V.... i don't know why this is happening.... i tried reprogramming the microcontroller but all in vain... due to voltage drop the relay is not functioning... please help asap......

    hasta la vista
  2. Papabravo


    Feb 24, 2006
    No member of the 8051 family has outputs that can source current. That is the nature of the quasi-bi-directional port pin structure that has been a part of the architecture since 1980. What this means is that your outputs can sink current but they cannot source current. I suggest a high side switch controlled by a common base amplifier. It is two transistors but solves the problem.
  3. thingmaker3

    Retired Moderator

    May 16, 2005
    What about a high-side PNP darlington?