On 20/10/13 15:40, Chris Green wrote:
Well, yes, surprisingly the 12 volt batteries and voltages from the Hall effect current sensors which are mostly either +-2.5 volts or 0 to 2.5 volts (corresponding to all sorts of odd full scale values).
Ok both of those are fairly easily solved as well. You could fix either problem with an op-amp circuit, though the simple solution for the first one would itself need a -v reference supply so you'd have to add a little dc-dc converter for that as there are no* -v supplies on the Arduino
Alternatively for the 0-2.5 measurement if you want the full resolution you could cheat and just set the arduino onboard ADC's reference voltage to a little over 2.5v with a potential divider. That will rescale the ADC to 0-2.5v in 1024 steps.
But even using half the ADC by feeding it 0-2.5 with a 5v reference you still have 5mv resolution.
The only downside is of course setting AREF affects all the ADC pins on the arduino....there is of course a way around that but I'll let you figure that one out for yourself as I am not even sure the Arduino IDE supports selecting the AREF source ;-)
* There are on the original serial arduino shields, but you'd have to tag onto chip legs to get to them.