![]() Then you use an open collector driver (which can be just an NFET) with a resistor on the output to pull down each PFET gate when you want to measure. You put a PFET with source connected to each cell positive, and a source-to-gate resistor in parallel with a ~8V zener diode. ![]() One way is to apply a high side switch to each divider. (to be clear none of these are "good" in terms of being a professional/production solution) Sure there are a couple of solutions here. Thanks a lot for reading, I am sorry, if i have fogotten something essentialĮDIT: I hope this is the right sub, sorry if not! I just now could not find a alternative online, that does not use a voltage divider.Īs far as I understand, the voltage devider was crappy calculated, with a much so low resistance, so the cells got sort of shorted out, or the resistance of the voltage divider added to the internal resistance, so that the cells discharged just though the voltage devider. Is there a clever way to read out the individual voltages of the cells, without discharging the cells? Or is it working in theory, but the resistors were calculated poorly? How ever, I just wanted to continue the project, but the first two cells were discharged to about 1.5 or 1 V, so beyond recharge. It worked, but I broke the display, so I had to wait for a new one to arrive and I did not take out the cells. I had help of a friend, who studies something electronic related and he gave me the hint to use a voltage divider, to pull down the voltage enough for the arduino to handle (I calculated it with about 4.5V, and adjusted the values in the code, to match the measured voltage). I checked the voltage of the individual cells after letting it rest for a while, and the voltages seemed to be fine. You can try and see what happens with the simple resistor solution, might work and be okay, but I wanted to show you an alternative.I started a Li-Ion 18650 battery-project for a diy-bluetooth speaker this summer, but only reacently got around to continue working on it. Compared to the 2.2♚ maximum drawn by VBAT domain, this is not too heavy of an impact.ĭownside is of course the added complexity on the board, you need another pin to switch the battery to the ADC and the costs. It provides a nice low impedance path to measure the voltage for the ADC. In the end we are looking at 150nA maximum, 12nA typical at 25☌ additional drain from the battery with this analog switch. And it turns out to be really low, a maximum of 50nA over the whole temperature range. In the datasheet this corresponds to \$I_\$). So the chip is powered and we are looking for the leakage current of the NO-pin. In this state only the supply current and the leakage current of the NO-pin is draining the battery (and of course the VBAT domain of the STM32). It's a bit tricky to get which number we are looking at, so let me first explain how I'd wire the thing up:Īs soon as you power down the microcontroller, the pulldown resistor will ensure that the analog switch flicks to the normally closed pin, which we tied to ground with another 100k resistor, so it doesn't float. Next thing we want to watch out for is leakage current of the inputs, which might be higher than the supply current in this case. Only a maximum of 100nA over the whole temperature range (careful which supply current condition you look at in the datasheet, I'm referring to the 3.3V pages). The supply current for this part is really low. A look in the datasheet shows, that this is indeed the case. Now, as it is an IC, it will most likely be specified in a similar way than a microcontroller, that no input shall be above the supply rail. Something like a TS5A3160 from Texas Instruments (there are lots of alternatives available, this will probably not be the best part available). So can we do better?įirst thing which comes to mind is using an analog switch. Now measuring the battery with a 1MegOhm resistor is not the best idea, it's easy to get distortions and you have to be careful to select a long enough sampling rate to charge the sampling capacitor. It will be less, but predicting how much is a bit difficult. ![]() With this setup you limit the maximum current to be at most 3♚. Simulate this circuit – Schematic created using CircuitLab So it would lead to an excessive current draw on you backup domain.Ī simple solution might be to put a large resistor in series. If you were to connect the VBAT directly to another pin of the STM32 and turn off the main power supply, the protection diodes would start conducting and try to power the STM32. The problem arises as soon as you power off the microcontroller. Sadly the STM32F103 series does not offer an internal ADC channel connected to VBAT, so you have to connect it externally.
0 Comments
Leave a Reply. |