IA SensorSync API

IA Kit Doc

Internal Memory

Appliance Control

Project

IA SensorSync API

Get Sensor Data with helper functions

Core Functions

Ultrasound Sensor

This function returns real-time distance to detected object in centimeters (float) as response.

incipe.getDistance()

Temperature Sensor

The following functions return current temperature and relative humidity as response.

incipe.getTemperature()
incipe.getHumidity()

Light Sensor

This function returns ambient light sensor' raw intensity value.

Higher values indicate brighter conditions, while lower values correspond to dimmer environments.

incipe.getLightIntensity()

Note: The returned value requires data normalization/calibration for meaningful interpretation.

Sensor-specific scaling may be necessary to convert to standard units (lux / lumens).

Air Quality Sensor

The function returns a calibrated air quality reading from the ​sensor, accounting for baseline resistance, environmental factors (temperature/humidity), and nonlinear gas response. Higher values indicate poorer air quality (e.g., elevated CO₂, NH₃, or VOC levels), while lower values correspond to cleaner air.

incipe.getPPM()

Alcohol Sensor

This function provides sensor output indicating relative alcohol particle density in air.

Higher values suggest greater alcohol concentration.

incipe.getAlcoholPPM()

CO Gas Sensor

This function provides sensor output indicating relative CO2 particle density in air.

Higher values suggest greater alcohol concentration.

incipe.getCOPPM()

Flame Sensor

Present the resistance value, the value would drop when there is fire.

Data cleaning to interpret the meaning is required.

incipe.getFlameIntensity()

Button Module

The function returns​​:

  • 1​ (or HIGH) when the button is actively pressed

  • 0​ (or LOW) when the button is released

incipe.getButtonResponse()

Example of detecting button get pressed

int a = 0;
bool detect = false; // create a boolean to detect T/F, set as false at beginning
if (incipe.getButtonResponse() == 1) // when the button is pressed
{
  detect = true;
}
if (incipe.getButtonResponse() == 0 && detect == true)
// when the button is not pressed and detect is true
{
  a=a+l ;
  Serial. print In (a);
  detect = false;
}

Sound Sensor

Get the sound vibration in the air to determine the threshold of sound level.

incipe.getSoundIntensity()

Example for using the sound sensor to collect noise level.

In general, it keeps tracks of the sound intensity in the room for a few times to calculate the average, then we can use the average to determine whether the environment is loud, normal or quiet.

const int SAMPLE_TIME = 10;
unsigned double PreviousTime = 0;

int SoundDetect = 0;
float database[100];
int count = 0;

void setup (){
  Serial begin(9600);
}

void loop(){
  PreviousTime = millis();
  while (millis() - PreviousTime < SAMPLE_TIME){
    if (incipe.getSoundIntensity()==1){
      SoundDetect++;
    }
  }
  database[count] = SoundDetect;
  SoundDetect = 0;
  count++;
  if (count==100){
    for (int i = 1; i < 100; i++){
      database[0] = database[0] + database[i];
      database[i] = 0;
    }
    float mean = database[0]/100;
    Serial.print(mean);

    if (mean > 200){
      Serial.println("Loud");
    }
    else if (mean <= 200 && mean > 20){
      Serial.println("Normal");
    }
    else if (mean <= 20){
      Serial.println("Quiet");
    }
    database[0] = 0
    count = 0;
  }
}

How to use IA SensorSync API functions?

In the following example, we can store the data we got from the sensor and do data cleaning.

int a = incipe.getDistance() // store sensor data to variable a
if (a > xxx){ 
  Serial.print("Far");
}
else if (a >= xxx and a <= xxx){
  Serial.print("Moderate");
}
else
  Serial.print("Very Close");

© 2025 INCIPE Academy Limited

Create a free website with Framer, the website builder loved by startups, designers and agencies.