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

Pen Stand: Gaming Enabled
Intermediate
  • 58
  • 4

Full instructions

Do you have a pen stand that just sits there and does nothing? Can we make it play a game/flash LEDs every time you use it? Let's find out!

Reducing Arduino Power Consumption
Intermediate
  • 1,211
  • 98

Protip

One the most important feature of portable electronics should be long battery life. We can reduce the current drawn by several ways.

Smart Payment System for Parking Area Using RFID
Intermediate
  • 660
  • 13

This project makes a simple, cheap and secure payment system using RFID that is suitable for small businesses.

 Monitoring Working Time of Employees Using RFID
Intermediate
  • 555
  • 12

Full instructions

This helps monitor the working time of employees, storing information in database.

Ultrasonic Sensor
Intermediate
  • 400
  • 3

This project shows you how to use the Ultrasonic for meter distance.

RING PONG
Intermediate
  • 2,172
  • 8

A simple Ping Pong game played on a NeoPixel Ring with Arduino.

Sign up / LoginProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlog