Author Topic: Dropping 5v to 3.3v for Pic Micro  (Read 6286 times)

0 Members and 1 Guest are viewing this topic.

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Dropping 5v to 3.3v for Pic Micro
« on: January 10, 2015, 04:45:43 pm »
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.....
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #1 on: January 10, 2015, 06:08:49 pm »
A 3-terminal 3.3v regulator.
================================
https://dannyelectronics.wordpress.com/
 

Offline SteveyG

  • Supporter
  • ****
  • Posts: 993
  • Country: gb
  • Soldering Equipment Guru
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #2 on: January 10, 2015, 06:09:11 pm »
Just use a standard 3 pin regulator, like a 1117-3.3. Why didn't you just replace the PIC with the same type?
YouTube Channel: https://www.youtube.com/user/sdgelectronics/
Use code: “SDG5” to get 5% off JBC Equipment at Kaisertech
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4250
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #3 on: January 10, 2015, 07:37:49 pm »
...or a PIC18F46K22, which will happily run off 5V?

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #4 on: January 10, 2015, 07:50:35 pm »
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.
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #5 on: January 10, 2015, 07:55:58 pm »
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.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #6 on: January 10, 2015, 07:59:53 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline void_error

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #7 on: January 10, 2015, 10:53:23 pm »
I dont have any 3v3 regs lying around, and I doubt any of my scrapper boards will have them.
Dead PC motherboards - at least one 1117 on each of them, almost always in a SOT-223 package.
Trust me, I'm NOT an engineer.
 

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #8 on: January 14, 2015, 07:01:02 pm »
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=11
For anybody interested. Please feel free to post comments there.

Thanks for all the help.

P
« Last Edit: January 14, 2015, 07:06:53 pm by kolbep »
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2813
  • Country: au
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #9 on: January 14, 2015, 09:09:25 pm »
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?
 

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #10 on: January 15, 2015, 04:01:37 am »
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
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2813
  • Country: au
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #11 on: January 15, 2015, 08:40:58 am »
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.
 

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #12 on: January 15, 2015, 03:10:20 pm »
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 Resistor
The Emitter is straight on -ve
The Coil Resitance (on the collector) is 400 Ohms
There 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.html

I do not know what to do, or where to look from there on
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #13 on: January 15, 2015, 03:14:27 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline kolbepTopic starter

  • Frequent Contributor
  • **
  • Posts: 598
  • Country: za
    • ShoutingElectronics.com
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #14 on: January 15, 2015, 07:03:26 pm »
So Let me see if I get this right
Vc to Ve = 12v
Rc=400R
Ic=12v/400R = 0.03A= 30mA

So Ib should then be Ic/10 = 30mA/10 = 3mA

Now 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.3mA

What they had in there Vb to Ve=5v
and Base Resistor is 1K
so Vb/Rb = 5-0.7/1000 =   4.3mA

So (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?

P

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.
====================================
www.ShoutingElectronics.com Don't just talk about Electronics, SHOUT ABOUT IT! Electronics Blog Site and Youtube Channel
 

Offline David_AVD

  • Super Contributor
  • ***
  • Posts: 2813
  • Country: au
Re: Dropping 5v to 3.3v for Pic Micro
« Reply #15 on: January 15, 2015, 08:50:24 pm »
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.
« Last Edit: January 15, 2015, 08:52:46 pm by David_AVD »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf