thingspeak values for real time data of my IOT weather station are displaying as zero.

8 views (last 30 days)
I am making an IOT based online and lcd based off;ine weather station. I have uploaded a code to my arduino and ait works absolutely fine displaying all values on the lcd. but when i am using my esp8266 the code gets uploaded but the values on the charts in thingspeak is all zero even after 90 entries.
Christopher Stapels
Christopher Stapels on 17 May 2023
Edited: Christopher Stapels on 17 May 2023
Can you edit the code just to show the parts where you communicate to ThingSpeak? Also there is a code button in the editor that will make it wasier to read the code.Would you consider using that as well, pelase?

Sign in to comment.

Answers (1)

Christopher Stapels
Christopher Stapels on 18 May 2023
In the upload() section, I would suggest you try hard coding values instead of value_1, etc. Like this
ThingSpeak.writeField(Channel_ID, Field_Number_1, 321, myWriteAPIKey);
Then see if that number shows up in ThingSpeak correctly. If so, then your variables arent being set correctly.
Also, you dont have to publish each field individually. You will get null values in all the other fields if you do.
Then you will publish all values in a single write action, and they will all have the same timestamp. Your field charts will look much nicer and you will save a lot of writing time during which your processor could take a small nap.
And can you please edit the code above just to show the parts where you interact with thingspeak.
Ayman Mulla
Ayman Mulla on 19 May 2023
I tried a different thing. What I did was I added Serial.begin(9600) in my arduino code and for esp I kept it mySerial.begin(115200).
void setup()
pinMode(mq135_pin, INPUT);
pinMode(LDR, INPUT);
pinMode(rain_sensor_pin, INPUT); // Set the rain sensor pin as input
lcd.setCursor(0, 0);
lcd.print(" IoT Weather ");
lcd.setCursor(0, 1);
lcd.print("Monitor System");
After this while uploading the arduino code I changed the buad rate to 9600 and the data started to appear on the thingspeak. However whatever the value of first entry for temperature and humidity it stays the same through out in thingspeak even if the lcd displays a change in temperature. Where as the air quality and light value are floating and flactuating very high and low no where near to the actual value. The pressure and rain sensor values are correct and varying accordingly.

Sign in to comment.


More Answers in the  ThingSpeak Community


Find more on ThingSpeak in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!