Things used in this project

Hardware components:
Compare particleelectron
Particle Electron
×1
Adafruit Soil Temperature/Moisture Sensor - SHT10
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
09590 01
LED (generic)
×1
11026 02
Jumper wires (generic)
×1
Protection plastic case
×1
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
×1
Software apps and online services:
Ubidots
Ubidots
Particle IDE

Schematics

Diagram connections
Particle sht1x bb 43s5x4pfaz

Code

CODEC/C++
// This example is to get the last value of variable from the Ubidots API

// This example is to save multiple variables to the Ubidots API with TCP method

/****************************************
 * Include Libraries
 ****************************************/

#include "Ubidots.h"
#include <SHT1x.h>
#include <application.h>

/****************************************
 * Define Constants
 ****************************************/

#ifndef TOKEN
#define TOKEN "Put_your_Ubidots"  // Put here your Ubidots TOKEN
#endif

#ifndef DATAPIN
#define DATAPIN D0
#endif

#ifndef CLCKPIN
#define CLCKPIN D1
#endif

#ifndef LED
#define LED D7
#endif

Ubidots ubidots(TOKEN);


/****************************************
 * Auxiliar Functions
 ****************************************/

SHT1x sht10(DATAPIN, CLCKPIN);

/****************************************
 * Main Functions
 ****************************************/

void setup() {
    Serial.begin(115200);
    pinMode(LED, OUTPUT);
    //ubidots.setDebug(true);  //Uncomment this line for printing debug messages
}

void loop() {
    
    float humidity = sht10.readHumidity();
    float temperature = sht10.readTemperatureC();
    
    ubidots.add("soil-moisture", humidity); 
    ubidots.add("temperature", temperature);
    
    ubidots.setMethod(TYPE_TCP);  //Set to TCP the way to send data
    if(ubidots.sendAll()){
        // Do something if values were sent properly
        Serial.println("Values sent by the device");
        digitalWrite(LED, HIGH);
    }
    delay(5000);
    digitalWrite(LED, LOW);
}

Credits

Generic icon taoacaqyns
UbiMaker

Maker @ ubidots.com

Contact
Foto%20carnet
Maria Carlina Hernandez

Hardware Developer Engineer & Content Specialist on Ubidots - IoT

Contact

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

Blynk GPS Tracker
Intermediate
  • 41
  • 2

Full instructions

Simple GPS tracker using a Particle Photon (or Electron) and an EM406 GPS module with location visible on Blynk app map.

Pool Buddy
Intermediate
  • 1,619
  • 11

Work in progress

Monitor and log water quality (pH & ORP) and temperature from everywhere.

IoT Thermometer Using Python
Intermediate
  • 986
  • 8

Full instructions

How to develop a simple but powerful IoT thermometer using a Zerynth-powered single-board MCU and the Zerynth App.

Particle Photon Flip Dot Clock
Intermediate
  • 2,162
  • 31

Full instructions

The flip dot display uses an electromechanical dot matrix that spin from black to yellow to display text, numbers and more!

Patriot iOS App
Intermediate
  • 547
  • 9

Use an old iPhone device to control and display the status of your Patriot IoT devices.

Patriot iOS App

Team Patriot

What To Wear LCD
Intermediate
  • 48
  • 1

Ever wondered what to wear due to unpredictable weather??? Wonder no longer!

Add projectSign up / Login