7063Views7Replies

# 9v to (5v-3v) for pic 16f628a Answered

Problem: I have a 16f627/628 (runs between 3 and 5 volts) that needs to work in tandem with another device (call it D) running at 9, direct current, (active for 1 second in 30 or less frequent). Upon hooking up a number (of descending in size) resistors (without D connected) with the supply and 16f6xx the 6 LED's powered by the 16f6xx do not turn on unless resistance is extremely minimal, and voltage is well above that advised in the datasheet (not to mention making the pic reset itself every 10ms). Can anyone tell me how I might run the 16f6xx from a 9 volt battery, and explain what was going on? This may seem unforgivably dim to anyone who knows but unfortunately I'm more a software guy learning hardware as I go along. Any help would be much appreciated, Thanks Andy

Tags:

## Discussions

The forums are retiring in 2021 and are now closed for new topics and comments.

There are two ways for your setup.
One would be a voltage regulator chip such as 78l05

http://stuff.nekhbet.ro/2006/06/18/how-to-build-a-5v-regulator-using-78l05-7805.html

A more quick&dirty way would be to use a series of diodes.
Depending on the diode, the voltage will drop 0.45v or close to that.
So if you have no voltage regulator IC, but diodes laying arround, connect them in series (at least 8 if its a bunch of regular diods) and mesure the voltage :-)

Using diodes to drop the voltage is not recommended, especially if the load is varying since the drop varies from about 0.45 volt up to over 1.2 volt depending on the current. Dropping 9 volt down to 5 volt @ 100mA (a reasonable current with 6 leds lit) using plain 1n4448 diodes would require 4 diodes. When all diodes are turned off the current would be like 1mA and the diodes would only drop 1.8 volt in total giving 7.2 volt to the PIC - that's quite over the absolute maximum supply voltage.

Got the parts through, *finally* and it works a treat, Thank you,
andy

Ah, thanks for that, lucky I checked Instructables again before carrying out, never thought I`d say this but, it is lucky I was working this weekend. Having said that; no immediate damage appears to be manifested after voltages anything short of 9 volts (and even then it`s just needing a re-write). Ah well to Ebay to get some regulators. Thanks for your input and time, Andy

Ah great, just the information I was needing, many thanks, Andy

Did you put your resistor in series with your PIC ?

If so, that's not how to proceed.
Resistors limit the current. It does not "reduce" the voltage.

The universal formula is : U = R x I

U is the voltage measured between the terminals of the resistor, in Volts.
R is the value of the Resistor, in Ohms.
I is the current going through the Resistance, in Amperes.

The current I consumed by your PIC is not constant. It varies according to what it is doing. So, the current I going through the resistors R varies too.
Which means that the voltage U measured at the terminals of your resistor varies too !

Maybe your PIC is damaged now ....

If you want to make 5V out of 9V, you need a regulator : 7805

Ah right, I suspected that the current was in some way being effected, my multi-meter only measures tiny amounts for some reason, so I couldn't check directly. Ah well, thanks, now I know what was going on. As for the PIC, its okay, thought I had fried it but I just rewrote to it and it's fine, phew on that score. (Iâm not going to use it for anything other than this application so I donât mind if some irrelevant bits are cooked, and itâs an old '627 thatâs had more rewrites than it can count in a single 8 bit integer, in any case.) I have a series of 16f6xx instructables coming up as soon as I get the internet at my place, hopefully they will be a little more successful than this project at the moment. Thanks for your help, Andy