Get Sensor Data with helper functions
Core Functions
Ultrasound Sensor
This function returns real-time distance to detected object in centimeters (float) as response.
Temperature Sensor
The following functions return current temperature and relative humidity as response.
incipe.getTemperature()
incipe.getHumidity()
incipe.getTemperature()
incipe.getHumidity()
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()
incipe.getLightIntensity()
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.
Alcohol Sensor
This function provides sensor output indicating relative alcohol particle density in air.
Higher values suggest greater alcohol concentration.
CO Gas Sensor
This function provides sensor output indicating relative CO2 particle density in air.
Higher values suggest greater alcohol concentration.
Flame Sensor
Present the resistance value, the value would drop when there is fire.
Data cleaning to interpret the meaning is required.
incipe.getFlameIntensity()
incipe.getFlameIntensity()
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()
incipe.getButtonResponse()
incipe.getButtonResponse()
Example of detecting button get pressed
int a = 0;
bool detect = false;
if (incipe.getButtonResponse() == 1)
{
detect = true;
}
if (incipe.getButtonResponse() == 0 && detect == true)
{
a=a+l ;
Serial. print In (a);
detect = false;
}int a = 0;
bool detect = false;
if (incipe.getButtonResponse() == 1)
{
detect = true;
}
if (incipe.getButtonResponse() == 0 && detect == true)
{
a=a+l ;
Serial. print In (a);
detect = false;
}int a = 0;
bool detect = false;
if (incipe.getButtonResponse() == 1)
{
detect = true;
}
if (incipe.getButtonResponse() == 0 && detect == 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()
incipe.getSoundIntensity()
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;
}
}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;
}
}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()
if (a > xxx){
Serial.print("Far");
}
else if (a >= xxx and a <= xxx){
Serial.print("Moderate");
}
else
Serial.print("Very Close");int a = incipe.getDistance()
if (a > xxx){
Serial.print("Far");
}
else if (a >= xxx and a <= xxx){
Serial.print("Moderate");
}
else
Serial.print("Very Close");int a = incipe.getDistance()
if (a > xxx){
Serial.print("Far");
}
else if (a >= xxx and a <= xxx){
Serial.print("Moderate");
}
else
Serial.print("Very Close");