Reading sensor data from arduino to the cloud

Hi,
I am working on a project to read LDR data connected to analog pins of the arduino to the bolt cloud via the bolt UART. I am using the white coloured bolt board. I followed the steps described in the documentation page of the cloud and used a software serial port.
i used this code for arduino:
#include <BoltIot-Arduino-Helper.h>

#include <BoltIot-Arduino-Helper.h>

int sensorPin = A0; // select the input pin for LDR
int sensorValue = 0; // variable to store the value coming from the sensor
void setup()
{
boltiot.Begin(Serial);
pinMode(A0,INPUT);
Serial.begin(9600);
Serial.setTimeout(50);
//sets serial port for communication
}
String inString="";
void loop()
{
sensorValue = analogRead(sensorPin); // read the value from the sensor

Serial.println(sensorValue); //prints the values coming from the sensor on the screen
boltiot.CheckPoll(analogRead(A0));
delay(100);
if (Serial.available() > 0){inString = Serial.readString(); //Read input string from bolt
Serial.print(inString); //Send same string back to bolt
}
}

and This code for bolt:
setChartLibrary(‘google-chart’);
setChartTitle(‘Luminosity dude’);
setChartType(‘tableGraph’);
setAxisName(‘time’,‘illuminence’);
plotChart(‘time_stamp’,‘illuminence’);
dataDownload(‘true’);

and i get This Result:

like u see, the data is always zero but the serial monitor reads fine on arduino ide
pls help

Whatever variable you defined as Hardware configuration pin in your device GUI pin selection and the Right hand side of it
You have to use the same variable in plotChart(‘time_Stamp’,‘Your Variable set as your hardware config pin’)
Then it should work

Regards

I did that, I don’t understand why it’s still not working pls help


this time im using an ultrasonic sensor with a gauge chart

Hi @lingeshpatronus,

Click on download data button and check if there is any data present in the CSV file.

Also, share your device with me. (rahul.singh@inventrom.com)

hi,
this is the data i downloaded

and i don’t understand what you mean by sharing my device

i need to submit my project at my college so I am a little desperate :sweat:
pls help and thanks

Hiii, I am having the same problem, did you get the solution to this?

Hi @tagarwal2010

Can you please click on the download data and send us the CSV file to support@boltiot.com

Also expand the CSV column size and check if the data is visible.

I got the fix for this problem but i am having another problem, the bolt is taking data from temperature sensor every 5 minutes but it is not displaying it in the graph and the time in csv file is incorrect while its correct in the graph plotted on site.

1 Like

Hi @tagarwal2010

  1. Actually the cloud return the time data in UTC format and it converts it to local time while showing into the graph.(Indian Standard Time for you UTC+ 5:30 )
  2. The CSV format shows the UTC time.
  3. Updating the data in graph takes upto 20 seconds.

Do let me know in case you need further assistance.

1 Like

I have same problem… Can you help me please if you can correct your project

How you solved problem

Pls tell me solution for this problem

@141043: We have written a library for interfacing an Arduino with the Bolt. Here is a link to the library.

The readme of the library explains how to install the library. There are example program on how to use the library, and all the functions of the library are explained in the readme.

For me i just expanded the column size of csv file also use int data type for values u transferring from arduino to bolt.

1 Like