Re: Calculating resistors required
From: John Popelish (jpopelish_at_rica.net)
Date: 12/31/04
- Next message: Martin: "Re: Transistor Orientation woes ?"
- Previous message: Dantanna: "Re: Where To Buy Emergency Stop Buttons?"
- In reply to: Danny T: "Calculating resistors required"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 31 Dec 2004 14:14:16 -0500
Danny T wrote:
>
> Hi all,
>
> Sorry for more reeeally basic questions, but advice I've been given by
> different people conflicts, and some of the reading on the web is a bit
> over my head, whereas you guys always seem to explain things well :)
>
> I've got a programmed PIC16F chip, and I want to wire it up to a few
> things... My power supply is 4AA batteries (about 6V), but my chip wants
> about 5V. The switches connected to my chip also want about 5V.
You take only a slight risk by powering the PIC directly from 4 AA
cells. They put out 6 volts (or a little above) only when new. With
any significant load, they sag, quickly. I would mess with a
regulator, only is the chip was very valuable.
> My motor is driven from an output pin of the chip (which I guess, is
> 5V?), but the motor is 3V. My LEDs are 3V too.
This loads have current requirements, as well as voltage needs. You
have to take both into account when designing drivers. The PIC
outputs have very limited current capability (read the spec ***).
The outputs may have enough capability ot drive an LED, especially in
active low (on when the output is pulling negative), so a series
resistor may be all you need for those. The resistor has to waste the
extra voltage while passing the desired current. For instance if you
desire that 10 ma pass through both LED and resistor, and you expect
about 3 volts to be consumed by the LED, you have 2 or 3 volts that
must be burned up by the resistor. 3 volts drop divided by 10 ma
current through = 300 ohms resistance needed.
The motor will quite likely need a driver that provides current gain.
A PNP transistor connected as emitter follower (base to PIC output,
collector to ground, emitter to motor, other side of motor to battery
+) will provide about battery - .7 volts to motor when the PIC output
goes low. If you need a high active driver, change to an NPN
transistor and swap the collector and motor battery connections.
Limiting the motor voltage to an accurate maximum voltage is a bit
more complicated.
> I guess I need a resistor to reduce my 6V to 5V, which can then be
> connected to the chip + input switches. The 5V output would be find for
> the 5V LEDs, but I guess I need another resistor for each motor.
>
> It's also been mentioned that my switches should be connected to 0V via
> a resistor when "off", and 5V when "on". I don't understand the
> reasoning for this :-\
This probably means that the program is set up to to watch the input
switches (things you push to make the program do things) that are
activated when they connect to +5, and when you are not pushing on
them, a resistor pulls the input down to zero volts (active high).
This is a completely arbitrary program choice.
> Also, if I was to need 6V to drive something, but the output from my
> chip is less, though my main supply is enough - how do I go about
> changing a 5V (I think!) output, to 6V? I've been reading about
> transistors thinking they do what I want, but I've just confused myself
> even more!
The simplest way is to add an N channel mosfet to the output (gate to
output, source to zero, load between +6 and drain). When an output
goes high, the mosfet will switch on and connect the full battery
voltage across the load.
-- John Popelish
- Next message: Martin: "Re: Transistor Orientation woes ?"
- Previous message: Dantanna: "Re: Where To Buy Emergency Stop Buttons?"
- In reply to: Danny T: "Calculating resistors required"
- Messages sorted by: [ date ] [ thread ]