On 28/10/12 10:58, Chris Green wrote:
Yes, I'm conscious of the grounding problem. While the boat wiring (the batteries are on a boat) is quite well behaved in having a single earth point to the hull etc. the length of the wires to the voltages being measured are such that there may be problems.
Well the serial communications can go through a significant length of cable, hell i2c to the adc chip can be a significant length if you clock it down enough. So why not put the adc's near the batteries you are monitoring ?
I was thinking about Arduino (I already have one) but it gets a bit 'messy' to have something like:-
Desktop PC (where Arduino code would be written/built) | V eeePc (or Raspberry PI) on the boat | V Arduino
If I can instead have some hardware read/written by a Python script (or something similar) that can be done 'locally' on the boat eeePc then life would be simpler.
Sorry I'm confused here, what does building the arduino code on your desktop have to do with anything ? It's not in the chain as part of the live system.
Really you could be using the arduino as a smart bridge between Serial and i2c, If you put that in the way then it could spit out raw or even converted values and your python just needs to log or do whatever you want with them. It could even log and buffer data when the PC isn't available to collect it (which may make sense if that would be the only reason for the PC remaining powered up, even a RPi is a bit power heavy and self defeating to be used as a battery charge monitor)
If you use a dumb i2c bridge then you'll actually need to form and interpret the i2c packets at the PC end, you could do that in python as the bridge just presents a serial interface.
For me I'd do it all in the microcontroller because the parts cost will be the same as getting a dumb i2c bridge but there will be less work to do at the PC end...but that's just me :)