Things used in this project

Schematics

Particle devices connected to the Internet
Family portrait outlines cab820d4

Code

thingSpeakWrite WebhookJavaScript
This is a JSON formatted file for sending data to ThingSpeak from Particle using webhooks
{
    "event": "thingSpeakWrite_",
    "url": "https://api.thingspeak.com/update",
    "requestType": "POST",
    "form": {
        "api_key": "{{k}}",
        "field1": "{{1}}",
        "field2": "{{2}}",
        "field3": "{{3}}",
        "field4": "{{4}}",
        "field5": "{{5}}",
        "field6": "{{6}}",
        "field7": "{{7}}",
        "field8": "{{8}}",
        "lat": "{{a}}",
        "long": "{{o}}",
        "elevation": "{{e}}",
        "status": "{{s}}"
    },
    "mydevices": true,
    "noDefaults": true
}
MATLAB Visualization CodeR
Use this MATLAB code you visualize data from a ThingSpeak channel.
readChannelID = 93156;
fieldID1 = 1;
readAPIKey = 'MCI6XM81ZFOY8UCE';

%% Read Data %%
[data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 10, 'ReadKey', readAPIKey);

%% Visualize Data %%
thingSpeakPlot(time, data);
Particle Code for Sending Data to the ThingSpeak WebhookArduino
This code sends data to ThingSpeak from Particle devices
#define publish_delay 16000
unsigned int lastPublish = 0;

void setup() {

}

void loop() {
    unsigned long now = millis();

    if ((now - lastPublish) < publish_delay) {
        return;
    }

    int value = analogRead(A0);
    Particle.publish("thingSpeakWrite_A0", "{ \"1\": \"" + String(value) + "\", \"k\": \"XXXXXXXXXXXXXXXX\" }", 60, PRIVATE);

    lastPublish = now;
}

Credits

83e164e22a0b069f4807cac094df28aa
Hans

IoT Engineer, Maker - I have a toaster that has been tweeting since 2008.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Direct Photon to TP-Link Device Control
Easy
  • 276
  • 7

Full instructions

Add this small file to your project to control TP-Link bulbs and plugs directly with simple subroutine calls.

Poor Man's CAN Bus
Easy
  • 154
  • 4

Protip

Learn how to connect microcontrollers together using the CAN bus by using a simple AND gate

Internet Connected Bubble Machine
Easy
  • 32
  • 2

Full instructions

Make it possible to activate a bubble machine from anywhere using a Particle Photon

MyPIR-Sensor activate analog RGB Stripe controlled by Photon
Easy
  • 85
  • 2

Full instructions

At my age you have to get up at night and get tired on the way to the bathroom. Using a PIR-Sensor to trigger light on!

Weather Box
Easy
  • 2,183
  • 11

Full instructions

Small weather station that uploads to Weather Underground with a NeoPixel ring for visualization.

Washer/Dryer Monitor
Easy
  • 576
  • 5

Full instructions

Monitor your appliance's power indicator with a photocell for easy notifications without high voltage wiring.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback