Plant App: Displays live and historical data collected by soil moisture




Hardware components:
R8326274 01
Raspberry Pi 2 Model B
×1
12002 04
Breadboard (generic)
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×1
826 04
Male/Female Jumper Wires
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×1
Male/Male Jumper Wires
×1
Adafruit BMP280 I2C or SPI Barometric Pressure & Altitude Sensor
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×1
Adafruit Photo cell (CdS photoresistor)
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×1
SparkFun Soil Moisture Sensor
×1
Adafruit Breadboard trim potentiometer-10k
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×2
Adafruit 560ohm 1/4 Watt resistor
Included in the Adafruit Starter Pack for Windows 10 IoT Core on Raspberry Pi2 kit
×1
Adafruit MCP3008 – 8-Channel 10-Bit ADC With SPI Interface
×1
Software apps and online services:
10
Microsoft Windows 10 IoT Core
Vs2015logo
Microsoft Visual Studio 2015

Plant App: Displays live and historical data collected by soil moisture

STORY

Overview

digiPlant is a Universal Windows Platform app that helps users monitor their plant. The app collects, tweets, and displays temperature, brightness, and soil moisture data from various sensors. It runs on a Raspberry Pi and Windows 10 IoT Core.

historical data

Hardware Setup

The fritzing diagram and the list of materials show how the hardware can be built. The photocell and the soil moisture sensor will need the ADC in order for it to measure data and give meaningful results. The soil moisture sensor will also need soldering.

MainPage.xaml.cs

This page displays live data that are collected by the various sensors within ellipses. The colors give a sense of how close the current data is to ideal values (which can be altered by the user).

TwitterPage.xaml.cs

This class allows users to be able to have their plant tweet status. The UI describes how to set up a Twitter account, and the fields required to connect to a Twitter page is displayed. There is also a running history of the tweets that the plant has made.

SensorDataProvider.cs

This class creates all of the sensor objects. Then using a timer, the app receives the measurement from the sensors every three seconds, and sends the sensor, time of measurement, and value of measurement to the main page where it will be displayed.

/**
* This method records on a timer the data  
* measured by the temperature, brightness, and soil moisture sensor,  
* then organizes all of the information collected.    
* */  
private async void timerCallback(object state)  
{  
  //ensures that the temperature sensor is initialized before it is measured from  
  if (BMP280 == null)  
  {  
	Debug.WriteLine("BMP280 is null");  
  }  
  else  
  {  
      //receives the value from the temperature sensor and saves   
	//the data in the SensorDataEventArgs class, which holds  
	//the sensor name, the data point, and the time the value was measured.  
	//this data is then sent back to the main page and the UI is adjusted based  
	//off of the measurement.   
	//float currentTemperature = (float) rand.NextDouble() * 10;  
	float currentTemperature = await BMP280.ReadTemperature();  

Read More: Plant App: Displays live and historical data collected by soil moisture


Leave a Comment

© 2015 Powered By Engineering Projects Team, Raspberry Pi Projects

Scroll to top