Published using Google Docs
AusOcean Rig Controller Manual - Original Version
Updated automatically every 5 minutes

AusOcean Rig Controller Manual - Original Version

Revised: 11 November 2019

NB: This version is now deprecated. Use the new version.

Finished controller board (minus the ESP8266).


Copyright

Copyright © The Australian Ocean Laboratory Limited (AusOcean) 2019.

The information contained herein is licensed under a Creative Commons Attribution 3.0 Australia License.

Notice

AusOcean rigs are maritime infrastructure and must be deployed at sea only with approvals from relevant regulatory authorities. Typically a Notice to Mariners (NTM) will be issued to advise mariners of the rig’s location and flashing light sequence.

If you are constructing a rig as part of the Network Blue program, please contact us as AusOcean handles all regulatory approvals in Australia.

AusOcean is not liable for any losses, damages, costs and/or other consequences resulting directly or indirectly from using or relying on the information in this document.


Table of contents

Introduction

Related documents

Photos

Conventions

Standard pinout

Standard colours

Power layout

Wires

Soldering

Connectors

Ethernet power and data

Parts list

Assembly instructions

Preparation

ESP

Solder header pins

Orientation

ESP sockets

Common ground

Reset

ESP boot mode control

Input power connectors

5V power cable

Test the ESP

Power and ground

Bottom power pins

Bottom ground pins

Top power pins

Top ground pins

Relays

Alarm control (AlarmPin)

Input

Output

Power control (PowerPin)

Input

Output

Insert relays

Lights and sensors

Light power output

Battery voltage monitor (voltage divider)

DHT22 sensor

DS18B20 sensor

Connectors

Power configuration

Standard sensors

Other features

Connections

Wire lengths

Voltage doubling

Feeding cables

Connection order

NetReceiver configuration

Variables

Actuators

Testing

Solar charging

Nav light

APPENDIX

ESP8266 tech notes

More info

LCA17 relay

Troubleshooting

Power

Connections

Less common problems


Introduction

The control unit (or “controller”), which is supplied as a kit, houses a microcontroller which controls the navigation light sequencing, battery monitoring, power control and standard sensors. It is based on the Adafruit HUZZAH ESP8266-based microcontroller, mounted on an Adafruit half-sized perma-proto board. It is enclosed within a plastic project box inserted into the bottom of the mast tube (above the mast seal). The control unit also houses the solar charge controller, which is attached to the lid of the box. The ESP8266 is configured by NetReceiver, a free cloud service developed and operated by AusOcean for collecting and monitoring remote sensor data ("sensing") and controlling devices ("actuating").

The control unit utilises two LCA717 relays, known as the “alarm” relay and the “power” relay, specified by the  AlarmPin and PowerPin NetReceiver variables respectively.

The rig controller uses the alarm pin to control power to the router and the power pin to control power to other devices, such as cameras. Both pins can also be actuated like regular output pins, and therefore controlled by means of NetReceiver variables, triggers and crons. Refer to NetReceiver configuration for details and to the ESP8266 tech notes to learn more about the ESP8266.

Related documents

To learn more about NetReceiver refer to NetReceveiver general help and NetReceiver ESP8266 help.

To learn more about the AusOcean Rig refer to the Rig Assembly Guide.

Photos

The finished board will look like the following, with the 24V power rail on the top and the 5V power rail on the bottom. The ESP8266, sensors and connections have been removed to show the wires that would be otherwise be hidden.

In this version the shorting block is in the position for 24V output power, located above and to the left of the alarm relay. For 5V output power the shorting block would be located above and to the right of the alarm relay (currently bare mail pins). See Power configuration.

Figure 1: Controller board without ESP8266 with ports annotated.

More photos of the assembly process can be found here.

NB: Some photos may to earlier versions of the controller.


Conventions

Standard pinout

ESP8266 pin

NetReceiver pin

Direction

Purpose

A0

A0

IN

Battery voltage monitor

GPIO#0

D0

OUT

Alarm control  (AlarmPin)

GPIO#2

D2

OUT

Nav light

GPIO#12

Reserved

IN

DHT22 (temp/humidity sensor)

GPIO#13

Reserved

IN

DS18B20 (water temp sensor)

GPIO#14

D14

OUT

Power control (PowerPin)

GPIO#16 → RST

Reserved

IN/OUT

ESP8266 reset

Standard colours

Colour

Usage

Red

Power (PWR, BOTTOM-PWR or TOP-PWR)

Black

Ground (GND)

Yellow

Digital input or reset

Blue

Digital output

White (not currently used)

Analog input (A0)

Power layout

The top power rail is used for 24V power (TOP-PWR).

The bottom power rail is used for 5V power IN (BOTTOM-PWR).


Mnemonic: High (top) is high (voltage), low (bottom) is low (voltage).

Wires

Use solid core wire. Note that ~4mm must be stripped from the end of each wire, and then bent at right angles. Ensure there is no excess bare wire that might cause a short circuit.

Soldering

All wires should be soldered.

Tip: Secure wires with tape on the top side to hold them in place while soldering.

Connectors

JST connectors, both 2-pin and 4-pin types, are used for all board-wire connections. Looking at the open side of the board connector, the rightmost pin is always power as shown below.

Mnemonic: Right is red.

Figure 2: 2-pin JST board connector

“Right is also red” when crimping plugs with wires below the plug (as shown in the photo below).

Figure 3: 2-pin JST plug

NB: Unless you have a professional crimping tool, do not rely solely on crimp connections when making plugs. Always solder the connections too (as shown).


Ethernet power and data

JST connectors are also used to terminate Power over Ethernet (PoE) and Ethernet data. Ethernet cables consist of four twisted pairs of conductors. These are split into two 4-pin connections, with blue/brown for power and green/orange for data.

“Right is red” also holds for 4-pin PoE board connectors as follows:

1 (left)

2

3

4 (right)

Board

Black

Black

Red

Red

PoE wire

Brown/White

Brown

Blue/White

Blue

The top-right corner of the board is the “data hub” where up to 3 Ethernet devices can be connected. One of these is used to connect the router, leaving 2 slots for cameras or other Ethernet devices. The data wires are connected to the 4-pin JST plug as follows and as shown in the photo:

1 (left)

2

3

4 (right)

Data wire

Orange/White

Orange

Green/White

Green

Figure 4: Ethernet-to-JST data connection

NB: All plugs must be made exactly the same in order for the data hub to work.


Parts list

Item

Variant

Quantity

Adafruit half-sized perma/proto board

1

Resistor (small)

2.2kΩ

2

Resistor

4.99kΩ or 5kΩ

2

Resistor

10kΩ

2

Resistor

150kΩ

1

JST board header

2-pin

4

JST plug

2-pin

1

JST board header

4-pin

6
(7 for 3rd data socket)

IC socket

10-pin

2

IC socket

3-pin

4

0.1" male header pin

2-pin

2

0.1" shorting block

2-pin

1

LCA717 relay

2

ESP8266 HUZZAH (“ESP”)

1

DHT22 sensor

1

DS18B20 sensor

1

Solid-core wire (not included)

Red, black, blue & yellow

various


Assembly instructions

Preparation

Prepare the board by scraping away the conductor at the following locations on the underside of the board as shown in the photo.

NB: When upside down count columns from right to left instead the usual left to right.

Figure 5: Underside of perma/proto board.

Tip #1: It is much easier if conductor is removed prior to soldering.

Tip #2: Upon completion, perform a resistance check with a multimeter to ensure the conductor is removed.

Warning: Failure to remove the conductor completely in the exact specified locations will result in a short circuit that will damage the electronics.

Figure 6: Zoomed view of removed conductor.


ESP

Solder header pins

Solder header pins to the ESP8266 HUZZAH per the following photo (courtesy Adafruit.com).

Figure 7: Adafruit ESP8366 HUZZAH board.

Orientation

Next, we make up the left side of the board that will hold the ESP. Orient the board so that numbers increase from left to right (1 to 30) and letters bottom/up (A to J), as shown in the photos.

ESP sockets

The ESP sockets can be made by cutting a 10-pin dual in-line (DIP) socket holder in half. The longer sides of the sockets should should be on the outside.

Tip: Ensure the correct spacing by inserting the ESP. Do not force the pins into the socket as the socket springs will be damaged.

ESP power and ground

Common ground

Reset

ESP boot mode control

NB: Pulling GPIO#0 HIGH ensures that the ESP boots normally. If GPIO#0 is held LOW during reboot the ESP will enter bootloader mode. The ESP must therefore be removed in order to flash a new version of the software. To learn more read the ESP8266 Tech Notes.

Input power connectors

5V power cable

Make up a 5V power cable using the 2-pin JST plug as shown in Figure 3.

Test the ESP

Test the ESP before proceeding further.


Power and ground

Bottom power pins

Use red wire to connect:

Bottom ground pins

Useblack wire to connect:

Top power pins

Use red wire to connect:

Top ground pins

Use black wire to connect:


Relays

Alarm control (AlarmPin)

Tip: Solder the resistors in place before any of the wires.

Input

Output

Note: Output is selectable to either 5V or 24V depending on the shorting block position.

Power control (PowerPin)

Input

Output


Insert relays

NB: Relays are inserted with the semicircle on the left side as shown below.

Figure 8: LCA717 relay circuit diagram.

Pin #

Description

1

Input control signal

2

Ground

3

Not used

4,6

Supply voltage (5V or 24V)

5

Output voltage


Lights and sensors

Light power output

Connect nav light LEDs with GPIO pin #2:

NB: GPIO pin #2 also drives the ESP8266’s built-in blue LED. Note however that built-in LED is on when GPIO #2 is LOW, and off when it is HIGH. In other words, the built-in blue LED will be OFF when the nav light is ON and vice versa.

Warning: The nav light LEDs should never be powered by more than 3V.

Battery voltage monitor (voltage divider)

Make up a 31:1 voltage divider:

DHT22 sensor

DS18B20 sensor

Connectors

Attach the remaining JST board connectors per the photo.


Power configuration

The first relay, which is controlled by AlarmPin, can output either 5V or 24V power, depending on the type of router used.

Type of router

Router model

Input voltage (DC)

LTE (4G)

NetGear Nighthawk M1 or M2

5V

WiFi

TP Link CPE 210 or CPE 220

24V

 

The second relay, which is controlled by PowerPin, always outputs 24V, which is the standard voltage used by AusOcean underwater cameras. If a lower voltage is required use a DC-DC step-down converter.

Standard sensors

The following sensors are standard with every rig:

Since these sensors are low-power devices they are therefore always powered..

Figure 9: DHT22 sensor

Figure 10: DS18B20 waterproof temperature sensor connected to 4-pin JST plug.

Note that the JST connector is upside down. Red is right when the open side is up.

In addition a Raspberry Pi Zero based camera is typically included, which is powered as needed via the PowerPin.

Battery monitor

The battery voltage is monitored by a voltage divider and, as for the standard sensors, is always powered. The resistor values are 5kΩ and 150kΩ respectively, forming a 5/155 or 1/31 voltage ratio. For a nominal voltage of 24V DC, the current is 0.15mA. The voltage divider therefore draws a tiny 3.6mW continuously (24V x 0.15mA).

The solar charger can produce as much as 29.6V during the boost phase (14.8V x 2), resulting in a draw of 0.19mA or 5.6mA. This only occurs during periods of energy abundance though, typically during the “boost” charging phase.

NB: 29.6V would be divided down to 0.955V at Analog Pin 0 on the ESP8266, i.e., less than the maximum of 1.0V.


Other features

When SensePin is non-zero, the corresponding GPIO pin will be driven HIGH prior to sensing and LOW immediately afterwards. This is useful for power-hungry sensors that should not be powered continuously. Any available GPIO pin can be used providing SensePin is set to that value.

Although the software supports it, the current Rig controller hardware does not currently utilise the SensePin feature.

Connections

Wire lengths

NB: It is important that wires are sufficiently long to permit ease of assembly and avoid wire tension. Any excess should be gently looped into the mast.

Cable

Required length (mm)

Photovoltaic (PV)

650

Battery

700

Nav light

1100

Router (power and data)

1100

Combined air temperature & humidity sensor

250

Sea surface temperature (SST)

Comes in a fixed length of ~500mm

Underwater camera

Varies depending on deployment.

Solar charger 5V power supply

20

Solar charger 24 power supply

22

Voltage doubling

In a standard rig, the battery voltage is 24V. The PV panels, which produce 12V each, therefore need to be connected in series to double the voltage. To do this,  join the positive terminal of one panel to the negative terminal of the other panel using a 3-terminal strip connector, as shown below.

Figure 11: Voltage doubling block.

The battery voltage is normally doubled inside the battery compartment, but in systems in which two 12V battery cables are supplied, the battery voltage will also need to be doubled in a similar fashion.

NB: If your PV panels are new you can instead use the original connectors to connect them in series.

Feeding cables

NB: Insert the mast seal O-ring over the tops of the battery and PV cables prior to connecting the solar charger.

Tip: Leave a little slack on the cables running up from the base of the mast to reduce the risk of abrasion on the aluminum mast base.

Feed the cables so they fit securely inside the mast seal and secure with the O-ring. The mast seal has been specifically designed to account for differing cable widths.

Line up the cables coming down from the mast cap with the hole so they can be fed through easily.

Secure the combined temperature and humidity sensor to the router data cable with tape so that it is elevated vertically within the mast. The goal is to locate it as far away from the control box as possible.

Connection order

NB: Connect positive terminal first

Solar charger:

  1. Battery +/-
  2. PV +/-

Controller:

  1. 24V power
  2. Remaining sensors
  3. 5V power last


NetReceiver configuration

The following is a typical NetReceiver configuration. NetReceiver variables generally take the form DEVICE.VARIABLE but the device ID has been omitted for clarity.

Variables

Variable

Value

Description

AlarmNetwork

10

Start temporary alarm after 10 network failures.

AlarmPeriod

5

Temporary alarm duration in seconds.

AlarmVoltage

825

Start continuous alarm if A0 drops to this value (corresponds to ~24.0V).

AlarmRecovery
Voltage

840

Stop alarm when A0 rises above this value (corresponds to ~24.4V).

AutoRestart

10

Restart automatically if alarmed for 10 minutes.

Pulses

3

Number of nav light flashes (pulses).

PulseWidth

2

Pulse width in seconds (2s means 1s on, 1s off)

PulseCycle

30

Pulse repeat cycle in seconds.

PowerPin

14

GPIO pin that controls the power relay.

Power

on

Value sent to PowerPin.

Actuators

Variable

Output Pin

Description

Power

D14

Turns off device power when off (false).

SuppressLight

X14

Suppresses the nav light when true.


Testing

Solar charging

A loss of power at sea is a very serious failure. Ahead of anything else, it is very important to test that solar charging is functioning normally. The best way to do this is to install the controller and solar charger in an actual rig and then monitor it for 48 hours. The rig should be placed outside and not in the shade. If everything is functioning normally, the battery voltage should vary as follows:

The chart can be explained as follows. At the beginning of each day there is a spike in charging which, in sunny weather, typically lasts for only a couple of hours. This is the “boost phase” during which the charger replenishes the battery which has lost charge the previous night. In cloudy conditions it may of course take longer. Once replenished if the sun is shining the charger will then sit in the “float phase” for the rest of the day. Finally, at night the battery will slowly discharge.

Nav light

The second most important thing to test is that the nav light is flashing according to the required sequence. This requires configuring 3 NetReceiver variables described in the NetReceiver ESP8266 help.

For example, for 3 flashes every 30 seconds, with each pulse 2000 ms wide, the values would be as follows:

Variable

Description

Value

Pulses

# of pulses

3

PulseWidth

Pulse width.

2 s

PulseCycle

Cycle (repeat) period in seconds (optional).

30 s

PulseDutyCycle

Pulse duty cycle (optional).

50 %

Note that a pulse that is 2000ms wide with a 50% duty cycle is on for 1000ms and off for 1000ms.

NB: The nav light will not flash unless both Pulses and PulsePeriod NetReceiver variables are defined. PulseCycle defaults to the monitor period and PulseDutyCycle defaults to 50%.


APPENDIX

ESP8266 tech notes

The ESP8266 is a 3.3V microcontroller that comes with WiFi and a full TCP/IP network stack.

Although it can be supplied with a 5V voltage via VBat, its I/O operates at 3.3V. With the exception of VBat, Rx and Tx, the I/O pins are not 5V tolerant, and applying more than 3.6V on any pin will fry the chip.

The ESP8266 also has a single analog input (A0), with a measurement input range of 0V to 1.0V and an absolute maximum voltage is 1.1V. The rig uses A0 for battery voltage monitoring (via a 1:31 voltage divider). Even though the normal range for a 24V battery is typically 24.4V to 27V, the voltage can reach almost 30V while charging, which is scaled down to under 1.0V.

GPIO 0, 2 and 15 perform special boot mode functions at boot time, described below.

GPIO 0

GPIO 2

GPIO 15

Mode

3.3V

3.3V

0V

Boot normally

0V

3.3V

0V

Bootloader

x

x

3.3V

SDIO mode (not used)

GPIO 2 is pulled high by default (using the internal pull-up resistor), and GPIO15 is pulled low by default. To ensure that the ESP boots normally GPIO 0 must be pulled high. This is accomplished by means of a 10kΩ resistor between the 3.3V pin and GPIO 0.

More info

NetReceiver ESP client documentation:

http://netreceiver.appspot.com/help/esp8266

Github project documentation:

https://tttapa.github.io/ESP8266/Chap04%20-%20Microcontroller.html

Adafruit documentation:

https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout

Boot messages:

https://arduino-esp8266.readthedocs.io/en/latest/boards.html#boot-messages-and-modes

Watchdog functions:

https://techtutorialsx.com/2017/01/21/esp8266-watchdog-functions/

Specification:

https://cdn-shop.adafruit.com/datasheets/ESP8266_Specifications_English.pdf

LCA17 relay

The LCA717 is a single-pole, optically-isolated, normally-open solid-state relay, rated for 30V and 2A of  load current. We use them in the DC-only configuration, as shown below.

Troubleshooting

Power

The most common problems are power related. When testing always use a good 5V power supply that can supply at least 1A and check all connections are solid.

Connections

After power supply problems, the next most common problems are poor connections.

Less common problems

Hardware watchdog timeout (WDT) resets can also be due to hardware or power problems, although these are usually software problems. The latter should not not occur if you are using the proper software. You will need to use the Arduino IDE serial monitor to debug such problems.

These messages look like:

 ets Jan  8 2013,rst cause:4, boot mode:(3,7)