-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 :)
Flattery will get you a lot of places.
--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.
Switches generally don't care about voltage.
--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.
A couple of problems there. First off the PIC doesn't have enough drive to drive the motor. Second LEDs use current as a more important parameter than voltage.
- --I guess I need a resistor to reduce my 6V to 5V, which can then be
-connected to the chip + input switches.
Won't work. Resistors only work in this situation when the current requirements are constant. The setup you describe is virtually guaranteed to have fluctuating current which means that your voltage will be all over the place. In the end you'll probably end up releasing "magic smoke" and your chip won't work anymore.
- The 5V output would be find for the 5V LEDs,
Again LEDs are much more concerned about current. You'll need current limiting resistors for each LED.
- but I guess I need another resistor for each motor.
Resistors are not the proper way to manage differences in voltage. If you throw a resistor in series with your motor, you'll limit the amount of power that you can give to it.
--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 :-\
Most switches are single pole. This means that the switch is either connected or disconnected. When disconnected it floats and the input gets an indeterminate voltage. This can cause problems. The 0V "pulldown" resistor will guarantee that the input is
0V when the switch is disconnected and 5V when connected.-
-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!
Well you have a whole host of issues to deal with. Let's work with them one at a time. First and foremost is that your 4AA batteries will last about 2 minutes in the type of application with LEDs and motors that you are describing. I would advise working with a DC wall wart of at least 8V and a 7805 voltage regulator until you get everything working. The wall wart and regulator will solve most of the issues in terms of regulating voltage.
Next make sure that each LED has a current limiting resistor. You can look up the process on the web.
You'll need a transistor driver for your motor. Also you can drive your motor directly for your input voltage (8V) even if it's a 3V motor as long as the average voltage presented to it is about 3V. You do this using pulse width modulation. Give the motor a signal that is on 3/8 of the time and off 5/8 of the time and it'll run as if it has
3V applied to it. Another way to do it is to give the motor it's own 3V regulator built from a LM317. Then you can run it at 100 percent without fear of burning it it.Hope this gives ytou some insight.
BTW are you just fiddling or are you trying to build something in particular? Also what is your PIC setup?
BAJ