I have a robot running the RasiBot board and a 7.2 NiCD battery like the ones used for RC cars. I've been googling on how to measure the SOC but I can't find a plugin solution. Only ones for LiPo batteries.
Richard, I've seen smart NiCd charging circuits use a system of charge then test cycles to charge the things. The test relies on a power transistor switching a load across the battery while the terminal voltage is measured. The actual loading occurs in a very short time else the battery never gets charged. I've seen this load be no more than a few micro farad capacitor with a discharging resistor in parallel. The output of a simple voltage comparator would signal the full (or otherwise) charge during the loading cycle.
A simple program that triggers the load and looks at the comparator output is all that is needed. Some design care is needed to ensure the output of the comparator never exceeds the Pi's 3.3v while also being able to measure the 7.2 (or more) battery voltage. Remember that the loading circuit will need time to recover, i.e. the capacitor can fully discharge via the resistor before the next cycle.
You'll need to get the timing right to get a reliable system and loads of experimenting but that's what it's all about.
Thanks for the reply. I have had a bit more of a google and a think. Seems asking "how much charge is left" is not easy to do. But thinking about it, all I need to know is "should I shut down now". I'll have a think and read about what you have said and see if I understand it. Will take me a few days peculate in the brain cells, I'm still a noob at electronics.