Problem with GPIO pins

I am working on a project using bolt and Arduino.
The main problem I am facing is that either the bolt module or the bolt cloud has some problem.

When I am sending 0 0 0 0 0 through Arduino to bolt using GPIO pins 0,1,2,3,4 which are set as input the data shown on the cloud is 0 1 0 1 0 or sometimes 0 0 0 1 0. It is taking arbitrary values on its own.

Can someone please help me I need to submit my college project in 4 days and this bolt is not working properly.

Can you share your code? For Arduino and the setting on Bolt Cloud.

BOLT CODE - js
setChartLibrary(‘google-chart’);
setChartTitle(‘Your Table Title’);
setChartType(‘tableGraph’);
setAxisName(‘time_stamp’,‘temp’);
plotChart(‘temp’,‘air’,‘inf’,‘pres’,‘humd’);
BOLT Setting -
0 Digital - temp
1 Digital - air
2 Digital - inf
3 Digital - pres
4 Digital - humd

Arduino Code -
ol#include <BoltIoT-Arduino-Helper.h> //Bolt
int cycle = -10;
#include “DHT.h” //DHT11
#define DHTPIN 7 //DHT11
#define DHTTYPE DHT11 //DHT11
DHT dht(DHTPIN, DHTTYPE); //DHT11
float temper,t2,t3,t4,t5,t6,t7,t8,t9,t10;
int fl_temp=0;
int fl_air=0;
int fl_inf=0;
int fl_pres=0;
int fl_humd=0;
int sensorValue; //mq135
int digitalValue; //mq135

#include <SFE_BMP180.h> //BMP180
#include <Wire.h> //BMP180
SFE_BMP180 pressure; //BMP180
#define ALTITUDE 1655.0 //BMP180

float sumis;
float pres;
double T,P,p0,a; //BMP-180

#include <BoltDeviceCredentials.h>

#define API_KEY “XXXXXXXXXXXX” // Changed to XXXX here for privacy
#define DEVICE_ID “BOLTXXXXXXX” // Changed to XXXX here for privacy

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println(F(“Test Begin or Restart…!!!”)); //Test Begin
dht.begin(); //DHT11
//pinMode(13, OUTPUT); //mq135
//pinMode( 3, INPUT); //mq135
//cycle = -10; //Cycle set at -10
pinMode(42,OUTPUT);
pinMode(44,OUTPUT);
pinMode(46,OUTPUT);
pinMode(48,OUTPUT);
pinMode(50,OUTPUT);
pressure.begin();
}

void loop() {
// put your main code here, to run repeatedly:
delay(2000);
float h = dht.readHumidity(); //DHT11
float f = dht.readTemperature(true); //DHT11
float hif = dht.computeHeatIndex(f, h);
sensorValue = analogRead(0); //mq135 // read analog input pin 0
digitalValue = digitalRead(22); //mq135

float sensor_volt; //mq9
float RS_air; //mq9 // Rs in clean air
float R0; //mq9 // R0 in 1000 ppm LPG
float sensorValue_mq; //mq9
float ratio; //mq9
//Average MQ-9 //mq9
sensorValue_mq = analogRead(A7); //mq9
sensor_volt = ((float)sensorValue_mq/1024)*5.0; //mq9
RS_air = (5.0-sensor_volt)/sensor_volt; //mq9 // Depend on RL on yor module
R0 = 0.23; //mq9 // According to MQ9 datasheet table
ratio = RS_air/R0; //mq9 //ratio = RS/R0
//Average_end MQ-9 //mq9

Serial.print("\n\nNew Cycle : "); //check
Serial.println(cycle);
pressure.startPressure(3);
pressure.startTemperature();
pressure.getTemperature(T);
pressure.getPressure(P,T); //BMP-180
float temp = dht.readTemperature(); //DHT11
temp = temp * 1.8 + 32; // convert Celsius to Farenheit
//delay(2000);

Serial.println("\n");
Serial.println(“DHT-11”);
Serial.print("Temperature: "); //DHT11
Serial.print(temp); //DHT11
////Serial.print(hif); //DHT11
Serial.println(F(“°F”)); //DHT11
Serial.println(“DHT-11 END \n\n”);
Serial.println(“MQ-135”);
Serial.print("Air Quality : ");
Serial.println(sensorValue, DEC); //mq135 // prints the value read
Serial.println(“MQ-135 END \n\n”);
Serial.println(“MQ-9”);
Serial.print("sensor_volt = "); //mq9
Serial.print(sensor_volt); //mq9
Serial.println(“V”); //mq9
Serial.print(“RS_air/R0 Ratio = “); //mq9
Serial.println(ratio); //mq9
Serial.println(“MQ-9 END \n\n”);
Serial.println(“BMP-180”);
Serial.print(P*0.0295333727,2);
Serial.println(” inHg”);
Serial.println(“BMP-180 END\n\n”);

// delay(5000); //Delay

//t2=temper;
////Serial.println(t2);
t10=t9;
////Serial.println(t10);
t9=t8;
t8=t7;
t7=t6;
////Serial.println(t7);
t6=t5;
t5=t4;
////Serial.println(t6);
t4=t3;
t3=t2;
temper = dht.readTemperature();
temper = temper * 1.8 + 32;
Serial.print("Temper ");
Serial.println(temper);
t2=temper;

sumis=temper+t2+t3+t4+t5+t6+t7+t8+t9+t10;
float humd = dht.readHumidity();
float air = sensorValue;
float sum = sumis;
float pres = P*0.0295333727;

float mean;
mean = sumis/10; // Count of values for calculating mean is 10
float bug;
bug = temp-mean;
float zscore;
zscore = bug/7; //Standard Deviation to be 14
//////////////////////////////Values and flag check - Part 1
float ub=0.10;

if(cycle>=0){
if(ub<zscore){
fl_temp=1;
}
}
if(air>700){
fl_air=1;
}
if(ratio<5){
fl_inf=1;
}
if(humd<20){
fl_humd=1;
}
if(pres>100){
fl_pres=1;
}
digitalWrite(42,fl_temp);
digitalWrite(44,fl_air);
digitalWrite(46,fl_inf);
digitalWrite(48,fl_pres);
digitalWrite(50,fl_humd);

/////////////////////////////////End of Values check - part 1
Serial.print("Z-Score ");
Serial.println(zscore);
Serial.print("Mean ");
Serial.println(mean);

Serial.print("Flag Temp ");
Serial.println(fl_temp);
Serial.print("Flag Air ");
Serial.println(fl_air);
Serial.print("Flag Inf ");
Serial.println(fl_inf);
Serial.print("Flag Pres ");
Serial.println(fl_pres);
Serial.print("Flag Humd ");
Serial.println(fl_humd);
cycle= cycle+1; //Cycle Increment
//delay(5000); //Delay

}

Hi
Try sending data to bolt cloud via UART and there is a sample code of DHT2cloud in boltArduinohelper library you can refer that.

I tried doing that but it is also not working, cloud is not reading the data at all.

try running the pushdata sample code in the library which is via UART and check if its sending data to cloud.

Ensure that you define all 6 CSV values on bolt cloud otherwise it will not accept data.(eg.CSV0 to CSV5 as var0 to var5)

Tried with UART not working…

did u try try running the pushdata sample code in the library which is via UART and check if its sending data to cloud.