Example Code for Arduino UNO-Multiple SCI Modules

Use two SCI DAQ modules simultaneously with Arduino UNO. Users can learn how to configure multiple modules and retrieve data from each.

Hardware Preparation

Software Preparation

Wiring Diagram

Other Preparation Work

  1. Set the ID of one SCI module to 0x22: Press "S" to enter settings, select "Set Board ID", choose 0x22, restart.
  2. Connect both modules to Arduino UNO via I2C.

Sample Code

#include "DFRobot_RP2040_SCI.h"

DFRobot_RP2040_SCI_IIC SCI1(/*addr=*/0x21, &Wire);
DFRobot_RP2040_SCI_IIC SCI2(/*addr=*/0x22, &Wire);

void setup() {
  Serial.begin(115200);
  while(SCI1.begin() != 0){delay(1000);};
  while(SCI2.begin() != 0){delay(1000);};
}
void loop() {
  Serial.println(SCI1.getValue(SCI1.eALL,"Temp_Air"));
  Serial.println(SCI1.getValue(SCI1.eALL,"Humi_Air"));
  Serial.println(SCI1.getValue(SCI1.eALL,"Light"));
  Serial.println("-------------------");
  Serial.println(SCI2.getValue(SCI2.eALL,"AQI"));
  Serial.println(SCI2.getValue(SCI2.eALL,"TVOC"));
  Serial.println(SCI2.getValue(SCI2.eALL,"ECO2"));
  Serial.println(SCI2.getValue(SCI2.eALL,"Altitude"));
  Serial.println(SCI2.getValue(SCI2.eALL,"Pressure"));
  Serial.println("-------------------");
}

Result

  • The serial monitor outputs data from both SCI modules (e.g., Temp_Air from SCI1, AQI from SCI2).

Additional Information

  • Ensure each module has a unique ID (0x21, 0x22, 0x23) to avoid conflicts.

Was this article helpful?

TOP