Clever, very clever and fast also! Thanks again Saizer!
Pablo
There are also this tiny caps 100,000uF/5.5v.
or if you have some little more space, 1Farad/5.5v.
(1,000,000uF/5.5v) these are very small compared to the cap size.
If you can use one of these tiny ones, you can have your PIC running for hours when the battery goes off; but to know for how long it would last with a LED in ON state, you need to try.
----------------------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Now that I know how to detect when the power went down, I simply put the led output pin low and that solves the issue of the capacitor.
You really helped me Sayzer in a very timely fashion. Thanks again
Pablo
Sayzer: Today I had time to put your words into code, I tought that I understood it, but now I see I dont
Here is what I uderstood from you schematic idea:
Did I getit wrong?
I dont have a clue (again) on how to detect on software that the battery went off.
Any help would be greatly appreciated. Thanks!!!
Ok, here is one concept.
You have an advantage here, ADC reading, that you can actually measure the voltage; it does not have to go off as you can continuously check the voltage level.
Since you are using a battery, power-off concept may not be a good (or let say precise) solution for you. But if you had a non battery operation with this circuit, this is the way to go.
Thus, reading (monitoring) the battery voltage at AN0 in your case is much more accurate.
Try and see....
<img src="http://img6.picsplace.to/img6/23/poweroff.gif" alt="Image Hosting by PicsPlace.to" >
Edit: I will post another circuit to read the voltage level with AN0.
------------------------------
Last edited by sayzer; - 22nd November 2006 at 06:52.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
My app is always battery powered, that diode makes senseI'm keeping an eye on the other circuit. Thanks!
I was thinking about measuring the battery with ADC but then I realized that Vref will be Battery V+ and the ADC will be tied to V+ also.
As the battery goes down, the ADC Vref will also go down in parallel and the result will never change in theory. Even a resistor tied from ADC pin to either Gnd or V+ will also be perfectly proportional to battery V+ when it is going down. Thus ADC will not see the difference, I think.
This is just possibility came to my mind but I am sure someone already has done something similar and is experienced with this.
Am I right on this or there is another way to do it?
----------------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks