Would adding a bigger load to the pack solve the problem? A bigger load should pull the cells down to 1.2v per cell to give me a max of 4.8V on a fully charged pack? perhaps a 500ma load?
Would adding a bigger load to the pack solve the problem? A bigger load should pull the cells down to 1.2v per cell to give me a max of 4.8V on a fully charged pack? perhaps a 500ma load?
Bad Idea ...
just use a voltage divider in the input ...
1/2 is the easiest to find ( 2 equal 1% resistors ) ...
2/3 is still easy ( 1 k and 2k resistors @ 1%)
Installing a load that can draw 300 - 400 mA on demand is rather a good thing ...
But think regulator doesn't output EXACT 5.000 v ... so measure it and enter value as a parameter for calculations ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I have an idiot grin on my face, :-) im making some really good progress, I have the pulse in now displaying on the screen (strange from a JR Rx Im getting a range from 560 - 990 from the pulsin) and have the ability to jump to a servo test (sweep from side to side) at the push of a button, :-)
My ADC is sort of working, with the voltage divider I'm getting 2.54V on my DMM, however if I display the ADC input Im only seeing 2 and not the .54 (obviously this will be multiplied by 2 once i get the decimals). I have tried:
Code:lcdout $FE, $C0+8, dec volt and lcdout $FE, $C0+8, # volt
but still only get the first digit. Is this due to the ADC VAR being a "WORD"
My Vref from the regulator is 5.00V on my DMMCode:Volt Var WORD . . . ADCIN 4, volt . . .
Not sure im getting this whole ADC concept, I;ve read another one of Melanie's posts and from what I can work out, my RAW ADC in variable should be as follows:
if my Vref = 5.00 then if my ADCIN was exactly 5.00V the ADC result would give me 1024, however I am giving a ADC of 2.54 I should get a value in the variable of 520? however I am displaying a single digit "2" on the LCD with the code above, not sure how to do the math on this.
Last edited by Bobbo_ZA; - 30th March 2010 at 20:56.
Ah, ok, finally, im a git, :-)
Im now reading a 520 adc value with the battery on and the DMM measuring 2.54 (Needs to be multiplied by 2 to reverse the voltage divider effect).
Err, something not right, im missing something with the math:
pulling out many hairs, :-( my biggest issue is that even in school my maths was not great, spose thats why Excel was invented, for people like me, :-)Code:ADCIN 4, volt ' Read AN4 into temp variable Vin = (5*volt/1024) ' Convert to voltage assuming 5.00 = 1024 lcdout $FE, $C0+8, dec Vin,".",dec2 Vin,"V"
Last edited by Bobbo_ZA; - 30th March 2010 at 21:56.
just not getting the decimal places now, :-(
Latest attempt
Time to pack it in for the night, work tomorrow, fairly good progress, just the decimal points to figure out.Code:ADCIN 4, volt ' Read AN4 into temp variable volt = volt * 2 Vin = (5*volt/1023) Vind = (volt // 1000) / 10 'millivolts? lcdout $FE, $C0+8, dec Vin,".",dec2 Vind,"V"
Kind Regards
Rob
Am I on the right track?
the "//" operator will store the remainder in the chosen Var, thus:
Sorry for getting overly complex with this but trying to understand how it works, I have been able to simulate what I need to do in excel, just not sure if the above will work in PBP:Code:ADCIN 4, volt ' Read AN4 into temp variable volt = volt * 2 'Correct the ADCin for the Voltage divider? FVolt = (5*volt/1023) MVolt = (5*volt // 1023) 'millivolts? lcdout $FE, $C0+8, dec FVolt,".",dec4 MVolt,"V"
D1 = Vref @ 5.00
D5 = Adc Corrected @ 1021
D6 = 10 bit ADC @ 1024
D14 = Whole number (Formula =TRUNC(D9,0), result = 4
D15 = Remainder (Formula =(MOD((D5*D1)/D6,1)*1000)), result = 990
I could then LCDout D14, ".", D15 in theory if the formula in PBP equaled the excel result.
not sure though, still a bit confused
Cheers
Rob
Last edited by Bobbo_ZA; - 31st March 2010 at 09:39.
Ok Rob,
What about :
that's all !Code:ADCIN 4, volt ' Read AN4 into temp variable volt = volt * 2 * 5 Volt = 100*volt ' See manual for DIV32 !!! Vind = DIV32 1024 ' Here we have result in 1/100 Volts ... Vin = Vind/100 ' Here we get the integer part ... Vind = Vind // 100 ' Here we get the decimal part ... lcdout $FE, $C0+8, dec Vin,".",dec2 Vind,"V"
Last edited by Acetronics2; - 31st March 2010 at 09:37.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Cant believe it can be that simple, i was trying to over complicate things, :-)
Will try it again tonight, :-)
Achievements So far:
1. Hitachi LCD interfaced to 16F876A
2. Read input from RC Receiver
3. Drive a Servo from the PIC
4. Display pulsin values on the LCD
5. Measure Flight Pack voltage - with load on demand
Still to do:
1. Menu system for each function
2. separate components into sub functions
3. Move off Breadboard and build into an enclosure of some sort.
List of proposed features:
1. Rc Flight pack battery tester
2. Servo Tester - with Sweep and Centering
3. Current monitor - planing to add either SI210709-300T (50A) or ACS750
4. Receiver Pulse monitor for other PIC projects
5. Thermometer - Although I think I'm all out of AD inputs
6. Sure Im going to come across some more features to add to it, :-) any ideas?
Bookmarks