Published using Google Docs
AusOcean Rig Controller Guide (PCB)
Updated automatically every 5 minutes

AusOcean Rig Controller Guide

Revised: 3rd June, 2022

Authors:  Frank Cui <frank@ausocean.org>

          Breeze <Breeze@ausocean.org>

Copyright

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

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

1.0 Introduction        3

1.1 Related documents        4

2.0 Overview        4

2.1 Board Layout        4

2.2 Standard ESP I/O pins        6

2.3 Battery monitor        6

2.5 Navigation light        7

3.0 Components        8

3.1 Mini Fuse Holders        8

3.2 JST connectors        9

3.3 ESP2866 HUZZAH        9

3.4 LCA717 relay        10

3.5 DHT22 Temperature and humidity sensor        11

3.6 DS18B20 Underwater temperature sensor        11

4.0 Assembly instructions        12

4.1 Step 1: Orienting and positioning        12

4.2 Step 2: Soldering        12

4.3 Step 3: ESP setup        14

Materials        14

Method        14

4.4 Step 4: Testing        15

Powered connections        16

Internal connections        18

Resistance        18

ESP        19

4.5 Step 5: Mounting        19

APPENDIX        20

A.1 Controller board schematic        20

A.2 Controller board footprint        21

A.3 Controller board 3D model        22

A.1 Resistors        23

A.2 ESP8266        24

A.3 More support        25


1.0 Introduction

The controller contains a microcontroller that controls the navigation light sequencing, battery monitoring, power control and sensors. It is a Adafruit HUZZAH ESP8266-based microcontroller, mounted on a custom printed circuit board (PCB). The fully assembled controller is enclosed in plastic housing which is inserted into the centre of the mast tube. The ESP8266 is configured by NetReceiver (a free cloud service developed and operated by AusOcean) for collecting and monitoring remote sensor data.

1.1 Related documents

2.0 Overview

2.1 Board Layout

The finished board layout will look similar to the following figure.

Figure 1: Controller board without ESP8266.

Warning: Relays, JST headers and ESP must be oriented exactly as shown.

Some important features of the board are numbered and highlighted below.

NOTE: This board is a previous version. Note differences in pin locations i.e. nav light, DHT22 and DS18BO. See photo above for correct positioning.

Figure 2: Controller board with numbered labels.

Table 1: Controller board features.

Number

Description

1

2-pin JST headers for 5V/24V power IN

2

Three surface mount mini fuse holders protecting two peripherals and one router

3

Battery voltage monitor

4

Note that the ground connection is represented by a square pad

5

Two additional optional sensors (these correlate to the resistors denoted by “?k”)

6

Navigation light is powered by the board though a 2-pin JST header

7

4-pin JST header for temperature and humidity sensor

8

4-pin JST header for underwater temperature sensor

9

Data hubs that are isolated from other components on the board

10

Power over ethernet used to power two peripherals

11

Three relays for switching on/off two peripherals and one router

12

Select between 5V and 24V for the respective router by shorting either connection

13

2-pin JST header for powering a router

2.2 Standard ESP I/O pins

These refer to the pins on the ESP (see Figure 5) and their associated NetReceiver pin. Each pin will either be assigned to receive or send signals.

Table 2: ESP and NetReceiver pin association

ESP pin

NetReceiver pin

Direction

Usage

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

2.3 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, the current is 0.15mA. The voltage divider therefore, continuously draws a small amount of power (i.e. 24V x 0.15mA = 3.6mW). The solar panels can produce as much as 29.6V during times of abundance solar energy, resulting in a draw of 0.19mA or 5.6mA.

Tip: 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.

2.5 Navigation light

The nav light should flash according to a sequence. This requires configuring three NetReceiver variables described in the NetReceiver ESP8266 help. 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%. For example, for 3 flashes every 30sec, with each pulse 2sec wide and a 50% duty cycle (ON for 1sec and OFF for 1sec):

Table 3:  Example navigation light sequence

Variable

Description

Value

Pulses

Number of pulses.

3

PulseWidth

Pulse width.

2sec

PulseCycle

Cycle period (optional).

30sec

PulseDutyCycle

Pulse duty cycle (optional).

50%

Tip: GPIO#2 drives the ESP8266’s built-in blue LED which turns ON when it is LOW, and OFF when it is HIGH. In other words, this LED will be OFF when the navigation light is ON and vice versa.

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


3.0 Components

Here we explore the components required to construct an AusOcean rig controller board. See Table 4 for a complete list of parts. The following subsections will provide more detail on major components namely fuse mounts, JST connectors, ESP, relays and sensors.

Table 4:  Parts list

Item

Variant

Quantity

AusOcean control board PCB

1

Resistor

2.2kΩ

3

Resistor

5kΩ

2

Resistor

10kΩ

2

Resistor

150kΩ

1

JST header (male)

2-pin

3

JST header (male)

4-pin

12

IC socket

10-pin

2

LCA717 relay

3

ESP8266 HUZZAH (ESP)

1

DHT22 temperature and humidity sensor

1

DS18B20 temperature sensor

1

3588 Keystone mini fuse holder

20A, 500V rated

4

Tip: To obtain 10-pin IC sockets, snap a longer row of sockets at the correct length and smooth the ends with sandpaper (optional).

3.1 Mini Fuse Holders

These surface mounted blade fuse holders have four outgoing pins and are designed to hold a single fuse up to 20A.

        

Figure 3: SMT 3588 Keystone mine fuse holder

3.2 JST connectors

JST connectors, both 2-pin and 4-pin types, are used for all board-wire connections. In the orientation below of the board connector, the rightmost pin is power and the leftmost is ground. Mnemonic: Right is red.

                

Figure 4: 2-pin JST board header (left) and plug (right).

Tip: Use solder to secure connections unless a professional crimping tool is available.

3.3 ESP2866 HUZZAH

        

Figure 5: Adafruit ESP8266 HUZZAH board.

3.4 LCA717 relay

The LCA717 is a single-pole, optically-isolated, normally-open solid-state relay, rated for 30V and 2A of  load current. They are used in DC-only configuration, see Figure 6.

                

Figure 6: LCA717 relay circuit diagram (left) and 3D model (right).

Table 5:  Relay pins

Pin

Description

1

Input control signal

2

Ground

3

Not used

4/6

Supply voltage (5V or 24V)

5

Output voltage

Warning: Relays must be inserted with the semicircle oriented correctly as in Figure 1.

The controller utilises three LCA717 relays, that are controlled by ESP pins. These pin values are determined by their corresponding NetReciever variables, see Table 2. Besides providing some circuit protection, these relays are used to limit power for mission critical functions. They are able to switch off individual peripherals or the router if compromised or not required. Each relay is controlled as follows:

Tip: Peripherals are devices such as cameras and speakers.

3.5 DHT22 Temperature and humidity sensor

DHT22 is a combined air temperature/humidity sensor located in the mast. Since these sensors are low-power devices they are always ON.

Figure 7: DHT22 sensor

Table 6: DHT22 sensor pins

DHT22 pins

Wire

Usage

JST plug pin

1

Red

VCC

1

2

Yellow

Data

2

3

-

-

3

4

Blue or Black

GND

4

3.6 DS18B20 Underwater temperature sensor

DS18B20 is a waterproof sea-surface temperature sensor located just below the surface of the ocean.

Figure 8: DS18B20 sensor.

Table 7: DS18B20 sensor pins

Wire

Usage

JST plug pin

Red

VCC

1

Yellow

Data

2

-

-

3

Blue or Black

GND

4

4.0 Assembly instructions

4.1 Step 1: Orienting and positioning

4.2 Step 2: Soldering

There is no particular order to solder the components on, but it may be easier to start with smaller components such as resistors then relays. Remember to leave enough wire at either end of each resistor such that it extends about 1mm above the back surface of the board when they are positioned. See Figure 1 for orientation of JST headers, relays and general board layout. After soldering on all components, you can proceed to the next step.

Tip: Secure components with tape on the top side of perma-proto board to hold them in the correct location then flip the board and solder from the bottom side.

Tip: To ensure correct spacing of the  ESP sockets, insert the ESP into each set before soldering.

Warning: Be wary of overheating components such as JST connectors and pin headers as the plastic may deform and damage the contacts.

Table 8: Component assembly and details

Item

Location

Description

Power

2-pin JST header

J2

5V IN.

2-pin JST header

J1

24V IN.

ESP

10-pin IC socket

IC1 (left)

The ESP sockets.

10-pin IC socket

IC1 (right)

Resistor 10K

R5

Boot mode control (between 3.3V and GPIO#0).

Router control relay

Resistor 2K2

R6

2-pin JST header

J3

5V/24V OUT.

Solder

J13 or J14

Select 5V or 24V by short-circuiting.

Peripheral 1 control relay

Resistor 2K2

R10

Peripheral 2 control relay

Resistor 2K2

R7

Navigation Light

2-pin JST header

J7

Battery voltage monitor

Resistor 150K

R1

Resistor 5k

R2

DHT22 sensor

4-pin JST header

J5

Resistor 10k

R3

DS18B20 sensor

4-pin JST header

J6

Resistor 5k

R4

Sensor 1

4-pin JST header

J8

Resistor ?K

R8

Choose resistor to suit sensor.

Sensor 2

4-pin JST header

J9

Resistor ?K

R9

Choose resistor to suit sensor.

PoE connectors

4-pin JST header

J16

PoE.

4-pin JST header

J15

PoE.

Data hub connectors

4-pin JST header

J10

Data hub.

4-pin JST header

J11

Data hub.

4-pin JST header

J12

Data hub.

4.3 Step 3: ESP setup

Solder header pins to the ESP8266 HUZZAH as in this photo. The following instructions detail the process of uploading the AusOcean netsender software to the ESP8266 HUZZAH microcontroller using an FTDI and arduino IDE:

Tip: This is also known as ‘flashing’ the ESP

Materials

Method

  1. Download the arduino IDE from here. Note that there are different versions for different OS.
  2. If on windows, you’ll need to run the downloaded executable (likely exe or msi format, see here). If on linux, extract downloaded zip and run install script (see here).
  3. If using Windows, right click on the arduino desktop icon then hit run as administrator.
    (Linux OS only) Run the arduino IDE in sudo mode by opening a terminal window and typing the command and pressing enter:

sudo ./arduino

  1. So that we can upload to the ESP, we’ll need to get the board package. Using the arduino preferences UI (File->Preferences). Enter the following URL into the “Additional Board Managers URLs” field:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Click OK.

  1. Now head to the Boards Manager UI (Tools->Board->Boards Manager). In the search bar, type “esp”. An ESP8266 entry should be there; hover over the entry and click the install button that appears. Once installation has completed, close the boards manager UI.
  2. Exit and restart as an administrator (see step 3).
    Or restart the arduino IDE in sudo mode. (Linux OS only)
  3. Insert the FTDI into the ESP8266 so that the ground pins (labelled GND) are connected. Connect the FTDI to your computer with the USB to micro USB cable.
  4. Now select the “Adafruit Feather HUZZAH ESP8266” from the boards selection list (Tools->Board->ESP8266 boards).
  5. Ensure CPU frequency is set to 80MHz (Tools->CPU Frequency).
  6. Ensure 115200 baud upload is selected (Tools->Upload Speed). This may be lowered if problems are experienced.
  7. Select the matching COM/serial port for your FTDI (Tools->Port). Note: there will generally only be one option, however if there’s two you’ll just have to try both
  8. We’ll start with a simple blink test program to make sure everything is set up fine. Enter the following code into a new file and save:
  1. void setup() {
  2.  pinMode(0, OUTPUT);
  3. }
  4.  
  5. void loop() {
  6.  digitalWrite(0, HIGH);
  7.  delay(500);
  8.  digitalWrite(0, LOW);
  9.  delay(500);
  10. }
  1. We now need to put the board into bootloader mode. While holding down the GPIO0 button, press the RESET button for 1 second, release and then release the GPIO0 button. The red LED should now be dimly lit. This indicates that the board is in bootloader mode.
  2. Upload the program using the upload button. (the -> button next to the tick) then hit save
  3. If successful, the final message should be “Hard resetting via RTS pin…”. Hit the RESET button on the ESP and the program should begin.
  4. Now we’ll put the temp-netsender software onto the ESP. Download the ausocean iot repository (https://bitbucket.org/ausocean/iot/downloads/).
  5. Open your PC directory and find the repository in your downloads. Right click on the repository and hit extract. A new file should appear in your downloads.
  6. Open Arduino again and hit (File-> Open->  Downloads-> ausocean-iot-fcdba2b70482-> arduino-> temp-netsender-> temp-netsender.ino)
  7. Now we need to add the netsender library. Add two files to the sketch (Sketch->Add File…); /iot/arduino/netsender/netsender.h and /iot/arduino/netsender/netsender.cpp.
  8. We will need to install the “OneWire” and “DallasTemperature” libraries. Go to the library manager (Sketch->Include Libraries->Manage Libraries), and search for “OneWire”. Find the library named “OneWire” in the list of results and hit install. Then search for “DallasTemperature” and find the library named “DallasTemperature” and hit install. Note: there are other variariations of “OneWire” and “DallasTemperature” choose the versions that state exactly their names without additional information.
  9. Click the temp-netsender tab.
  10. Upload the program by repeating steps 13 to 15.
  11. Press ctrl+shift+m to open the monitor console. (ensure in the bottom right corner that 115200 baud is selected) The ESP should output its MAC address along with some other information. Note the MAC address; we’ll use this to register this ESP on netreceiver.
  12. The ESP can now be configured to connect to the netreceiver service. See the https://docs.google.com/document/d/1xdS0qk25hFhkAivB2wlzd5U0ZxGEyk_avg-NGPYXtc4/edit rig configuration guide for instructions on how to do this.

4.4 Step 4: Testing

Before powering the controller board initial testing should be used to ensure power connectivity is correct. If not done correctly, short-circuiting and damage to peripheral devices is possible.

Powered connections

Set multimeter to continuity testing mode (indicated by the diode→ sound symbol). While keeping the first probe fixed at one of the marked contacts, move the other probe around to each of the other highlighted points.

Figure 9: Ground connections

Figure 10: 5V connections

Figure 11: 24V connections

Internal connections

Perform a similar continuity test for each of the grouped sections. Some important ones are as follows.

Figure 12: Resistance test

Tip: Not all connections are listed here, so take the liberty to do more based on Figure 15.

Resistance

Set multimeter to resistance testing mode (indicated by the ohm Ω symbol) and select the correct scale (ie. 20, 200, 2000). For each resistor, perform a resistance test at both terminals of the resistor and ensure the multimeter displays the correct value. For the example below the multimeter should display 1.5 when it is set to 2K mode.

Figure 13: Resistance test

ESP

After all assembly, testing and flashing, carefully insert the ESP into the socket, power board with 5V IN and confirm ESP runs. The ESP should have continuous flashing blue lights. See Table 9 for boot modes.

4.5 Step 5: Mounting

Before mounting, check if all connectors can be plugged into by the corresponding JST plug as some pins may have bent or moved during the assembly process.

Warning: Only use M3 sized  mounting bolts for securing the controller board on a base, any larger bolt may cause damage.

APPENDIX

A.1 Controller board schematic

Figure 14: Detailed schematic

A.2 Controller board footprint

Figure 15: Controller paths, footprints and labels


A.3 Controller board 3D model

Figure 16: 3D controller render

A.1 Resistors

Figure 17: Resistors values


A.2 ESP8266

The ESP8266 is a 3.3V microcontroller that comes with WiFi and a full TCP/IP network stack. It can be supplied with a 5V voltage via VBat even though 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 ESP uses GPIO#0, GPIO#2 and GPIO#15 to perform special boot mode functions at boot time as described below.

Table 9: Boot modes

GPIO#0

GPIO#2

GPIO#15

Mode

3.3V

3.3V

0V

Normal

3.3V

3.3V

0V

Bootloader

-

-

3.3V

SDIO (not used)

GPIO#2 is pulled HIGH by default using an internal pull-up resistor, see Table 8. GPIO#15 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.


A.3 More support

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