Pooja Baraskar
Published © LGPL

Moisture Sensor With Intel Galileo

Let's make a plant monitoring system with Moisture Sensor.

BeginnerFull instructions provided3,591
Moisture Sensor With Intel Galileo

Things used in this project

Hardware components

Moisture Sensor
×1
LED (generic)
LED (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Visual Studio 2015
Microsoft Visual Studio 2015
Windows 10 IoT Core
Microsoft Windows 10 IoT Core

Story

Read more

Code

Code sample

C/C++
#include "stdafx.h"
#include "arduino.h"

int _tmain(int argc, _TCHAR* argv[])
{
  return RunArduinoSketch();
}

int led = 13;  // This is the pin the LED is attached to.
int moisture_sensor = 0;

void setup()
{
  pinMode(led, OUTPUT);
}

void loop()
{
  int moisture_sensor_reading = analogRead(moisture_sensor);
  Log(L"Moisture: %d\r\n", moisture_sensor_reading);
  delay(1000);

  if (moisture_sensor_reading>=300)
  {
    digitalWrite(led, HIGH);  // Soil is dry
  }
  else
  {
    digitalWrite(led, LOW);  // Soil is Web
  }
}

Credits

Pooja Baraskar

Pooja Baraskar

25 projects • 177 followers
Pooja Baraskar is an accomplished software engineer, inventor, and technical author with over a decade of experience in the tech industry.

Comments