Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8051 pin voltage problem

Not open for further replies.


Member level 2
Nov 19, 2014
Reaction score
Trophy points
Activity points
Hi there Edaboard family,
Lately I have been working on a project which is an object chaser car based on IR sensors.
I am using two DC gear motors which have been interfaced to the PORT 0 of the ucontroller through L293DNE IC.
And there are four LEDs to indicate the direction of the motion of the car.
I haven't connected the IR sensor modules to the controller yet.
Now as my project was nearly 80 percent complete, I decided to check the accuracy of the progress so far.
So I burned the IC with a simple LED blinking program with PORT 1 into consideration as the LEDs are on PORT 1.
The problem is when I turn the project ON the pins give only 2V as output, I am talking about the pins which are connected to the LED, the rest of the pins give 5V sharp as per the expected behavior. So the LEDS do keep toggling but with very dim light.
The another problem is when I insert l293DNE the project becomes dead, it doesnt show any working even the LEDS stop working.
I am using 12V dc rechargeable battery.
I hope someone to reply soon.
Eagerly awaited.

Sounds like you connected LED cathodes to ground. Reviewing a 8051 datasheet will tell you why this can't work. 8051 has very low current sourcing and moderate sinking capability. So provided the port current is sufficient to drive your LED, it must be connected with LED anode to VCC and cathode via suitable series resistor to port pin, writing 0 the pin to light the LED.

Regarding L293 issues, you better show a schematic. There are many possible reasons, e.g. VCC overload.

That's exactly true, I have connected the LED cathodes to ground. But why won't it provide full voltage. There is a 470ohm resistor in series as well. LEDs are four in number and are connected to least significant nibble of PORT1.
The rest of the pins give 5V and ground while toggling but these pins toggle between gnd and 2V.
What can be the reason behind it??
I have kits designed to perform practicals. In the kit all the leds are connected in the same way and it works fine on the kit.
I have a fellow trainer who has made projects on 8051 and has not faced any such problems.
Then why is it happening now??

I have kits designed to perform practicals. In the kit all the leds are connected in the same way and it works fine on the kit.
Something has been surely different. If we are talking about standard 8051, e.g. at89s51, it doesn't source more than a few 10 µA on ports 1-3 and no static current at port 0.

I am using P89V51RD2BN from NXP. The pins work perfectly when the LEDS are disconnected but they dont work when connected. I mean they work but the voltage is even less than half.
I am just wondering why is this happening??
I have worked on so many projects based on PIC microcontroller but it has never happened before ever.

Besides the low current capacity mentioned above, you need to be aware that using some LED with color other than red, this effect is even more noticeable because the voltage drop will be greater in other colors. What you can do is to use a transistorized external circuit to amplify this current, like the ULN2003 IC for example.


I am just wondering why is this happening??
if datasheet says it can only source some 10uA, that says it all. No need to wonder.

I have worked on so many projects based on PIC microcontroller but it has never happened before ever.
Most probably the PIC can source a lot more output current.

One solution is to use the port as current sink. Then connect the LED anode to VCC and the cathode with a series resistor to the port. (I don´t know the datasheet. Read on port_sink_current, I_OL)

or you can use a bjt to drive the LED current.


Thank you so much for replying brothers. I have an ISP for 8051 microcontroller, I will try the same setup with that and if that doesnt work than I will configure in sinking fashion.
The real thing that I am confused about is the L293DNE chip functioning. As soon as I connect the pins of this chip to the controller the project just comes to a halt. I mean the LEDs keep toggling between ground and 2V till L293DNE is not connected. When it is connected even that stops happening.
I really want to use some help right now. Please reply soon. Thanks a lot.

I already suggested a possible explanation in post #2. As said, there's little chance to understand what's going on without a complete schematic.

Brother I don't know how to make a schematic but you are intelligent enough to understand it this way.
The pin connections are as such:
I am using four pins of PORT 0. I have connected the pull up resistors.
Pins 1,8,9,16 are connected to +12V DC supply.
Pins 4,5,12,13 are connected to the Ground.
Pin 2 is connected to P0^2
Pin 7 is connected to P0^3
Pin 10 is connected to P0^1
Pin 15 ix connected to P0^0
Pins 3 and 6 are connected to one motor
Pins 11 and 14 are connected to the other motor.

I hope this helps.
I have solved the LED problem by sinking the current to the micrcontroller rather than sourcing it.
I want to resolve this problem as well ASAP.
Please help.

According to L293 data sheet, enable inputs must be never connected to a voltage > 7V. The ususal configuration is also using 5V logic supply VCC1, although high voltage supply is permitted.

Did you try without connecting a motor?

No I didn't try without the motors but I will and let you know ASAP.

Alright so I tried it out without the motors but it still didn't work. I don't know what's going on. Please help me out. I have mentioned the pin connections of L293DNE with the controller.
Please help!!!!!!!!!!

Did you notice the input voltage problem mentioned in post #12? Apart from this point, I imagine that L293 could make your supply voltage collapse.

I don't see obvious faults, except for the enable input connection.

Sir please can you suggest something. What should I do?? How should I make the connections??

Connect eanable input and VCC1 to 5V supply instead of 12V.

DO you mean pin no 1 and 16 of the IC??

Here is a circuit of L293D. Hope this helps.


  • L293D Circuit.png
    L293D Circuit.png
    15.6 KB · Views: 72

Not open for further replies.

Part and Inventory Search

Welcome to