Example Code for Arduino-Bee1 Hardware Serial & Bee2 Software Serial

Last revision 2026/01/12

The article presents a comprehensive guide on utilizing Arduino-Bee1 with hardware serial and Bee2 with software serial ports, offering detailed instructions, wiring diagrams, and sample code to ensure effective communication between the devices.

Hardware Preparation

  • UNO x1
  • Bees Shield x1 (SKU: DFR0210)
  • BLE LINK x2 (SKU: 1073, Purchase Link)
  • Android or iOS device x1

Software Preparation

Wiring Diagram

If you need Bee1 working with the hardware serial port, and Bee2 working with the software serial port, you can change the jumpers and switches like so:

Bee1 with the hardware serial port, and Bee2 with the software serial port

Other Preparation Work

Programmable Switch:
Set the switch to "PROG" when you upload a program
Set the switch to "RUN", when you use the hardware serial port
xBee TX & RX: The silk-screen shows the xBee RX & TX pins, which connect to the Arduino TX & RX ones. It means if you define D2 as Arduino_RX in the code, you should connect to D2 to xBee_TX on the shield. The same goes for Arduino_TX.

Sample Code

/*
 # This sample code is used to test the Bees shield.
 # Editor : Mickey
 # Ver    : 1.0
 # Product: Bees shield
 # SKU    : DFR0210
 # The circuit:
   software RX is digital pin 2 (connect to TX of Bee2 device)
   software TX is digital pin 3 (connect to RX of Bee2 device)
*/

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // UNO RX -- Bee TX, UNO TX -- Bee RX

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
  delay(50);

}
void loop()
{
  Serial.println("this is Bee1 hardware!");
  mySerial.println("this is Bee2 software!");
  delay(500);
}

Result

The app shows the result of Bee1.
the app result of Bee1 working with the hardware serial port
The app shows the result of Bee2.
the app result of Bee2 working with the software serial port

Additional Information

BLE link  installation diagram

Bee1→Hardware Serial Port

Bee2 → Software Serial Port

Was this article helpful?

TOP