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

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





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

sp_Feed sp_TopicIcon
Things speak for monitoring noise and air pollution to create smart environmet
No permission to create posts
August 9, 2016
7:51 am
Avatar
anjihanuma
New Member
Members
Forum Posts: 4
Member Since:
August 9, 2016
sp_UserOfflineSmall Offline

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?

August 10, 2016
12:05 am
Avatar
rw950431

Top
Members
Forum Posts: 261
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

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

August 20, 2016
5:09 am
Avatar
anjihanuma
New Member
Members
Forum Posts: 4
Member Since:
August 9, 2016
sp_UserOfflineSmall Offline

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

August 21, 2016
10:02 pm
Avatar
rw950431

Top
Members
Forum Posts: 261
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

can you post your code?

August 24, 2016
5:54 am
Avatar
anjihanuma
New Member
Members
Forum Posts: 4
Member Since:
August 9, 2016
sp_UserOfflineSmall Offline

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);
}

August 24, 2016
10:26 pm
Avatar
rw950431

Top
Members
Forum Posts: 261
Member Since:
January 30, 2014
sp_UserOfflineSmall Offline

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.

August 25, 2016
11:29 am
Avatar
anjihanuma
New Member
Members
Forum Posts: 4
Member Since:
August 9, 2016
sp_UserOfflineSmall Offline

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

September 28, 2016
1:52 pm
Avatar
jvasudev

MathWorks
Members
Forum Posts: 12
Member Since:
April 29, 2016
sp_UserOfflineSmall Offline

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:
19 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

josephrj11, dennis55, jillhp4, tabathawg69, MarinaMa, Susandom

Administrators: Hans: 387, lee: 457