Arduino Mega 2560 Integration
In this guide
we explain how to connect a GrowSpace developer tag to an Arduino Mega 2560 via serial communication and receive real-time location data using the lec and lep commands.
We also provide example code to show how to build a stable high-speed communication setup using the Mega 2560’s hardware serial ports.
Required Materials
Arduino Mega 2560 Board

GrowSpace Developer Tag

Arduino IDE Program (Official: https://www.arduino.cc/en/software)
Jumper wires

Jumper cables

Included serial (connection cable)
⚠️ The UNO board has only one hardware serial port, which may cause errors during high-speed communication. The Mega 2560 provides Serial1 to Serial3, enabling more stable and reliable communication.
Arduino IDE Setup and Board Connection
Open the Arduino IDE after installation.
In the top menu, apply the following settings:
Tools > Board > Arduino Mega or Mega 2560

Tools > Port > Select the connected COM port (e.g. COM3)

Connect the Arduino Mega 2560 to your PC via USB.
Hardware Pin Connection
Connect the pins using the right-side connector (5V only) on the GrowSpace developer tag as shown below:
TX
RX1 (pin 19)
RX
TX1 (pin 18)
5V
5V
GND
GND
🔄 TX and RX must be cross-connected for communication to work properly.
Below is an example of the pin layout on the Arduino Mega board.
Connect the GrowSpace developer tag using TX1 (pin 18) and RX1 (pin 19) of Serial1.


Serial Relay Example (Basic Communication Test)
Explanation
In
setup(), both the USB serial (Serial) and the hardware serial (Serial1) are initialized.serialEvent()sends the string entered from the PC (Serial0) to the tag.serialEvent1()reads the response from the tag and prints it to the PC.When a command is sent, the input is split by newline (
\n), and a carriage return (\r) is automatically added.
Serial Monitor Setup Tips
Baudrate: 115200bps
Set line ending to: New Line
If the tag returns system information after sending the
sicommand, the communication is working.
If you type si in the Serial Monitor and receive a valid response, the connection is successful.

Location Parsing Example Using Commands
LEP Command Execution

LEC Command Execution

Conclusion
This guide walks you through setting up serial communication between the Arduino Mega 2560 and the GrowSpace developer tag, and receiving real-time location data using the lec and lep commands.
lep: View X, Y, Z coordinates and quality factor (QF)lec: Check anchor information, distance, and full location data
Last updated