Hi Jetpr,
Thanks for the code you sent, I got it working good and I also managed to write some code using push buttons so I can set a reference to warn when the battery voltage drops to whatever level I want, that way if it works the way I envision it to work then I can use different battery combinations and just set my reference (dependent of pretty much any battery source) to sound an alarm when the batteries voltage drop to a certain level. I managed to find some 1% 10K resistors at my local electronics store and with your code it shows 6.5 volts with 4 fresh AA alkaline batteries, the actual voltage of the batteries is 6.43 volts using an old Micronta DMM to check them but I think that's ok. I connected a 5k pot to the ADC as well and it Max's at 10.0 volts and down to 0.0 volts, I'm hoping that's ok? This is my first time working on a project that uses batteries so it should be interesting. I have the reference push buttons code set up so I can set it to tenths of a volt, just like the code you sent me. I can't wait to get some good voltage regulators to try it out.
Thanks man..........
Issac wrote:
Just a thought !
When using the ACIN command for A/D conversion
How is this turned off before going to sleep ?
Does pbp automatically take care of it
Hi Issac,
What I did is to use ADCON1 = 7 statement to turn off the ADC then I set the ADC pin as an output and then set it low with PORTA.0 = 0, that seemed to work good. I noticed that I saved on my milliamp draw by setting the ADC pin low after shutting it off. Before I tried setting it low, the consumption didn't go below (if I remember correctly) about .068mA and would fluctuate (bouncing up and down) up to about.086mA. Then after I set it low it dropped to about .006mA minimum and fluctuates up to about .044 -.060mA and about every 4 or 5 seconds it jumps up to .104mA but just for a ever so brief time, so it did make a big difference forcing it low. To turn the ADC back on I just used Trisa.0 = 1 then ADCON1 = $0E or ADCON1 = 2 but that'll depend on which chip your using..........good thing for me they keep Archives! LOL
Maybe someone could tell me if that's the proper way of doing it, I would imagine there is more than one way of doing it for sure. I just ordered some MIC2954, 250mA Low Dropout Voltage Regulators. The web site I ordered them from just listed them as MIC2954, I don't know if their MIC2954-02BZ or MIC2954-0B3Z or even what the difference is, I think maybe I read something about .5% and 1% but their suppose to be pretty good for battery operated micro's. I also read you have to play around with the capacitor values to get the minimum amp draw. It looks like their pin compatible with a 7805 in a TO-92 case. It says in the data sheet that (if I'm reading it properly) that it uses a low quiescent current (120mA typical) and that it will operate down to 2 volts and produce a 5 volts output? I'm not very good at reading data sheets, anyone here used these before with any success?
Thanks jessey
Bookmarks