Internet of Things at Bohunt School (Wokingham) Plant moisture sensing system

Similar documents
Dust Sensor using GP Y

Hello and welcome to this presentation of the STM32L4 Analog-to-Digital Converter block. It will cover the main features of this block, which is used

Computer Systems Architecture

ECB DIGITAL ELECTRONICS PROJECT BASED LEARNING PROJECT REPORT ON 7 SEGMENT DIGITAL STOP WATCH USING DECODER

Lesson Sequence: S4A (Scratch for Arduino)

ECE 372 Microcontroller Design

Introduction to Digital Electronics

MSCI 222C Class Readings Schedule. MSCI 222C - Electronics 11/20/ Class Seating Chart Mondays Class Seating Chart Tuesdays

16 Stage Bi-Directional LED Sequencer

16-BIT LOAD CELL/DUAL STATUS INPUT

Logic Design. Flip Flops, Registers and Counters

Edge Connector Light Level Detector

Published in A R DIGITECH

6.111 Final Project Proposal Kelly Snyder and Rebecca Greene. Abstract

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

PYTHON AND IOT: From Chips and Bits to Data Science. Jeff Fischer Data-Ken Research Sunnyvale, California, USA

Laboratory 8. Digital Circuits - Counter and LED Display

Figure 1: Standard 906 Sensor and Pulser Disc. Figure 2: Standard 906 Sensor and Pulser Wrap

CHAPTER 3 LOMA LINDA UNIVERSITY

ECE 2274 Pre-Lab for Experiment Timer Chip

Preface. About SunFounder. About Super Kit. Free Support

UNIT V 8051 Microcontroller based Systems Design

STD-525T PRECISION TIMER

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

Introduction 1. Green status LED, controlled by output signal ST. Sounder, controlled by output signal Q6. Push switch on input D6

Building the ChronoDot Calendar Reminder

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

Instructions and answers for teachers

Copyright 2011 by Enoch Hwang, Ph.D. and Global Specialties. All rights reserved. Printed in Taiwan.

Mission. Lab Project B

Integration of Virtual Instrumentation into a Compressed Electricity and Electronic Curriculum

Sensopress LCD Special English

Triple RTD. On-board Digital Signal Processor. Linearization RTDs 20 Hz averaged outputs 16-bit precision comparator function.

QTI Line Follower AppKit for the Boe-Bot (#28108)

Analog to Digital Conversion

Table of contents 1. INTRODUCTION GENERAL CONTENTS OF PACKAGE GENERAL USE OF THE EQUFLOW 6100 D/A CONVERTER STORAGE..

Data Acquisition Networks. Installing and Configuring the DM01 Hardware

Build A Video Switcher

Part 2 -- A digital thermometer or talk I2C to your atmel microcontroller

EDL8 Race Dash Manual Engine Management Systems

Basic LabVIEW Programming Amit J Nimunkar, Sara Karle, Michele Lorenz, Emily Maslonkowski

MSCI 222C Fall 2018 Introduction to Electronics

Laboratory 10. Required Components: Objectives. Introduction. Digital Circuits - Logic and Latching (modified from lab text by Alciatore)

Automatic Projector Tilt Compensation System

An Approach to Raspberry Pi Synchronization in a Multimedia Projection System for Applications in Presentation of Historical and Cultural Heritage

LEVEL CROSSING MODULE FOR LED SIGNALS LCS2

SWITCH: Microcontroller Touch-switch Design & Test (Part 2)

MSCI 222C Class Readings Schedule. MSCI 222C - Electronics 11/27/18. Copyright 2018 C.P.Rubenstein Class Seating Chart Mondays

Introduction 1. Digital inputs D6 and D7. Battery connects here (red wire to +V, black wire to 0V )

Hardware Guide BrightSign, LLC Version:.1 Los Gatos, CA, USA. MODELS: XD Product Line

MSCI 222C Fall 2018 Introduction to Electronics

Experiment 7 Fall 2012

Andrew G. Bell June 28, 2016

Fig. 1 Analog pins of Arduino Mega

1. Overview. SSI-1016G interfaces with 24, 25 and 26 bit Temposonics SSI sensor. Block diagram. as PNP open collector output

B.Sc. (Computer Science) Part-I Examination, 2010 Computer Programming Fundamental

Experiment 0: Hello, micro:bit!

Chunghwa Telecom Laboratories. CHT IoT Smart Platform and Ameba. Two-Way Communication Application. Case Instruction Document

ME 515 Mechatronics. Introduction to Digital Electronics

EE 367 Lab Part 1: Sequential Logic

Digital Stopwatch Timer Circuit Using 555timer and CD4033

Logic Gates, Timers, Flip-Flops & Counters. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

Alice EduPad Board. User s Guide Version /11/2017

Integrated Circuit for Musical Instrument Tuners

ThermalCapture GrabberUSB - User Guide

Laboratory 7. Lab 7. Digital Circuits - Logic and Latching

Arduino Lesson 3. RGB LEDs

Chapter 4: One-Shots, Counters, and Clocks

Operating instructions Through-beam sensor. OJ51xx / / 2004

Bruce Chubb s Computer/Model Railroad Interface (C/MRI) 101- The Basics

FLIP-FLOPS AND RELATED DEVICES

IoT Software Platforms

Vorne Industries. 87/719 Analog Input Module User's Manual Industrial Drive Itasca, IL (630) Telefax (630)

Embedded Systems Lab. Dynamic Traffic and Street Lights Controller with Non-Motorized User Detection

This module senses temperature and humidity. Output: Temperature and humidity display on serial monitor.

AXE101 PICAXE-08M2 Cyberpet Kit

Digital Clock. Perry Andrews. A Project By. Based on the PIC16F84A Micro controller. Revision C

ISSN (PRINT): , (ONLINE): , VOLUME-5, ISSUE-4,

SMART IRRIGATION SYSTEM, A STATISTICAL APPROACH, USING RASPBERRY PI

IOT BASED ENERGY METER RATING

HS-509 VIBRATION TRIP MODULE

Monday 28 January 2013 Morning

Microcontrollers. Outline. Class 4: Timer/Counters. March 28, Timer/Counter Introduction. Timers as a Timebase.

Raspberry Pi, SenseHat and Weather Service

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Tajana Simunic Rosing. Source: Vahid, Katz

Computer Organization

9/23/2014. Andrew Costin, Tom Syster, Ryan Cramer Advisor: Professor Hack Instructor: Professor Lin May 5 th, 2014

Experiment # 4 Counters and Logic Analyzer

Application Note 11 - Totalization

TV Synchronism Generation with PIC Microcontroller

Lab 2, Analysis and Design of PID

The Micropython Microcontroller

Sentinel I24 Digital Input and Output Configuration

Internet of Things - IoT Training

THE ASTRO LINE SERIES GEMINI 5200 INSTRUCTION MANUAL

1.5mm amplitude at 10 to 55Hz frequency in each X, Y, Z direction for 2 hours 500m/s² (approx. 50G) in each X, Y, Z direction for 3 times

ECE Design Team 3 Madi Kassymbekov How to use MSP 430 Peripheral Sensors and use of LEDs as sensors

Informatics Enlightened Station 2 Park distance control system

Fig. 1. The Front Panel (Graphical User Interface)

Model No. ST60-S (-SRN, -SRK, -DRN, -DRK)

Transcription:

This practical session should be a bit of fun for you. The objective is to build a system to sense the moisture content of the soil in a plant pot and display the value on a dashboard. The hardware used is a Wemos D1 Mini (ESP8266-based microcontroller) mounted on a breadboard and a Raspberry Pi running Node-RED and Mosquitto (MQTT). Here s a photo of the sensing part of the system. The items on the breadboard are: * Wemos D1 Mini * YL-38 miniature interface board * BC547 npn small-signal transistor * 1K ohm resistor * Pieces of single-stranded connecting wire * 5V power block And of course a plant pot with the soil sensor Here s a diagram showing the breadboard connections.

Although I ve used a BC547 npn transistor any small-signal npn transistor should work as the amount of current being switched is minimal. Connect the transistor s collector to +3V3 on the Wemos D1 Mini, and the emitter to the Vcc pin on the YL-38. The transistor s base is connected to D6 on the Wemos via a 1K ohm resistor. Connect a ground wire from the Wemos to the YL-38. The analog output from the YL-38 (labelled A0) goes to the A0 pin on the Wemos. Double-check your wiring BEFORE connecting the 5V power block. Setting-up the Wemos D1 Mini The next step is to set-up the devices and write some rules. Two devices are needed. One to handle the analog input from the moisture sensor and one to create some variables. The Generic - Dummy Device is used for this task.

Here s a screen shot of the settings for the analog input. Notice the name is paw (potentially available water) and the value-name is called value. The formula simply converts and scales the analog reading to a value between 0 and 10 (where 10 means very wet and 0 very dry). Notice the sampling interval is set to 5-seconds. Also notice that the Send to Controller option is left un-ticked. Right that s the analog bit sorted. Setting-up the named variables This system makes use of rules and timers and named variables. The named variables are declared by using a Generic - Dummy Device which is described on the next page.

I ve named the Generic Dummy Device as var and used two of the four available names (e.g. activation and sent ) as shown below. You can set a value in these variables (in the rules) by using: TaskValueSet,12,1,number TaskValueSet,12,2,number //sets activation to a number //sets sent to a number You can read the value held in a variable (in the rules) by using: [var#activation] or [var#sent] Writing some simple rules The listings on the next page shows the various rules used in the system.

The first rule runs at system boot-up and resets Timer1 and the variables. on System#boot do timerset,1,0 TaskValueSet,12,1,0 //Set var#activation = 0 TaskValueSet,12,2,0 //Set var#sent = 0 endon The second rule is triggered when an event-command is issued from Node-RED. The npn transistor (connected to D6) is switched-on, an acknowledgement message is sent back to Node-RED (via MQTT), the two named variables are set and Timer1 is triggered for 6-seconds. on activate do gpio,12,1 //Set GPIO(D6)=1 (Turn on the transistor) publish node26/status, "activated" TaskValueSet,12,1,1 //Set var#activation = 1 TaskValueSet,12,2,0 //Set var#sent = 0 timerset,1,6 endon The next rule is triggered whenever the analog input changes. on paw#value do endon if [var#activation]>0 and [var#sent]=0 endif publish node26/reading, {"paw": [paw#value]} TaskValueSet,12,2,1 //Set var#sent = 1 Providing the variable [var#activation] is set and the variable [var#sent] is clear then the analog reading is published to Node-RED via MQTT. At the same time the flag [var#sent] is set to stop any further transfers.

The last rule is triggered when Timer1 expires. on Rules#timer=1 do gpio,12,0 //Set GPIO(D6)=0 (Turn off the transistor) endon publish node26/status, "deactivated" TaskValueSet,12,1,0 //Set var#activation = 0 This rule switches off the transistor and publishes a message to Node-RED via MQTT. It also resets the variable [var#activation] to zero - ready for the next trigger sequence. Setting-up the Node-RED flows This part of the flow sends an event to trigger the Wemos D1 Mini. This screen shot shows the setting for the Inject node. This screen shot shows the settings for the MQTT send node

Feedback This optional part of the flow detects status-feedback from the Wemos D1 Mini. This is the main flow that processes the data before sending it to the dashboard gauge and text boxes. Dashboard Here s a screen shot of the dashboard. It is made up of three elements: an image, a gauge and a text box. I m sure you could construct a much better-looking dashboard.

Future enhancement One of the things I would like to do is add extra sensors so I could monitor a group of plants. The best way to achieve this is to make use of an analog multiplexor like the ADS1115. This is a 4-channel device which means I could monitor four pot plants as shown on the demonstration dashboard below.

Node-RED flow (graphical) Here s a view of the complete Node-RED flow. Node-RED flow (textual) Here s a link to the text file for the flow. http://resources-area.co.uk/node-red-flows/soil_moisture_monitor.txt You need to copy and paste this text file into Node-RED using the Import clipboard facility on the top-right of Node-RED s main screen. Summary This tutorial has shown how Node-RED can communicate with a Wemos D1 Mini to trigger a series of actions - in this case to read the soil-moisture value. It has also shown how a simple, but visually attractive, dashboard can be constructed using the basic elements available in Node-RED. There are many optional extras that could be introduced into this project - for example an OLED display panel could be connected to the Wemos D1 Mini to show the moisture value and watering actions that might be needed. You could also introduce an electric pump to automatically water the plants. I hope you have enjoyed reading through this tutorial and will be inspired to have a go at creating your very own soil moisture monitoring system.