Dropping 5v to 3.3v for Pic Micro - Page 1
Forum section: electronics / projects

author: kolbep
author_rank: Frequent Contributor
timestamp: January 10, 2015, 04:45:43 pm
content: Hi.I am repairing a Generator AMF Controller.The 5v Regulator had died. The Electrolytic cap after the reg had blown open,and the PIC16f64A Micro has had it.I replaced the regulator and cap, and have substituted for a PIC18f46K20, and made up a program that is compatible with the hardware,but the thing that is bothering me is that the 18f46k20 is rated for a Maximum of 3.6v....What is the best (easiest and cheapest) way to drop the 5v down to less than the pic's maximum. Will it be ok just sticking 3 diodes in series after the 5v regulator, to give a drop (ie 5v-(3x0.6v))=3.2v?or will that be problematic.Basically the 5v rail only runs the pic, 2 optioisolators that signal the pic to presence of mains, and the transistors that drive the 5v relays.....

author: dannyf
author_rank: Super Contributor
timestamp: January 10, 2015, 06:08:49 pm
content: A 3-terminal 3.3v regulator.

author: SteveyG
author_rank: Unknown
timestamp: January 10, 2015, 06:09:11 pm
content: Just use a standard 3 pin regulator, like a 1117-3.3. Why didn't you just replace the PIC with the same type?

author: AndyC_772
author_rank: Super Contributor
timestamp: January 10, 2015, 07:37:49 pm
content: ...or a PIC18F46K22, which will happily run off 5V?

author: kolbep
author_rank: Frequent Contributor
timestamp: January 10, 2015, 07:50:35 pm
content: I dont have any 3v3 regs lying around, and I doubt any of my scrapper boards will have them.I would have used the same type of pic, but I had this one on hand, and because I had to do the code from scratch, I preferred something that I could program in C. My assembler is not too good, so c was quicker....also, with our countries electricity supplier having restarted with their ongoing rolling blackouts, there is a bit kf a crunch to get this generator controller up and running again soon.I might just have to deadbug an lm317 regulator, with its resistors, on there instead of the 7805.I really do need to build up a variety of pics though.

author: Kalvin
author_rank: Super Contributor
timestamp: January 10, 2015, 07:55:58 pm
content: If you have a 7805 around, you can use it as a linear preregulator which will protect your circuit. Just add three 1N400X diodes in series to drop the voltage from +5V to around +3V. However, I would consider this only as a temporary solution.

author: dannyf
author_rank: Super Contributor
timestamp: January 10, 2015, 07:59:53 pm
content: Diodes, or even resistors, may work. I would get a sense as to the current consumption of your pic and size up the diodes or resistors, and I would put a capacitor (47uf or less) on the Vcc pin (after the diodes / resistors). The issue with this approach is that the voltage drop on the diodes or resistors vary with current consumption.Many of the 3.3v PICs I have used (PIC12/16 and some PIC24F) run flawlessly at 5v. So if you have a spare one, that's another option that you may try.

author: void_error
author_rank: Frequent Contributor
timestamp: January 10, 2015, 10:53:23 pm
content: Quote from: kolbep on January 10, 2015, 07:50:35 pmDead PC motherboards - at least one 1117 on each of them, almost always in a SOT-223 package.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 14, 2015, 07:01:02 pm
content: Ok, I ended up going for an LM317 set to 3v.It was working fine @5v, but as this was going back to a client, I want it to be (sort of) reliable, for the next couple of years.My write up (with pics) of the repair is at :http://plus.org.za/?p=11For anybody interested. Please feel free to post comments there.Thanks for all the help.P

author: David_AVD
author_rank: Super Contributor
timestamp: January 14, 2015, 09:09:25 pm
content: So you run the PIC @ 3.3V instead of 5V, but what about the circuitry attached to the PIC's I/O pins?Is that all 3.3V compatible?

author: kolbep
author_rank: Frequent Contributor
timestamp: January 15, 2015, 04:01:37 am
content: The inputs to the pic come from 2 opto isolators. That signal does not exceed 2.5v.the outputs trigger 2n222's that operate the relays.that is all there is to the circuit

author: David_AVD
author_rank: Super Contributor
timestamp: January 15, 2015, 08:40:58 am
content: You should check that the relay drive transistors are still driven into saturation.The 4.3V (5V supply - 0.7V Vbe) across the base resistor will drop to 2.6V (3.3V supply - 0.7V Vbe), which could be marginal depending on the resistor value and transistor gain.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 15, 2015, 03:10:20 pm
content: This may be a (dumb) question,But how can I calculate if the Transistor is in Saturation.The Base is connected to the PIC pin through a 1K ResistorThe Emitter is straight on -veThe Coil Resitance (on the collector) is 400 OhmsThere does not seem to be a Reistor in series with the collector.The transistor is a 2n222 NPN transistor:Datasheet :http://pdf1.alldatasheet.com/datasheet-pdf/view/5612/MOTOROLA/2N222.htmlI do not know what to do, or where to look from there on

author: dannyf
author_rank: Super Contributor
timestamp: January 15, 2015, 03:14:27 pm
content: Figure out your collector current and drive your Ib to 1/10th of it.You can probably get away with 1/50th of it if Ic is low (100ma or less for example). there is no hard number to go by and no point in doing that.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 15, 2015, 07:03:26 pm
content: So Let me see if I get this rightVc to Ve = 12vRc=400RIc=12v/400R = 0.03A= 30mASo Ib should then be Ic/10 = 30mA/10 = 3mANow Lets take Vb to Ve = 3.0-0.7v drop (Worst Case)and the Base resistor is 1K,so Vb/Rb = 2.3/1000 = 0.0023 = 2.3mAWhat they had in there Vb to Ve=5vand Base Resistor is 1Kso Vb/Rb = 5-0.7/1000 = 4.3mASo (Please tell me if I went wrong with the above).The Original Voltage of 5V would have driven the transistor into saturation.and The modified Voltage of 3.3v (my worst case estimate of 3v), means that I am in the linear reigon.The Relays are holding in, and not buzzing or jittering. What problem could it pose keeping it like that?PQuote from: dannyf on January 15, 2015, 03:14:27 pm

author: David_AVD
author_rank: Super Contributor
timestamp: January 15, 2015, 08:50:24 pm
content: The really quick way to check is measure the voltage across E-C of the transistor when the relay is on. Check the data sheet for VCE(sat) figure or just make sure it's well under 1 Volt.If the transistor is not driven into saturation, the relay voltage will be lower which may not be an issue. It will mean that the transistor is dissipating more power (Vce * Ic) though.