One of the best methods to visualize ROV data is to show them as overlay on images from camera. This board is intended to use in solutions where there are no special control box on the surface that is able to process sensor data. For solutions with control panel, it is better to send sensor data via RS485 to the surface and than display it using hardware installed in control box. Generally speaking, if you have RC controller and video monitor this is solution for you. This project was developed with cooperation of SUBZNZ ROV.
For C5 and C6 capacitors (next to crystal) use 22pF instead of 22nF. Originally project was developed to use BOB-3 OSD module. But in time of development, Decade Engineering began to sell BOB-4 module, making BOB-3 unavailable. To make it possible to build ROV Sensor Board using BOB-4, a new version of PCB was developed. BOB-4 do not need 12V and uses different commands to display text. If you want to use BOB-4 module, use files with BOB4 prefix. Files without this prefix are for BOB-3 version. Both versions of projects uses the same components (so there is only one BOM file for both projects) except 3 resistors: R7, R8 and R9. They are not needed for BOB-4. NOTE Default sensors to use with board:
Single layer no SMD elements. Recommended drill sizes:
Here are some photos of first prototype PCB. Made by SUBZNZ.
Here is a short description of all interfaces and small example programs. All examples are in BASCOM-AVR. Some of the visible output data is sent to RS232 (9600 8N1 no hardware handshaking). Be sure to set appropriate fuse bits to use external crystal. By default atmega8 chip uses 1MHz internal oscillator. Interface can be connected directly to serial port of PC. You must use serial UART routines to send/receive data. $regfile = "M8DEF.DAT" $crystal = 7372800 Open "comd.6:9600,8,n,1" For Output As #1 'RS232 do print #1, "Hello world" wait 1 Loop To see the result, run HyperTerminal program and set transmission parameters to 9600 8N1, handshaking: none. RS485 interface is connected to hardware UART. It is important to set send/receive mode of MAX485 chip before any communication (it half-duplex). $regfile = "M8DEF.DAT" $crystal = 7372800 $baud = 9600 Config Serialin = Buffered , Size = 20 Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0 Config Print0 = Portb.0 , Mode = Set 'this configue PB0 as mode RS485 switch Print "THIS IS RS485 TEST" Do Print "RS485 communication works" Waitms 500 Loop Check RS485 output to see the results. BOB-3 or BOB-4 module is used to display text on video screen. Both modules are controlled via serial interface. The only difference is that modules have different command sets. Serial interface lines are connected to PD5 (TX) and PD4 (RX) pins. That means you must use software UART routines for communication. $regfile = "M8DEF.DAT" $crystal = 7372800 Open "comd.5:9600,8,n,1" For Output As #2 'BOB OSD module print #2, "Hello world!" Do Loop Check video to see the results. Leak is indicated by logic 1 on PD2 for LEAK1 sensor and on PD3 for LEAK2. You must configure PD2 and PD3 ports as inputs (activation of atmega8 internal pull-up resistors is not required). $regfile = "M8DEF.DAT" $crystal = 7372800 Open "comd.6:9600,8,n,1" For Output As #1 'RS232 Config Portd.2 = Input Config Portd.3 = Input do If Pind.2 = 1 Then Print #1 , "LEAK1: water" If Pind.3 = 1 Then Print #1 , "LEAK2: water" Waitms 100 Loop Check RS232 output to see the results. Output of pressure sensor is connected to PC3 pin which is ADC3 input. Any sensor with 4-20mA output can be used. Use internal reference voltage for ADC to read sensor output. The following example displays current value on sensor output. Pressure/depth depends on sensor type you use. For more details how to convert current value to depth you can read Pressure Sensor article. $regfile = "M8DEF.DAT" $crystal = 7372800 Dim Vol1 As Single Dim Volstr As String * 10 Const Factor = 2.56 / 1023 Const Res = 220000 + 47000 Declare Function Get_pressure_curr() As Single Config Adc = Single , Prescaler = Auto , Reference = Internal Open "comd.6:9600,8,n,1" For Output As #1 'RS232 diagnostic output Open "comd.5:9600,8,n,1" For Output As #2 'BOB OSD module Print #1 , "This example displays current value from sensor output" Do Vol1 = Get_pressure_curr() Volstr = Fusing(vol1 , "##.#") Print #1 , "Pressure sensor: " ; Volstr ; "mA" Print #2 , "{C1501PRESSURE SENSOR:" ; Volstr ; "mA" 'works only for BOB3 Waitms 500 Loop Function Get_pressure_curr() As Single Const Resistor = 120 Dim C As Word Dim Voltage As Single Dim Current As Single C = Getadc(3) Print #1 , "ADC3 (DEPTH): " ; C 'for ST09 '4ma = 0bar '20ma = 16bar Voltage = C * Factor Current = Voltage / Resistor Get_pressure_curr = Current * 1000 'result in mA End Function There are 3 headers with ADC input pins. Originally were designed to be used with ACS750 chips, but can read any analog value. 'SENSOR BOARD DIAGNOSTIC TOOL $regfile = "M8DEF.DAT" $crystal = 7372800 Dim V As Word Dim Vol1 As Single Dim Vol2 As Single Dim Volstr As String * 10 Const Factor = 5 / 1023 Declare Function Get_current() As Single Config Adc = Single , Prescaler = Auto , Reference = Avcc Open "comd.6:9600,8,n,1" For Output As #1 'RS232 diagnostic output Open "comd.5:9600,8,n,1" For Output As #2 'BOB3 OSD module Start Adc Print #1 , "SENSOR BOARD DIAGNOSTIC TOOL (MEASURE ONLY CURRENT ON SL8)" Print #1 , "" Do Vol2 = Get_current() Volstr = Fusing(vol2 , "##.##" ) Print #1 , "Current: " ; Volstr ; "A" Print #2 , "{C1002CURRENT: " ; Volstr ; "A" 'output to bob3 Wait 1 Loop End 'end program Function Get_current() As Single Const V2a = 50 / 2.5 'SL8 header (ADC0) V = Getadc(0) Print #1 , "ADC (Current): " ; V 'output range from 0 to VCC 'VCC/2 = 0A 'voltage on adc input Vol1 = Factor * V 'convert to current '2.5V = 0A '0V = -50A '5V = 50A Vol2 = Vol1 - 2.5 Vol2 = Vol2 * V2a Get_current = Vol2 End Function Power voltage sensor is simple voltage divider connected to PC4 pin which is ADC4 input line. SDA line is connected to PB1, SCL line is connected to PB2. I²C interface do not use built-in TWI module. $regfile = "M8DEF.DAT" $crystal = 7372800 'I2C config Config Scl = Portb.2 Config Sda = Portb.1 Dim Cmd As String * 30 Dim Curr_heading As Integer Dim New_heading As Integer Dim Message As String * 30 Declare Function Get_heading() As Integer Declare Function Get_firmware_version() As Byte Open "comd.6:9600,8,n,1" For Output As #1 'RS232 diagnostic output Curr_heading = 400 'main program Print #1 , "Compass Test" 'Initialize I2C I2cinit 'wait 3secs for compass init (could be about 1s) Wait 3 Print #1 , "Reading CMPS firmware version..." Print #1 , "CMPS03 FIRMWARE VERSION: " ; Get_firmware_version() Print #1 , "Start watching compass..." Do 'read compass New_heading = Get_heading() '180deg is like 1800 New_heading = New_heading / 10 If New_heading <> Curr_heading Then Curr_heading = New_heading Message = "COMPASS: " + Str(curr_heading) Print #1 , Message End If 'read compass heading every 500ms Waitms 500 Loop End 'end program 'Read firmware version of the compass Function Get_firmware_version() As Byte Local Firmware As Byte Local Cmps_slaveid As Byte Local Cmps_slaveid_read As Byte Cmps_slaveid = &HC0 Cmps_slaveid_read = Cmps_slaveid + 1 I2cstart I2cwbyte Cmps_slaveid I2cwbyte 0 I2cstop I2cstart I2cwbyte Cmps_slaveid_read I2crbyte Firmware , Nack I2cstop Get_firmware_version = Firmware End Function 'read comapss heading Function Get_heading() As Integer Local Lob As Byte Local Hib As Byte Local Cmps_slaveid As Byte Local Cmps_slaveid_read As Byte Cmps_slaveid = &HC0 Cmps_slaveid_read = Cmps_slaveid + 1 I2cstart I2cwbyte Cmps_slaveid I2cwbyte 2 I2cstop I2cstart I2cwbyte Cmps_slaveid_read I2crbyte Hib , Ack I2crbyte Lob , Nack I2cstop Get_heading = Makeint(lob , Hib) End Function Data line is connected to PC5 pin.
|
|||||||||||||||||||

