Sensors on the Platypus LutraΒΆ
The sensors on-board the Lutra vehicle interface via a (Platypus) custom shield over an Arduino Due. There are three physical sensor ports on the board marked S0-S3 connected with 8-pin Switchcraft Mini-ConX connectors (of use: http://www.switchcraft.com/Documents/conxall_catalog.pdf page 12, and we use part number 6282-8SG-318 though the S for socket can be P for pin, and the last three digits refer to the backshell type).
Note that there are four physical ports, but only three available sensor ports because S0 only supplies power. The sensors must interface to the ports using either RS232 or RS422(485) serial communications. To select the correct serial protocol you must set some flags in the Arduino firmware:
PWR_ENABLE - HIGH to enable 12V output
RX_DISABLE - HIGH to disable serial receiver
TX_ENABLE - HIGH to enable serial transmit
RS_485TE - HIGH to enable RS485 termination resitor (HIGH for HDS)
RS485_232 - HIGH for RS232, LOW for RS485
The Arduino software will format messages in a particular way and send them (as text) to the Android server. Some sample strings from the Arduino:
-> {"s2":{"type":"atlas","data":"10.67"}}
-> {"s1":{"type":"es2","data":" 0 17.6"}}
-> {"s3":{"type":"hds5","nmea":"$SDDBT,,,,,,*45"}}
-> {"s3":{"type":"hds5","nmea":"$SDDPT,,0.0,*55"}}
-> {"s3":{"type":"hds5","nmea":"$SDMTW,17.7,C*05"}}
Note that the sensor number is the first item, then type string then data.