I'm not getting enough voltage out of the PIC17F877

  • Thread starter Deleted member 446890
  • Start date

Thread Starter

Deleted member 446890

Joined Dec 31, 1969
0
Hello,
I'm finding trouble in this college project of mine. I'm trying to build a "light following robot" using the PIC16F877. I have two motors to move the robot and they're both piloted by the L293D IC.
I have a simulation running like it should be on PROTEUS ISIS, my system is identical to the simulated one, yet the robot is not functioning.
So here's the basic problem: when I provide power to the input IN1 of the L293D (provided some other conditions are met), the motor correspondent to that input pin should start spinning. It does when I plug in a raw 5V, but not when I connect it with the pin of my PIC that should release power when certain software conditions are met. In the other hand, when I connect that PIC pin with a LED, the LED lights up under those software conditions. So power does get out of that pin. It's just not enough for the L293D to consider it as a logical 1.
I measured the voltage around the LED, and it said 2.2V. In my knowledge, the PIC should provide 5V. I tested other pins of the same PIC, and also an other PIC as well, but got the same result. I tried eliminating other components that could be getting power out of the PIC but same thing as well.
At this point, I said why not add more power to the one generated by the PIC, by putting 2 small batteries (1.5V each) in series with the pin in question. That didn't work. I tried a parallel formation, that didn't work as well.
Now, I've consumed my base of knowledge around this subject, and I can't think of anything else to solve the problem.
You'll find the schematics and code attached, for those who want to take a look.

Note: I don't know many of the technical jargon used in English, because I've in taught in French, so please bare with me.
Thanks.
 

Attachments

crutschow

Joined Mar 14, 2008
38,838
I measured the voltage around the LED, and it said 2.2V. In my knowledge, the PIC should provide 5V. I tested other pins of the same PIC, and also an other PIC as well, but got the same result. I tried eliminating other components that could be getting power out of the PIC but same thing as well.
Does the LED have a resistor in series?
Otherwise you are just looking at the froward drop of the LED.
Are you measuring the other voltages with or without the LED connected?
What is the supply voltage to the PIC?
 

Thread Starter

Deleted member 446890

Joined Dec 31, 1969
0
Does the LED have a resistor in series?
Otherwise you are just looking at the froward drop of the LED.
Are you measuring the other voltages with or without the LED connected?
What is the supply voltage to the PIC?
Nope, the LED doesn't have a resistor in series.
I've tested other pins' voltages with and without the LED/L293D connected.
The PIC is receiving 4.8V as supply.
 

AlbertHall

Joined Jun 4, 2014
12,653
Connecting the LED without a series resistor will restrict the PIC output voltage and that is why that only reads 2.2V. The L293D needs more than 2.3V input to switch so it won't work with the LED connected. Make sure that the L293D Vcc1 is 5V and Vcc2 is between 5V and 36V and then measure the voltage on that pin without the LED connected.
 

Thread Starter

Deleted member 446890

Joined Dec 31, 1969
0
So, you're telling me to put a resistor between the PIC output and the L293D input, and that should give me a 5V voltage?
Because, I had another LED connected to the PIC as an output with a resistor in between and I measured it's voltage and it still turned out to be 2.2V.
The sad thing is I no longer have access to the robot because I returned the materials to my university professor, but it stills tickles my mind that's why I'm asking here.
If adding a resistor really is the solution, then I can't help but chuckle, because my team and I had previously encountered 2 problems that adding a resistor to the mix solved.
The thing is I don't understand why a resistor is so big of a deal honestly. It makes things work but I don't understand why they don't otherwise.
 

Thread Starter

Deleted member 446890

Joined Dec 31, 1969
0
No. Just connecting the PIC pin direct to the L293D input is all that is necessary - with no LED connected.
I think we have a misunderstanding. I tested with PIC directly connected to L293D. It didn't work. Then to see if the pin is actually giving a voltage, I connected the same pin to a LED only. The LED is not leading to the L293D, it leads to ground.
 
Top