My intention was to test 4 or 5 batteries with a Nano but I'm starting to think that I may need a Mega if I want to test more than 2 batteries.
The problem is that the drain-source voltage drop will change when the battery drains so a second analog voltage reading may be needed to keep the measurements relatively accurate.
Is there a way to keep the drain-source voltage drop the same during the whole testing process?
or
Should I use a tiny relay and an additional digital output to switch the voltage measuring point so I only need one analog input per battery?
What do you suggest?
EDIT: Yeah and pull down resistor not drop down =P
Yeah you may be right. A 0.2V change over the drain-source gives an error of about 7% @ 3V battery voltage, if my calculations are correct. Plus it's gonna be the same for all the batteries anyways.
LiOn battery capacity will vary based on the current drain because of internal cell resistance which causes heat. You should load the cell to match the appropriate current drain and disconnect the battery at or before critical voltage: Voltages | Li-Ion & LiPoly Batteries | Adafruit Learning System
Yeah I have noticed that over the years. I plan to discharge them at 1A @ 4.2V as it's somewhere in the middle of the scale. Would take ages to discharge at 200mA.
Thanks for the articles. I have been using 2.9V for the cut-off but don't remember if it was because I read it somewhere or because the ebay voltage monitor with a relay was off 0.1V.
Just realized that the Nano has two more ADC pins than the Uno so no Mega needed for 4 batteries, if I want to measure voltage on both sides of the load resistor for a tiny bit more accuracy.
By the way, is it possible for the transistor to short between gate and source? Should I add a resistor between the DO pin and gate for extra safety?
There is a circuit called constant current sink. Use that in place of your load. Your schematic needs a bit of help. it flows top down, left to right. The
"drop down" is called a pull down resistor and needs to go to the port pin of the Arduino, not the gate of the MOSFET where it becomes a voltage divider if a gate resistor is used. Also place something in the 25-50 Ohm range in series with the gate, this helps keep things stable. To keep the drain source resistance the same through the test use a lower RDSon part, the resistance change will cause less than one count of the A/D. For your test a MOSFET rated at maybe 5A or greater will be fine.
You want to look for "constant current diode" or " Current Regulator Diodes" as your constant sink. Use that as your load, the current will remain constant as long as there is battery voltage.
Interesting, constant current diodes are something I haven't stumbled upon yet. I need to do some research about those. Thanks for the tip .
Yeah I noticed that after taking the photo =P. The reason I have a pull down resistor to the gate is that I noticed that the MOSFET was half open if the gate was left unconnected. I'm not sure how the inputs work when the Arduino is unpowered so I added a pull down to be sure. But it's unnecessary you say? My MOSFETS turn on at around 1.5V and the Nano outputs 5V so to me a voltage divider wouldn't be too bad. But if the digital pins pull down when it's unpowered then I guess it's not needed.
I intended to use 14N05L, they are rated for 14A. It says RDSon is 0.07ohm @ VGS 4.5V and 0.08ohm @ VGS 10V. That seems very little. VGS threshold is 1-3V and the Nano will output 5V, so that's way past the upper threshold.
Okay so you mean the resolution is so low anyways that it won't be noticed. But if I can find one of those constant current diodes then I don't understand why the voltage across drain-source would change.
I was getting a bit long but When you put the pull down on the gate and drive it from a port pin with a resistor it forms a voltage divider. By putting it on the gate it keeps the gate low during power on, reset, ect so your MOSFET stays off during reset, power down, setup() etc until you command it otherwise. The gate resistors serves two purposes, it helps to keep the MOSFET from oscillation and limits the initial current surge into the port pin when turning on. I like low values for the gate resistor, it keeps the MOSFET switching fast keeping it out of the linear region where it will get hot.
That MOSFET 14N05L should work very nicely for you. Now you can do seven batteries, 8 if you measure the voltage internal to the Arduino.
Problem now is that I'm not finding any current regulating diodes. Okay Mouser had a lot of them but they seem to be mainly for lower current so 500mA was the biggest, and they are pricy considering I need 16 of them if I go for 8 batteries.
And that's likely excluding VAT. We have >20% in my country.
You can connect the batteries in series but it gets more complicated. You could also parallel the diodes. There is more then one source for them if that source is to expensive. You could use a PNP transistors with a voltage reference and a few resistors.
The LM317 seem pretty cheap so it's no problem if I screw up and break some. What voltage can I expect from that circuit? It's 1.25V across the resistor but will IN and OUT of the LM317 have the same potential? Or wait, is it so that circuit also drops the voltage by 1.25V, since ADJ is connected to output?
By the way, so you mean that the Arduino pins are pulled down while it's off? Was is so that there's a huge resistor to ground internally for each pin?
It has no resistors, they probably use pinch FETs, much less silicone. Remember without power it cannot do anything. About the only action is diodes from PN junctions.
The thing was that I noticed that the MOSFET remembers it's last state if the gate is left floating.
-Connect gate to 5V => MOSFET is open
-Disconnect gate and leave floating => MOSFET is still open
-Connect gate to 0V => MOSFET is closed
-Disconnect gate and leave floating => MOSFET is still closed
If I would leave out a pull down resistor and the Arduino pin would not pull down, then the MOSFET would remain open, if that was the last state, after you disconnect supply for the Arduino.
But I tested this and it seems that the pins pulls down when the Arduino is unpowered. So the MOSFET's gate wont be left floating (keeping the MOSFET open), and pull down resistor is not needed as you said. I just wanted to know why not
That is the input protection circuit pulling down the gate which acts like a capacitor. They are the equivalent of a diode connected to + and the anode connected to the port pin. There is also a complementary set on the ground side.