Tuesday, 11 February 2014

batteries - PIC analog to digital converter to measure more than one battery voltage (with different grounds)


I'm trying to build a circuit that can scale down several lipo batteries (5 cell) up to 22V max to be safe to either 3.3V or 5V for measuring with a PIC microcontroller using the analog to digital converter.


Now the problem is I have more than one battery for each motor and each battery is isolated from one another. There is no common ground between them.


Can someone offer some advice on how I can measure the voltage of these batteries using the PIC's ADC. Some form of voltage divider will of course be needed and suggestions on this are welcome.


My analog circuitry skills are extremely weak so please provide as much detail and or references. Any calculations would also be appreciated.



I'd like to ensure some level of filtering/isolation is present due to the LiPos obvious high current usage and noise of the motor.


PS: I know there are very cheap LED voltmeteres on ebay for this but I want to be able to send the sampled voltages back to a base in my project.



Answer



If you can't connect the circuits an analog optocoupler like the IL300 may be useful:


enter image description here


The input and output remain separated, yet you have the analog value of the battery's level available to the ADC on the other side. The IL300 has an excellent 0.01% servo linearity.


(Vcc and ground left and right of the optocoupler are obviously different.)


transfer function
Opamp U1 will try to make its inverting input equal to \$V_{IN}\$, that's


\$ I_{P1} = \dfrac{V_{IN}}{R1} \$



It controls \$I_{P1}\$ by varying the LED's current \$I_F\$, but we don't need this value in our calculation. Since the photodiodes are matched \$I_{P1} = I_{P2}\$, and the output of U2 is


\$ V_{OUT} = I_{P2} \times R2 \$


so that


\$ V_{OUT} = \dfrac{R2}{R1} \times V_{IN} \$


So, even when R1 is drawn far away from U2 it plays a role for it. The circuit might not work if you choose R2 ten times larger than R1 and your input voltage is 2V.


edit
The short circuit current for the photodiodes is 70 µA. If Vin is for instance 1 V then R1 must be at least 15 kΩ to allow the opamps to get Vb also to 1 V. A value of 100 kΩ for R1 (and R2) will give you an input range of several volts.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...