On Sun, Oct 20, 2013 at 02:16:13PM +0100, Wayne Stallwood wrote:
On 20/10/13 10:24, Chris Green wrote:
I actually have a Pi and an Arduino and also something called Pokeys56E, none of them is anywhere near ideal. The difficulty is mostly in the nitty gritty hardware intefacing, getting voltages into the device in such a way that it's unlikely to kill it if/when spikes and noise come along.
That's always going to be the case really unless you move to PLC type systems that have hardened I/O...but then you have to use PLC type development languages and pay PLC type money for the interfaces :-) The little AT-Mega isn't bad really, at least all the inputs (other than pin 1) are ESD safe. It's certainly a bit tougher than the RPi GPIO.
Yes, that's true, the Pi GPIO needs to be treated with kid gloves from the electrical point of view really. Though there are very cheap boards now (for example from Quick2Wire) that do the basics of making it a bit more robust.
Currently on the boat I have an ancient 7" eeePc with a 1-wire to USB interface and sensors on the 1-wire bus. 1-wire is good for various measurements but doesn't seem to have voltage sensors. In fact *nothing* seems to offer decent voltage measuring sensors, there's lots of things with "A2D inputs" but nothing that offers an 'outside world facing' capable one.
I guess you mean you want to measure something other than 0-5v ?
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).
If you want to do something quick and dirty that doesn't need to provide millivolt accuracy like monitor a battery state then that's pretty straightforward, just have the voltage to be measured as the top of a potential divider with the ADC pin or whatever on the middle tap.
At the moment I have 200mV digital LCD meters with (as you describe) resistor dividers providing the appropriate scaling. For local display of the battery voltage these are fine but for the Hall Effect current sensors some sort of auto-zeroing would be useful. For this reason (and for remote monitoring) I would like to use a micro based system.
Then I'd add a fast acting 5.1v zener clamp and fuse the input to protect from overvoltage. In fact there are now prepackaged and cheap (thanks to USB) capable protection arrays that can do exactly that and save you from anything other than a direct lightning strike.
Pre-packaged as in 'on a chip'? ..., oh, yes, I've found some now. I searched for "cable protection arrays" first having slightly misread what you wrote! :-) Just searching for "protection arrays" found some.