1.5v voltage drop when powering 20ma load

hax

New Member
Hi all,

I am running a 20ma laser diode directly from pin c.7 of a Picaxe 20x2.

I have measured the current at 18ma.

It works but there is a 1.5V drop at the pin while powering the laser. So the output is 3.5V instead of the expected 5V.

The input to the picaxe is a stable 5V.

Is this within the specifications of the microchip? No other pins on the chip have any load connected to them, so I believe I am within the current draw specifications. I know some people will advise that a transistor or mosfet would be a good solution, which I appreciate, but i'd prefer not to add complexity to a simple circuit if I don't have to.
 

premelec

Senior Member
This has been discussed before and sounds about right - better use an external transistor to switch the current... PICAXEs are wonderful but not powerful in the energy realm... :) - BTW likely you can get more current with less drop from source or sink - I forget which... you could try that [ i.e. switch to V- rather than V+ or visa versa].
 

Goeytex

Senior Member
I know some people will advise that a transistor or mosfet would be a good solution, which I appreciate, but i'd prefer not to add complexity to a simple circuit if I don't have to.
You have to. That is if you want to avoid the voltage drop.
 

hax

New Member
OK well that's good. The laser seems to work fine at the lower voltage, so I'll leave it as-is. I always thought there were internal mosfets pulling the picaxe pins high/low, and my experience with mosfets is that they have a very low on resistance, so when I measured a 1.5V drop, alarm bells started to ring.
 

westaust55

Moderator
Pretty much in line with the datasheet.

If you look at the correspinding PIC datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/41365E.pdf

Section/Table 29.5 page 342 indicates the VOH with the supply at 5 volts as VDD – 0.7 Volts (or better) for a current of only 3.5 mA.
Not staed there but in general due to internal volt drop, as the output current increases, then the output voltage will drop further.

Now look at Figure 26-29 on page 377.
With a supply voltage of 5 V (ie less than the 5.5 V curve) and IOH at 20 mA the output voltage will be around 3.5 Volts.

If you were sinking the same 20 mA current, by Figure 26-30, then VOL will only be around 0.6 Volts about the gnd/0V line.
 

hax

New Member
Righto... I will sink next time instead of sourcing. The PCB has been manufactured, and it works, so the ship has sailed for this project. I'll have to remember this tip next time.
 

premelec

Senior Member
@Haxby - I'll mention one more item on measuring current - a lot of multimeters have pretty high internal + lead resistance so when you measure current to a unit with the meter in series it will actually be higher when the meter is out of the circuit - voltage input resistance is almost always quite high on a multimeter so you can go some by measured voltages to discern problems [and sometimes put a low resistance in series and measure millivoltage across that...]...
 

erco

Senior Member
westy: Great info, pure gold. From now on I'll sink instead of source for all my max power needs. I tested sinking vs sourcing on my mini beepers driven direct by a Picaxe pin and they work much better when the pin sinks. You just saved me a bunch of mosfets & soldering. :)
 

rq3

Senior Member
OK well that's good. The laser seems to work fine at the lower voltage, so I'll leave it as-is. I always thought there were internal mosfets pulling the picaxe pins high/low, and my experience with mosfets is that they have a very low on resistance, so when I measured a 1.5V drop, alarm bells started to ring.
From old measurements on a Picaxe 20M2, the P channel pullup MOSFET on an output pin is about 90 ohms, while the N channel pulldown is about 30 ohms. The basic PIC chip is really a logic level device. The fact that it can source or sink an appreciable amount of current (up to 25 mA) per pin is strictly an artifact of its silicon. The cascode MOSFETS on a PICAXE output should in no way be compared to power MOSFETS with milliohms of Rds.
 

AllyCat

Senior Member
Hi,

The output FETs are reasonably well characterised in graphs (usually section 31 for M2s) of the latest "base" PIC data sheets.

And if you're using the chips well below a nominal 5 volt rail (e.g. the 1.8 volts permitted for 14 and 20M2s), you might get quite a fright! ;)

Cheers, Alan.
 

premelec

Senior Member
@WHITEKNUCKs - probably no a cool idea as one pin might end up ON and other OFF forming a self defeating current path... and diodes in series to prevent this introduce too much voltage drop... :-(
 

Goeytex

Senior Member
I would think that using parallel outputs might work OK if the pins were on the same port (and not remapped by firmware) and if "PINS = " was used to turn the pins on/off. And as long as the maximum current for the port ( 50ma?) is not exceeded.

Has anyone tried this ?
 

hippy

Technical Support
Staff member
Has anyone tried this ?
I have but paralleling output pins is not something which I would recommend.

Even when on the same port the internal circuitry will have different latencies so the drivers will likely never switch at exactly the same time though the differences in latency should be rather small.

There will also be problems where not all PICAXE port pins are mapped to the same PICmicro port pins as you suggest.

Not selecting appropriate pins, a programming error, or an adverse internal or external event, could lead to paralleled outputs being high and low and lead to catastrophic results (*) as premelec notes. Diode buffering before paralleling the pins may help but will drop voltage.

All-in it creates risks, complexity and issues which can all be avoided entirely by using a simple external switching transistor or FET on a single output pin. That is what would be recommended.

(*) Probably not as spectacular as using paralleled triacs to switch mains voltages at a higher current than one triac can sustain. One switches on before the other, prevents current through the other, so handles all the current itself and eventually explodes, the other then switches on and does the same.
 

Goeytex

Senior Member
Even though it could likely be made to work, I would not recommend it either, especially a when adding a small transistor/FET switch will do a better job without the potential gotchas.

I have never understood the resistance of many users to incorporating a transistor switch with an MCU I/O pin for driving a significant load. Not only does this solve the voltage droop problem associated with MCU I/O output operations, it reduces the total current load on the I/O Port being used, as well as the total current used by the MCU as a whole.
 

erco

Senior Member
I have never understood the resistance of many users to incorporating a transistor switch with an MCU I/O pin for driving a significant load.
Simplicity, of course. Whether it's me soldering or a student breadboarding, one less component saves time & reduces wiring errors. There are few things I like more than gizmos which can be driven directly by an output pin. Those little buzzers and these 16 mA Aromat TF2-5V DIP relays are awesome. http://www.ebay.com/itm/NAIS-TF2-5V-ATF209-ELECTROMECHANICAL-RELAY-NNB-/390881565723?pt=LH_DefaultDomain_0&hash=item5b025b5c1b

WRT paralleling 2 pins, I agree that it's bad practice since a software goof can lead to blown hardware. If it must be done, WRT switching time, making both pins inputs briefly before driving high or low might avoid potential short circuit problems.
 

premelec

Senior Member
Compromise possible would be to put a 200 ohm resistor in series with _one_ of the paralleled pins so excess current wouldn't happen but some current output would be gained... :)
 
Top