Things speak for monitoring noise and air pollution to create smart environmet | ThingSpeak Projects | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Things speak for monitoring noise and air pollution to create smart environmet
Avatar
anjihanuma
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
1
August 9, 2016 - 7:51 am
sp_Permalink sp_Print

Hello everyone,

I want to read Noise&CO values using Arduino UNO and then send this to Thingspeak. I am coding it using the Arduino IDE 1.6.7 with the Ethernet add-in module. 

I have managed to write some code that reads and displays my data, and I have written some code that reads the data and sends it to Web Server,But in case of things speak my data not going to "Things Speak" .Which I want use for analysis...please help me..Frown

Any suggestions?

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
2
August 10, 2016 - 12:05 am
sp_Permalink sp_Print

Did you check out the Arduino examples on the thingspeak website (under Support).

 

I think there are some examples in https://github.com/mathworks/thingspeak-arduino

Avatar
anjihanuma
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
3
August 20, 2016 - 5:09 am
sp_Permalink sp_Print

HiLaugh

Thanks for Replay

Yeah.....I have tried(checked) those example's, but not working properly in my case.....

I have changed my MAC address, Things Speak Channel Number and writeAPI key, but my data not uploading into Things Speak....

 

Please...give me suggestions...what i do now???Frown

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
4
August 21, 2016 - 10:02 pm
sp_Permalink sp_Print

can you post your code?

Avatar
anjihanuma
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
5
August 24, 2016 - 5:54 am
sp_Permalink sp_Print

Hai....

Thank you ......@rw950431

code: which i'm using

....................................................................................................................................................................................................................................................................................................................................................................

#ifdef SPARK
#include "ThingSpeak/ThingSpeak.h"
#else
#include "ThingSpeak.h"
#endif
#ifdef ARDUINO_ARCH_AVR

#ifdef ARDUINO_AVR_YUN
#include "YunClient.h"
YunClient client;
#else

#ifdef USE_WIFI_SHIELD
#include <SPI.h>

#include <WiFi.h>
char ssid[] = "<YOURNETWORK>";
char pass[] = "<YOURPASSWORD>";
int status = WL_IDLE_STATUS;
WiFiClient client;
#else

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
EthernetClient client;
#endif
#endif

#define VOLTAGE_MAX 5.0
#define VOLTAGE_MAXCOUNTS 1023.0
#endif

#ifdef ARDUINO_ARCH_ESP8266
#include <ESP8266WiFi.h>
char ssid[] = "<YOURNETWORK>";
char pass[] = "<YOURPASSWORD>";
int status = WL_IDLE_STATUS;
WiFiClient client;

#define VOLTAGE_MAX 1.0
#define VOLTAGE_MAXCOUNTS 1023.0
#endif

#ifdef SPARK
TCPClient client;
#define VOLTAGE_MAX 3.3
#define VOLTAGE_MAXCOUNTS 4095.0
#endif

unsigned long myChannelNumber = XXXXX;
const char * myWriteAPIKey = "XXXXXXXXXXX";

void setup() {
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_ESP8266)
#ifdef ARDUINO_AVR_YUN
Bridge.begin();
#else
#if defined(USE_WIFI_SHIELD) || defined(ARDUINO_ARCH_ESP8266)
WiFi.begin(ssid, pass);
#else
Ethernet.begin(mac);
#endif
#endif
#endif

ThingSpeak.begin(client);
}

void loop()
{

float pinVoltage = analogRead(A0) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(1,pinVoltage);
#ifndef ARDUINO_ARCH_ESP8266

pinVoltage = analogRead(A1) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(2,pinVoltage);
pinVoltage = analogRead(A2) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(3,pinVoltage);
pinVoltage = analogRead(A3) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(4,pinVoltage);
pinVoltage = analogRead(A4) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(5,pinVoltage);
pinVoltage = analogRead(A5) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(6,pinVoltage);
pinVoltage = analogRead(A6) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(7,pinVoltage);
pinVoltage = analogRead(A7) * (VOLTAGE_MAX / VOLTAGE_MAXCOUNTS);
ThingSpeak.setField(8,pinVoltage);
#endif

ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);

delay(15000);
}

Avatar
rw950431

Forum Posts: 252
sp_UserOfflineSmall Offline
6
August 24, 2016 - 10:26 pm
sp_Permalink sp_Print

What happens if you only try and upload 2 or 3 voltages instead of 8?  I seem to recall reading that someone else had strange troubles when attempting to upload 8 fields at once.

If its the case it must be a bug in the thingspeak arduino library since its definitely possible to upload all 8 fields.

Avatar
anjihanuma
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
7
August 25, 2016 - 11:29 am
sp_Permalink sp_Print

Hai...

Thank YouLaugh....=>rw950431

It's working fine now......data uploading into my fields(Things Speak Channels),but i'm not getting channel updates(i.e ..in channel status updates)

how to get it???

 

any suggestions....?

 

Thanks in advanceSmile

Avatar
jvasudev

Forum Posts: 12
sp_UserOfflineSmall Offline
8
September 28, 2016 - 1:52 pm
sp_Permalink sp_Print

Hi, 

 

I don't see that you are updating the channel status field. You are only updating the fields in your channel. To update the status field you have to send a HTTP POST request to ThingSpeak (I am not sure if the ThingSpeak Arduino library support updating the channel status). For more details on how to format your POST request you can see here

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

epicpaymentsny

DanielBobby

mercedeszw18

ujuxoketate

olihfez

winnieeq69

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee