Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using a 9V battery to power a 18F microcontroller

Status
Not open for further replies.

micro9000

New Member
Hello again, I am now trying to power my PIC18F4685 via a 9V battery. I am going to be powering 8 LEDs hooked up to RA0 to RA7. I have measured that the total current draw of the 8 LEDs is 110mA.

From your experience, what resistance values should I be using and what should the external resistive circuit look like? I have tried a few things, but I would like to hear your input on the matter. Thanks in advance.
 
First of all you cannot power a PIC18F4685 with 9V directly as its operating voltage is from 2 to 5.5V. (Suggestion: You can use a voltage regulator IC (LM7805) to get a stable 5V supply for the PIC). The maximum source/sink current for the PIC ports is 25mA. If we assume that each of your 8 LEDs draw equal amount of current, then each of them will draw about less than 15mA, which is within limit. If I were running my PIC with 5V power supply, I would use 470 Ohms resistances in series with each of the LEDs .
Thanks.
 
Yes, I realize that the microcontroller's input voltage should be around 5V, which is why I asked what type of resistive circuit you would use for a 9V battery going into the microcontroller.

EDIT: It works! I had a 7805 lying around much appreciated. I was originally looking into a resistive circuit, but this is a much better way to go about it. Thanks!
 
Last edited:
LM7805 has always been my old standby for regulating power to 5V.

With a 9V battery, you won't be able to power your MCU for long, because a 9V battery quickly goes down to ~7 volts. The 7805 will dropout around that point...
 
Last edited:
you can use a LDO 7805 which is a Low Drop Out.... i would also test using a 5v zenor diode to drop voltage...... not sure if a Resistor Divider would be good.... depending on how much current is whole thing
 
Just a quick note, I have had a 7805 ACT? (100mA version) connected to a 9V Battery for over 2 years now, the PIC controls a CCTV Camera (Pan, Tilt, Zoom) Pelco D protocol, and although constant use isn't there, it is used a tool for camera engineers on site work visits fairly reguarly, and it is still going strong, it is a Duracell Battery.

I was quite surprised when I switched it on the other day and it still worked perfectly.

So for low current applications, that little regulator is very good in my experience.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top