Things used in this project

Hardware components:
Dash%20image
Hologram Dash
×1
12002 04
Breadboard (generic)
×1
Lithium Ion Battery Pack
×1
Hologram%20dash
Hologram SIM Card w/Device Management
×1
Sugru 5g Pack
×1
SparkFun Soil Moisture Sensor SEN-13322
×1
SK-12 SK Series Polycarbonate Enclosure with Knockouts
×1
Software apps and online services:
Ide web
Arduino IDE
Avatar light%402x
Hologram Data Router
Screen%20shot%202016 03 01%20at%209.14.06%20pm
Losant Platform

Schematics

Wiring schematic
Hiiz3tvq2vzpfvwo1vgy
Wiring schematic
Thanks to Ben (benstr) Strahan for the diagram!
https://www.hackster.io/benstr-hologram
Whf4zgc57dtjtenbnkyw

Code

Soil moisture system code for Hologram DashArduino
/**
 * Soil moisture monitor system with Hologram Dash
 * Mike Schaus
 * Oct 30, 2016
 * Made as part of the Hologram Hacker-In-Residence program
 * 
 * Project based on the Losant IoT Moisture Sensor Kit.
 * Hologram Dash reads sensor and sends data to Hologram cloud.
 * This data is passed to the Losant cloud service for plotting.
 */


// define pins on Dash
const int MOISTURE_POWER_PIN = D01;
const int MOISTURE_SIGNAL_PIN = A01;

void setup() {
  // put your setup code here, to run once:
  
  SerialCloud.begin(115200);
  SerialUSB.begin(9600);
  
  Dash.begin(); // start up the Dash class
  Dash.onLED(); // light on during boot section for sign of life

  pinMode(MOISTURE_POWER_PIN, OUTPUT);

  Dash.snooze(10000); // let me open the serial monitor
  Serial.println("Starting Moisture Sensor Firmware");
  SerialCloud.println("Starting Moisture Sensor Firmware");

  Dash.offLED();
}



void reportMoisture() {
  // Turn on the moisture sensor.
  // The sensor will corrode quickly with current
  // running through it all the time. We just need to send
  // current through it long enough to read the value.

  // Run LED while in this reporting loop for debugging.
  // Can skip LED during deployment to save power.
  Dash.onLED();
  
  digitalWrite(MOISTURE_POWER_PIN, HIGH);

  // Pause a short time to stablize sensor.
  Dash.snooze(100);

  int raw = analogRead(MOISTURE_SIGNAL_PIN);

  // Turn the sensor back off.
  digitalWrite(MOISTURE_POWER_PIN, LOW);

  Dash.offLED();
  
  Serial.println();
  Serial.print("Moisture level: ");
  Serial.println(raw);
  Serial.print("Battery Percentage: ");
  Serial.println(Dash.batteryPercentage());
  Serial.print("Battery millivolts: ");
  Serial.println(Dash.batteryMillivolts());

//  Let's build a JSON-compatible string to send to the cloud!
//  Complete string will look something like:
//  {"moisture": 100,"battery_level": 80}
//  FYI the " characters are escaped by typing \"
  SerialCloud.print("{\"moisture\": ");
  SerialCloud.print(raw);
  SerialCloud.print(",\"battery_level\": ");
  SerialCloud.print(Dash.batteryPercentage());
  SerialCloud.println("}");
}

void loop() {
  // put your main code here, to run repeatedly:
  
// two-way serial passthrough for seeing debug statements
  while(SerialUSB.available()) {
    SerialCloud.write(SerialUSB.read());
  }
  while(SerialCloud.available()) {
    SerialUSB.write((char)SerialCloud.read());
  }

// main operation timing code
  Dash.snooze(60000); //allow time for modem to connect
  reportMoisture();
  Dash.deepSleepMin(60);

}

Credits

R3tkcxkom1pu38aqb0bh
Mike Schaus

In addition to being a maker, I am a professional product development engineer, problem solver, and project leader.

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

The composting friend
Intermediate
  • 611
  • 34

Full instructions

Our goal is to make composting easier to use and to maintain.

Automatic Fear 1.0
Intermediate
  • 279
  • 5

Full instructions

A device capable of frightening my sister and with compatibility with other members of the family

Theremino Adapter for CNC.
Intermediate
  • 281
  • 7

Full instructions

Attention: This adapter is used to replace the parallel port with the USB, and not to operate Mach3 CNC or Linux.

Theremino Logger
Intermediate
  • 157
  • 4

Datalogger is simple to use but with great performance. The base, concise and intuitive.

Smart Sump Pump Monitor
Intermediate
  • 825
  • 10

Full instructions

Sump pump monitor has live dashboard for usage statistics, and data logging. Email notifications through Particle Cloud or IFTTT.

Smart Home 433MHz RF <-> MQTT Gateway With Some Extras
Intermediate
  • 819
  • 4

Full instructions

Control your RF devices via MQTT and integrate them into your smart home 🏡, using the WEMOS ESP8266 connected to MQTT service via WiFi.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback