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 (Buoy B is the inner box), from the EJA M planning.
Step 3Build
Main Components
Main components of Buoy B v1.0.
Sources:
- ESP32: ESP32-DEVKITC-32D
- LoRa: RFM95W LoRa Radio
- GPS: Adafruit Ultimate GPS
- Motor Driver: TB6612FNG MOTOR DRIVER BOARD
Schematic
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
PCB: Front Layer with components.
PCB: Front Layer without components.
PCB: Back Layer with components.
PCB: Back Layer without components.
PCB: GPS and LoRa Module.
PCB: Motor Driver.
PCB Design: ESP32 and Connectors.
Assembly
Components of Buoy B v1.0.
Components List:
- ESP32-DEVKITC-32D
- TB6612FNG MOTOR DRIVER BOARD
- CONN HDR 19POS 0.1 TIN PCB
- CONN HDR 9POS 0.1 GOLD PCB
- CONN HDR 9POS 0.1 GOLD PCB
- CONN HDR 8POS 0.1 TIN PCB
- CONN HDR 8POS 0.1 TIN PCB
- PCB Buoy B V1.0
- CONN HDR 19POS 0.1 TIN PCB
- TERM BLK 2P SIDE ENT 5.08MM PCB
- TERM BLK 2P SIDE ENT 5.08MM PCB
- TERM BLK 3P SIDE ENT 5.08MM PCB
- CONN HDR 6POS 0.1 TIN PCB
- CONN HDR 5POS 0.1 GOLD PCB
- CONN HEADER VERT 3POS 2.54MM
- CONN HEADER VERT 3POS 2.54MM
- CONN HEADER R/A 3POS 2.5MM
- Coin cell holder (included in Adafruit Ultimate GPS)
- Adafruit Ultimate GPS
- CONN HDR 16POS 0.1 TIN PCB (included in Adafruit Ultimate GPS)
- RFM95W LoRa Radio
- 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.
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.
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.
- Stepper Motor (using the driver TB6612FNG)
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, 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 theEJA_Buoy_Baccess point and aDNSServeron port 53 resolveswww.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 (
CSGPIO2,RSTGPIO15,IRQGPIO13) 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/secform; the firmware stores an end timestamp and flagstimer_reached_endwhen 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:
- ESP32 Add-on in Arduino IDE
- ESPAsyncWebServer
- AsyncTCP
- SPIFFS File System
- ESP32 Async Over The Air
- TinyGPSPlus
- 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.
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:
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.
GPS
The page http://www.buoy_b.eja/gps shows the 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.
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.
When the timer reaches zero, the Buoy activates the release mechanism.
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.
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 = "";
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 = "";
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 (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.
Buoy B V2.0: Ethernet FeatherWing, LoRa radio and GPS module in place.