Norman Tomlins wrote: > > I want to be able to read a voltage from a battery and the amount of current > during charging and discharging. This will be used to my 90 watt solar > panel. (More panels to come later) > > I have decided to use a Current Sensor from > http://www.west.net/~escor/XAE25XL60.pdf and have chosen to use the XL60 > amp. > > Okay now the question. > > To Measure the Voltage: > I want to be able to read up to 25.6 volts using a 8 bit a/d convert (25.6 > / 256 is .1 res.) I though about using 2 resistors to bring the voltage > down to 5 volts and then measure it. (A voltage Divider?) That's ok. You can use a single 8 bits ADC with two channels, one for voltage another for current. Use 1% or better > 10k film resistors for the division. > > For the Current: > The voltage is 2.5 volts at 0 amp and 21 mv per amp after that. So at one > amp the voltage output would be 2.539 volts for a current draw and 2.461 > volts when charging. I was wondering if I would have to use a 12 bit A/D > converter to detect the changes in voltage so I could get a decent reading. > I would like to be able to read about 100ma resolution or better if > possible. Is this a good Idea or can someone due better? Keep is simple... The XL60 generates 22mV (not 21mV) per Ampere sensed. Suppose you connect the output of the XL60 to the + input of an op-amp, while the - lead goes to an adjustable voltage divider at 2.45V, so the op-amp will amplify from 11 mV up to 89 mV. If this op-amp gain is 20, your output signal will be from 220mV up to 1.78V. Feeding this signal to a 12 bits ADC (unipolar), with a reference voltage at 2.5Vdc you will read values from 360 up to 2916, being your zero current equal to (1V) 1638, so your resolution will be ADC output 2916-360=2556 for the XL60 output delta of 2.539-2.461=78 / 22 = 3.545A, so 3.545 / 2566 = 0.00138 (1.38mA) per ADC step. A 8 bits ADC would give you a resolution of 16 x 1.38mA = 22mA, zero current would be a count of 102. It is not enough? Adjusting the ADC reference voltage to around 2.262V you can get a resolution around 20mA, easy for your PIC math. Remember that instead of everything above (for current), you can use a shunt resistor of 0.1 Ohm connected directly to the inputs of the 8 bits bipolar ADC, with a ref voltage of 200mV... This shunt will steal only (0.1 Ohms x 1.77A^2) = 313 mW from your system. So, your device will be made with only few resistors, an ADC with two inputs, a PIC and the LCD display. Note: If using 200mV Vref at your ADC, you need to step down the 25.6V to 200mV, use 1% commercial film resistors 64.9 kOhms and 511 Ohms, output is 199.99mV when input is 25.6V, @ 391.3ľA. Wagner.