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
×2
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 Altair 8800 simulator
Intermediate
  • 6,197
  • 31

Full instructions

Ever wanted to play with the computer that sparked the personal computer age but don't have the cash to buy an Altair? Build your own!

Rocky Rover: Robotic Vision System PixyCam & Arduino 101
Intermediate
  • 4,522
  • 48

Full instructions

Using PixyCam and Intel Arduino 101 to drive this rover. Easy Robotic Vision system using PixyCam, rover reacts to the ball using Pan/Tilt.

Family, friend or foe - PIR arm/disarm using BLE
Intermediate
  • 98
  • 2

Full instructions

It's a BLE-enabled, cloud-connected smartphone app used to control & monitor who/when PIR is armed/disarmed. Uses Slack for notifications.

Sketch It (CNC plotter)
Intermediate
  • 1,122
  • 13

Full instructions

It can Sketch accurately, You just have to upload the gcode of the image.Try it it's just Awesome......My first project.

Arduino MKR1000 Weather Station
Intermediate
  • 632
  • 7

Full instructions

Weather station monitors temperature, pressure, light, dust, soil moisture values and displays on the OLED screen and Cayenne dashboard.

Running Breadboard
Intermediate
  • 409
  • 6

This is a great toy for your pets (if they are gentle) or just as a nice toy to have around the office or home.

ProjectsCommunitiesContestsLiveJobsFree StoreBlogAdd projectSign up / Login
Respect project