Menu
Buoy B v1.0 PCB

Buoy B | Hackaday Dream Team 2020

Buoy B V1.0 is a 102.46 mm x 44.20 mm PCB that integrates 4 of the main components (ESP32, LoRa, GPS and Motor Driver).

Step 1Define

What It Had to Do

Buoy B is the lighter of the two buoy boards: the same job as Buoy A (go into the buoy on the trap, keep the release timer, report the GPS position so the gear can be recovered) without the 4G(LTE) shield, on a smaller PCB.

  • LocateRead position and time from an Adafruit Ultimate GPS over UART
  • LinkReport to the Onboard Gateway over a 915 MHz LoRa link (RFM95W)
  • ReleaseDrive the release actuator: a servo from a PWM pin, or a stepper or DC motor through the TB6612FNG driver
  • InterfaceLet a phone set the release timer through the board's own Wi‑Fi access point
  • PowerRun from a 5–15 V battery through a buck converter, or from a single 3.7 V cell through a boost converter
Hardware block diagram of Buoy A and Buoy B v1.0: an ESP32-DevKitC wired to the Adafruit Ultimate GPS over UART, the RFM95W LoRa radio over SPI, a PWM output for a servo motor and the TB6612FNG DC motor controller, with a battery above 5 V stepped down to 5 V; Buoy A adds a SIM7600 4G(LTE) module on a second UART

Hardware block diagram of Buoy A and Buoy B v1.0 (Buoy B is the inner box), from the EJA M planning.

Step 3Build

Main Components

Main components of Buoy B v1.0

Main components of Buoy B v1.0.

Sources:

Schematic

Schematic of Buoy B v1.0

Schematic of Buoy B v1.0.

For more information about the design check the original post in the project's page.

Layout

PCB Layout of Buoy B v1.0

PCB Layout of Buoy B v1.0.

PCB

3D render of the EJA Buoy B v1.0 PCB with the ESP32, LoRa radio and GPS fitted

PCB: Front Layer with components

PCB: Front Layer with components.

PCB: Front Layer without components.

3D render of the Buoy B v1.0 PCB, angled view

PCB: Back Layer with components

PCB: Back Layer with components.

PCB: Back Layer without components.

3D render of the Buoy B v1.0 PCB showing the module headers and terminal block

PCB: GPS and LoRa Module

PCB: GPS and LoRa Module.

PCB: Motor Driver.

3D render of the Buoy B v1.0 PCB, reverse side

PCB Design: ESP32 and Connectors

PCB Design: ESP32 and Connectors.

Assembly

Components of Buoy B v1.0

Components of Buoy B v1.0.

Components List:

  1. ESP32-DEVKITC-32D
  2. TB6612FNG MOTOR DRIVER BOARD
  3. CONN HDR 19POS 0.1 TIN PCB
  4. CONN HDR 9POS 0.1 GOLD PCB
  5. CONN HDR 9POS 0.1 GOLD PCB
  6. CONN HDR 8POS 0.1 TIN PCB
  7. CONN HDR 8POS 0.1 TIN PCB
  8. PCB Buoy B V1.0
  9. CONN HDR 19POS 0.1 TIN PCB
  10. TERM BLK 2P SIDE ENT 5.08MM PCB
  11. TERM BLK 2P SIDE ENT 5.08MM PCB
  12. TERM BLK 3P SIDE ENT 5.08MM PCB
  13. CONN HDR 6POS 0.1 TIN PCB
  14. CONN HDR 5POS 0.1 GOLD PCB
  15. CONN HEADER VERT 3POS 2.54MM
  16. CONN HEADER VERT 3POS 2.54MM
  17. CONN HEADER R/A 3POS 2.5MM
  18. Coin cell holder (included in Adafruit Ultimate GPS)
  19. Adafruit Ultimate GPS
  20. CONN HDR 16POS 0.1 TIN PCB (included in Adafruit Ultimate GPS)
  21. RFM95W LoRa Radio
  22. CONN HEADER VERT 16POS 2.54MM (included in RFM95W LoRa Radio)

For a detailed Bill of Materials visit the following post.

For a detailed explanation about the soldering and assembly procedure visit the following post.

Wiring Diagrams

The original design of the board considered the following components:

Power Management

  • Battery (5V < Voltage < 15V)
  • PCB Board Buoy B V1.0
  • Buck Converter
  • Switch
  • Extra capacitor
Wiring diagram: Power Management with Buck Converter

Wiring diagram: Power Management with Buck Converter.

Also, there is an alternative for the battery management, is possible to provide the required voltages with a boost converter and a 3.7V Battery, like the following example:

  • 3.7V 1 Cell Battery
  • PCB Board Buoy B V1.0
  • Boost Converter
  • Micro USB Breakout Board
  • Switch
  • Extra capacitor
  • JST-XH 2 Pos female connector and a JST-XH 2 Pos male connector
  • 5V Charger (only used to charge the battery)
Wiring diagram: Power Management with Boost Converter

Wiring diagram: Power Management with Boost Converter.

This alternative is valid and possible, but is not ideal for longer working time (compared to the first one). It is important to consider the efficiency of the boost converter. The selected boost converter will have a voltage drop at a current higher than 500mA, that should be taken into consideration.

Motors

The board was designed to handle 3 different types of motors, those are:

  • Servo Motor
Wiring diagram: Buoy B v1.0 with Servo Motor

Wiring diagram: Buoy B v1.0 with Servo Motor.

  • Stepper Motor (using the driver TB6612FNG)
Wiring diagram: Buoy B v1.0 with Stepper Motor

Wiring diagram: Buoy B v1.0 with Stepper Motor.

  • DC Motor (using the driver TB6612FNG)
Wiring diagram: Buoy B v1.0 with DC Motor, first connector

Wiring diagram: Buoy B v1.0 with DC Motor, first connector.

Wiring diagram: Buoy B v1.0 with DC Motor, second connector

Wiring diagram: Buoy B v1.0 with DC Motor, second connector.

For more information about the wiring diagrams and the project visit the following post.

  Firmware

The Buoy B firmware (Arduino / ESP32) turns the board into a self‑contained field unit — the same design runs on Buoy A:

  • Captive Wi‑Fi UI — WiFi.softAP() brings up the EJA_Buoy_B access point and a DNSServer on port 53 resolves www.buoy_b.eja (and any host) to the ESP32, so a phone just connects and opens the page.
  • Async web server — ESPAsyncWebServer on port 80 serves the UI from SPIFFS flash and exposes small endpoints for the live GPS, timer and message buffers; AsyncElegantOTA adds over‑the‑air updates at /update.
  • GPS — TinyGPSPlus parses the NMEA stream at 9600 baud.
  • LoRa link — an RFM95W at 915 MHz (CS GPIO2, RST GPIO15, IRQ GPIO13) trades tagged GPS and timer messages once a second with the topside Onboard Gateway; LED1 (GPIO5) and LED2 (GPIO0) blink on LoRa RX / TX.
  • Release timer — the UI posts an hours/min/sec form; the firmware stores an end timestamp and flags timer_reached_end when it elapses. The countdown, UI and LoRa reporting are complete; the block that finally drives the release actuator is still a stub.

Upload the data/ folder to SPIFFS (Arduino "ESP32 Sketch Data Upload") before flashing the sketch.

  User Interface

Requirements:

  1. ESP32 Add-on in Arduino IDE
  2. ESPAsyncWebServer
  3. AsyncTCP
  4. SPIFFS File System
  5. ESP32 Async Over The Air
  6. TinyGPSPlus
  7. LoRa

The ESP32 creates an Asynchronous Web Server, with the following credentials:


                  const char* ssid     = "EJA_Buoy_B";
                  const char* password = "123456789";
                

With those credentials it is possible to access the WiFi network.

Phone Wi-Fi network list showing the EJA_Buoy_B access point created by the ESP32

The ESP32 creates a Domain Name System (DNS) to assign a domain name to the web server. That means that it is not necessary to know the server IP, it is possible to access the web server using the defined domain name for the host, in this case, the name is:


                  const char* host = "www.buoy_b.eja";
                

Once the device (phone/computer) is connected to the server (EJA_Buoy_B), open a browser and visit the following url:


                  http://www.buoy_b.eja/
                

Home

The previous link displays the web page used for HOME:

Buoy B web interface: Home page

There is a header with the name "EJA Buoy B" that opens a sidebar with links to the different test functionalities. It is also possible to access those pages using the buttons in HOME.

Buoy B web interface: sidebar menu listing the test pages

GPS

The page http://www.buoy_b.eja/gps shows the data from the GPS module.

Buoy B web interface: GPS page showing data from the GPS module

Timer

The page http://www.buoy_b.eja/timer shows the interface to create a timer in the Buoy. The timer represents a countdown that activates the release mechanism when the time has reached zero. The initial page allows the user to set the timer.

Buoy B web interface: Timer page with a countdown duration entered

After selecting the amount of time the user has to click the Submit button. That will create the timer, the interface displays the countdown to the user.

Buoy B web interface: Timer page showing the running countdown

When the timer reaches zero, the Buoy activates the release mechanism.

Buoy B web interface: Timer page showing the countdown at zero

The user can delete the timer at any time clicking the button Delete Timer. When the user deletes the timer, it is possible to create a new one and restart the process.

Buoy B web interface: Timer page with the Delete Timer button

LoRa

The page http://www.buoy_b.eja/lora shows internal messages related to LoRa. In the ESP32 that information is stored in the variable:


                  String lora_all_msg = "";
                
Buoy B web interface: LoRa page showing internal LoRa messages

Terminal

The page "http://www.buoy_b.eja/terminal" shows internal messages. In the ESP32 that information is stored in the variable:


                  String terminal_messages = "";
                
Buoy B web interface: Terminal page showing internal messages

Step 4Test

Bench Bring‑Up

The screenshots above were taken on a phone connected to the buoy's own access point with the firmware running, and they also show how far the bring‑up got. The Terminal page logs the TinyGPSPlus counters: about 13,000 characters of NMEA processed with 0 failed checksums, so the GPS link at 9600 baud was working, but 0 satellites and 0 sentences with a fix, so the module had not acquired a position when they were taken. The LoRa page shows the transmit side, a run of Send GPS Json! / TxDone entries.

Paired with the Onboard Gateway, those GPS messages reached the gateway over LoRa. In the photo below the phone is on the gateway's access point, and since the gateway has no GPS of its own, the GPS page it shows is filled from Buoy B's messages: a GPS date and time (16 September 2020, 21:19:56) but, again, 0 satellites and no position.

Buoy B and the Onboard Gateway boards side by side on a white bench, next to a phone showing the EJA Onboard Gateway GPS page with a date and time but 0 satellites

Buoy B (left) and the Onboard Gateway on the bench, with the gateway's GPS page open on a phone.

The release itself was still open: in this firmware, the block that drives the actuator is a stub.

Step 5Refine

Future Improvements

For more information about the recommended future improvements for the electronic design visit the following post.

The Next Board: EJA M

For the project's second prototype, Buoy B, Buoy A and the Onboard Gateway were replaced by a single PCB, EJA M v1.0. Its planning keeps their features and adds four targets: lower cost (with these boards' bill of materials as the reference), a smaller board, battery charging on the board and a battery‑level measurement. The plug‑in modules give way to EJA M's own ESP32, LoRa, GPS, RTC and power‑supply circuits. The servo connector stays, now with its own 5 V 2 A step‑up; the TB6612FNG driver, and with it the stepper and DC motor options, is dropped because the project was no longer using it.

Buoy B V2.0: Ethernet

A later V2.0 revision of the board (in the repository) swaps the TB6612FNG motor driver for an Adafruit Ethernet FeatherWing, for bench testing and wired deployments, and is migrated to KiCad 6.

The repository history dates this revision to August and September 2022. Besides the Ethernet module, the V2.0 schematic adds a 10 kΩ/10 kΩ divider so the ESP32 can measure the 5 V input on GPIO33, two I²C connectors with 10 kΩ pull‑ups, an AZ1117 3.3 V regulator that feeds them and the FeatherWing, a header for the spare GPIO25–27, and a jumper that powers the ESP32 either directly or through a 1N5818 diode. The JST battery connector is gone, and the board outline and lower mounting holes were changed.

3D render of the Buoy B V2.0 PCB with the Adafruit Ethernet FeatherWing and its RJ45 jack, the RFM95W LoRa radio and the GPS module fitted

Buoy B V2.0: Ethernet FeatherWing, LoRa radio and GPS module in place.

Posted In:
Embedded Hardware