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

Arduino alarm system
Intermediate
  • 618
  • 12

Protip

A simple alarm system using arduino

Spideruino
Intermediate
  • 2,901
  • 25

A Lego arachnid controlled by your smartphone.

Valentine's Sunflower
Intermediate
  • 1,009
  • 9

Full instructions

A romantic project for Valentine's Day - a 3D printed sunflower that opens and closes in reaction to light. Have a Sunny Valentine!

Smart 3D printer Filament Counter (FilamentBot)
Intermediate
  • 1,936
  • 11

Full instructions

For 3D makers the worst thing is running out filament in the middle of a hours long print. This device will order for you when it is low!

Voice Control Chip-E With Google Home
Intermediate
  • 291
  • 3

Full instructions

Want to control a robot with your voice? Here's a great place to start with a Google Home, IFTTT, a WiFi enabled microcontroller and Arduino

EchoGarage
Intermediate
  • 369
  • 4

Work in progress

Universal cloud-based garage door opener with ultrasonic monitoring

ProjectsCommunitiesContestsLiveJobsBetaFree StoreBlogAdd projectSign up / Login
Respect project