Capsule Sensor Quick Start



Pay attention to the following issues while using a capsule sensor

  • The capsule sensor itself is positioned as a small-sized, assembled and deployed sensor. It does not have programming, debugging, and other interfaces. You need to use the Debug Board in order to program and debug the program;

  • Due to storage and transportation issues, the battery is not integrated inside the capsule by default. Users in mainland China can inform our customer service when placing an order and we will provide integrated battery services.

Get Ready

Capsule Sensor Test

Basic Test

In the example menu CubeCell - xxxx Sensor Examples, is the basic test program used by capsule sensors, which can be used to quickly verify the sensor and read the value from sensors:

Heltec Produced Sensor Examples: Sensor modules made by Heltec. Sensor List:

Third Party Sensor Examples: For third-party sensor modules developed by users. Sensor List:


Transmit Sensor Data Via LoRaWAN protocol


This part operations must performed with a gateway that supports the standard LoRaWAN protocol.

In the example menu LoRa LoRaWAN LoRaWAN_Sensors(_ThirdParty), we provided some examples transmit sensor’s data via LoRaWAN protocol.

In all sensor & LoRaWAN examples, the sensor data is read once before sending. For example, in the HDC1080 temperature and humidity sensor example:

	PrepareTxFrame( AppPort ); //read data from HDC1080 sensor
	LoRaWAN.Send(); //LoRaWAN transmit

The PrepareTxFrame had read temperature (float), humidity (float) and battery voltage (unsigned int). And convert data to a char. The contents:

static void PrepareTxFrame( uint8_t port )
    float Temperature = (float)(hdc1080.readTemperature());
    float Humidity = (float)(hdc1080.readHumidity());
    uint16_t BatteryVoltage = GetBatteryVoltage();
    unsigned char *puc;

    puc = (unsigned char *)(&Temperature);
    AppDataSize = 10;//AppDataSize max value is 64
    AppData[0] = puc[0];
    AppData[1] = puc[1];
    AppData[2] = puc[2];
    AppData[3] = puc[3];

    puc = (unsigned char *)(&Humidity);
    AppData[4] = puc[0];
    AppData[5] = puc[1];
    AppData[6] = puc[2];
    AppData[7] = puc[3];

    AppData[8] = (uint8_t)(BatteryVoltage>>8);
    AppData[9] = (uint8_t)BatteryVoltage;

    Serial.print("C, RH=");

Why convert data to byte?

Everyone knows that float data occupies 4 bytes in memory, and unsigned int data occupies 2 bytes. Suppose you have a very accurate sensor, for example, the measured data is 12.34567890987654321, if send this data via string like char data[] = "27.313232421875", it will spend 15 bytes. but if transmit in byte 80 81 DA 41, only spend 4 bytes.