# PIC power problem!

Discussion in 'The Projects Forum' started by electrolyte, Oct 26, 2010.

1. ### electrolyte Thread Starter New Member

Apr 21, 2009
4
0
I have programmed a PIC16F648A to control some LED's (at the moment) and I have tested the circuit with 4.5v from 3 AA batteries and it works fine the LED's light up.

I then wanted to power the circuit from a single 9v battery so I had to regulate the voltage to 4.5v. to do this I used a ~4.7v zener diode and used the circuit like the one on this website: http://www.reuk.co.uk/Zener-Diode-Voltage-Regulator.htm.

But when I powerd the circuit up the LED's did not come on I checked the voltages around the circuit and it appears correct. I then just connected it to a single LED and it lit up so I think it could be a current problem. But after calculating the current their should be ample for the circuit. There is only 1 PIC and 4 LED's.

The zener diode is a 4.7v at 500mW.
The resistor is 1kΩ @ 1/4W
The battery is 9v.
The pic is a 16F648A and according to the datasheet the operating current is 120uA @ 1Mhz @ 2.0v.
I am running it at 4MHz @ 4.7v so I make that to be around 1.2mA if i just scale it up. so I cant see there not being enough current.
The circuit is very simple and im using the internal oscillator so im only using Vdd, Vss and the 4 ouput pins connected to LED's.

I also tried using a potential divider circuit with two 1KΩ resistors which produced the right voltage but still no LED's light up.

2. ### Markd77 Senior Member

Sep 7, 2009
2,803
594
There is a calculator on the page that you linked to that calculates the resistor required.
For 4 LEDs I used 100mA and the resistor given was 40 ohms, so 1K is far too high.
Zener regulators can be quite inefficient, probably a proper 5V regulator is better, like the LM78L05.

3. ### blueroomelectronics AAC Fanatic!

Jul 22, 2007
1,758
98
The problem starts with your choice of using a Zener as a regulator.

4. ### electrolyte Thread Starter New Member

Apr 21, 2009
4
0
Yea I also tried a 22Ω resistor but that still didn't work. I think I will use a voltage regulator instead.

I still don't get why it didn't work.

blueroomelectronics why do you think they are not a good idea?

5. ### Markd77 Senior Member

Sep 7, 2009
2,803
594
Zeners are OK for a constant load, but a voltage regulator is much better for variable loads like the PIC with LEDs.
With a zener circuit it uses about the same power with the LEDs turned on as with them turned off. With a voltage regulator, when the LEDs are turned off, the current drawn is reduced to about 1mA for the regulator and whatever the PIC uses.

6. ### blueroomelectronics AAC Fanatic!

Jul 22, 2007
1,758
98
Zeners work but only effectively with simple loads.
Use a 78L05 or similar regulator and a 330ohm resistor on the LED. Also don't forget the filter (LM7805 datasheed) and bypass (0.1uf) caps.

7. ### Markd77 Senior Member

Sep 7, 2009
2,803
594
You could use this circuit if you have a spare transistor. It's somewhere in between the straight zener circuit and the voltage regulator in efficiency. Just replace the variable resistor with the PIC. Voltage is about 0.7V lower than the zener voltage because of the transistor.

File size:
5.7 KB
Views:
57
8. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
Your first selection of 3 AA batteries was far better than the 9v "transistor" PP3 battery. The AA batteries have many times the mAh rating of the PP3 battery, and don't require the use of a regulator in your circuit.

A typical PP3 battery has a life of about 20 hours with a 25mA load; around 500mAh.
Typical alkaline AA batteries have 2500mAh capacity.

When your 9v battery is fresh, half the power is being wasted in the regulator circuit.

9. ### electrolyte Thread Starter New Member

Apr 21, 2009
4
0
Ok I purchased a few different types of regulators so I will try them when they arrive.

I used the 3 AA batteries first because I was only using the PIC and LED's in my circuit but as I progress I want to be able to add different peripherals to the circuit and im sure in the future I will need a higher voltage than 4.5v thats why I wanted to convert to using the 9v and also I dont have a battery holder for my AA batteries so they are taped together .

10. ### SgtWookie Expert

Jul 17, 2007
22,183
1,728
What are the part numbers of the regulators that you purchased?

You really should revert to the three AA battery configuration, as it will save you money on batteries. If the need arises in the future for higher voltage(s), you could always share a common ground with the three AA batteries and a 9v battery to power some new circuitry.

It would be helpful if you added your country and state/province to your profile; click on the "User CP" link at the top, and place the information in the "Location" box, then click "Save changes" at the bottom.

In the USA, Radio Shack stores carry battery holders for many different size batteries, and there is usually at least one store in even fairly small towns.

11. ### electrolyte Thread Starter New Member

Apr 21, 2009
4
0
Oh I am from the UK. Its not hard to get a holder and I will order some as I think they will be useful!

I didn't know that these batteries had such low mAh. But I did also connect a AC mains to DC transformer set to 4.5v @ 500mA and it still wouldn't run the circuit with the zener diode that was why I was a bit shocked!

As for the regulators I got:

78L05 5V 100mA
1.5Amp L7805CV (just to have a high current one for other circuits)