PInt@t10n: Smart Plant Monitoring System

About: my name is thomas

PI@nt@t10n

This project was created as a test for the ibm iot cloud. We use an esp-8266 to send and receive data to and from the ibm cloud. The communication between the esp and the ibm cloud happens through MQTT.

To handle all the data and to present the user with a user interface we use node-red. It is very beginner friendly.

To get started you need:

  • Esp-8266
  • dht 11/22 temp/moisture sensor
  • photosensitive diode (light measurement)
  • buzzer
  • ground moisture sensor
  • ibm cloud account

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Connect Your Sensors

As we mentioned before we are going to use the esp8266 to read and send sensor data. For this tutorial we are going to assume you know how to connect your sensors to your micro controller. You also already need to know how to upload code to an esp8266.

Our esp model only has one analog port so we chose to receive analog information from our light sensor because then we can monitor how much light the plant gets.

All other sensors are connected digitally. Our DHT11 sensor sends data digitally and we use the dht library to interpret the sensors data.

Above you can find a circuit diagram for the sensors we used. But please keep in mind that the sensors we used often come with a module so you can easily connect it to your micro controller without all the extra resistors that we included in the diagram.

Step 2: Code

This is the arduino sketch we used. You can learn about how the code works if you read the comments.

#include ArduinoJson.h
#include DHT_U.h #include DHT.h #include ESP8266WiFi.h #include ESP8266WiFiMulti.h #include PubSubClient.h

#define STASSID "ucll-projectweek-IoT" #define STAPSK "Foo4aiHa" #define DHTPin 5 #define moisturePin 4 #define DHTType DHT11 DHT dht(DHTPin, DHTType); ESP8266WiFiMulti WiFiMulti; float temp = 0; float humidity = 0; boolean moisture = false; int light = 0; const char* ssid = STASSID; const char* password = STAPSK; const char* mqtt_server = "cmfwqk.messaging.internetofthings.ibmcloud.com"; WiFiClient espClient; PubSubClient client(espClient); long lastMsg = 0; char msg[50]; int value = 0; #define MQTT_HOST "cmfwqk.messaging.internetofthings.ibmcloud.com" #define MQTT_PORT 1883 #define MQTT_DEVICEID "d:cmfwqk:ESP8266:ESP" #define MQTT_USER "use-token-auth" #define MQTT_TOKEN "Ucll2018" #define MQTT_TOPIC "iot-2/evt/status/fmt/json" #define MQTT_TOPIC_DISPLAY "iot-2/cmd/update/fmt/json" #include "pitches.h" // notes in the melody: // note durations: 4 = quarter note, 8 = eighth note, etc.: int shortTone = 80; int longTone = 200; int standardDelay = 50; int delayBetweenBars = 50; void setup_wifi() { delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void callback(char* topic, byte* payload, unsigned int length) { Serial.print("Message arrived ["); Serial.print(topic); Serial.print("] "); for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); } Serial.println(); StaticJsonDocument<256> jsonBuffer; deserializeJson(jsonBuffer, payload); JsonObject root = jsonBuffer.as(); if(root["song"]=="darude"){ darude(); } if(root["song"]=="starwars"){ starwars(); } if(root["song"]=="jacques"){ Serial.println("jakakakakakkakaka"); jacques(); } } void reconnect() { // Loop until we're reconnected while (!client.connected()) { Serial.print("Attempting MQTT connection..."); // Attempt to connect if (client.connect(MQTT_DEVICEID, MQTT_USER, MQTT_TOKEN)) { Serial.println("connected"); client.subscribe(MQTT_TOPIC_DISPLAY); } else { Serial.print("failed, rc="); Serial.print(client.state()); Serial.println(" try again in 5 seconds"); // Wait 5 seconds before retrying delay(5000); } } } void setup() { Serial.begin(9600); pinMode(moisturePin, INPUT); dht.begin(); pinMode(0,OUTPUT); setup_wifi(); client.setServer(mqtt_server, MQTT_PORT); client.setCallback(callback); delay(20); } void loop() { if (!client.connected()) { reconnect(); } client.loop(); moisture = digitalRead(moisturePin); light = analogRead(A0); temp = dht.readTemperature(); humidity= dht.readHumidity(); Serial.println("Temperature =" + String(temp,1) + "\nHumidity =" + String(humidity,1) + "\nMoisture: "+String(moisture)+"\nLight: "+String(light)); String payload = "{\"ts\":{\"t\": "+String(temp,1)+", \"h\": "+String(humidity,1)+"}, \"ms\":{\"m\": "+String(moisture)+"},\"ls\":{\"l\":"+String(light)+"}}"; Serial.println(payload); if (client.publish(MQTT_TOPIC, (char*) payload.c_str())){ Serial.println("publish ok"); }else { Serial.println("publish failed"); } delay(2000); } void darude(){ tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(delayBetweenBars); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0,NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0,NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0,NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_D4, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_A3, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(delayBetweenBars); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0,NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(delayBetweenBars); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0,NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, shortTone); delay(shortTone); noTone(0); delay(standardDelay); tone(0, NOTE_B3, longTone); delay(longTone); noTone(0); delay(standardDelay); tone(0, NOTE_E4, longTone); delay(longTone); noTone(0); delay(standardDelay); } void starwars() { beep(NOTE_A4, 500); beep(NOTE_A4, 500); beep(NOTE_A4, 500); beep(NOTE_F4, 350); beep(NOTE_C5, 150); beep(NOTE_A4, 500); beep(NOTE_F4, 350); beep(NOTE_C5, 150); beep(NOTE_A4, 650); delay(500); beep(NOTE_E5, 500); beep(NOTE_E5, 500); beep(NOTE_E5, 500); beep(NOTE_F5, 350); beep(NOTE_C5, 150); beep(NOTE_GS4, 500); beep(NOTE_F4, 350); beep(NOTE_C5, 150); beep(NOTE_A4, 650); } void beep(int note, int duration) { //Play tone on buzzerPin tone(0, note, duration); delay(duration); noTone(0); delay(standardDelay); } void heartOfCourage(){ } void jacques(){ beep(NOTE_C4, 500); beep(NOTE_D4, 500); beep(NOTE_E4, 500); beep(NOTE_C4, 500); beep(NOTE_C4, 500); beep(NOTE_D4, 500); beep(NOTE_E4, 500); beep(NOTE_C4, 500); beep(NOTE_E4, 500); beep(NOTE_F4, 500); beep(NOTE_G4, 500); beep(NOTE_E4, 500); beep(NOTE_F4, 500); beep(NOTE_G4, 500); beep(NOTE_G4, 500); beep(NOTE_A4, 500); beep(NOTE_G4, 500); beep(NOTE_F4, 500); beep(NOTE_E4, 500); beep(NOTE_C4, 500); beep(NOTE_G4, 500); beep(NOTE_A4, 500); beep(NOTE_G4, 500); beep(NOTE_F4, 500); beep(NOTE_E4, 500); beep(NOTE_C4, 500); beep(NOTE_C4, 500); beep(NOTE_G4, 500); beep(NOTE_C4, 500); beep(NOTE_C4, 500); beep(NOTE_G4, 500); beep(NOTE_C4, 500); }

Step 3: Ibm Cloud

You need to setup an IBM-cloud instance. You can find information about this via this link: github.

Step 4: Node-RED

We use node-red for handling our general business logic and to visualize this data in an intuitive user interface.

Step 5: Node-RED Setup: Light

Import the following code into your project.

[{"id":"deb0d57.1c46528","type":"tab","label":"Light","disabled":false,"info":""},{"id":"8a0fcaac.4e54","type":"ibmiot in","z":"deb0d57.1c46528","authentication":"boundService","apiKey":"","inputType":"evt","logicalInterface":"","ruleId":"","deviceId":"ESP","applicationId":"","deviceType":"ESP8266","eventType":"+","commandType":"","format":"json","name":"Get data from ESP","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":false,"allLogicalInterfaces":"","allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":120,"y":62,"wires":[["45480fb5.078008"]]},{"id":"45480fb5.078008","type":"function","z":"deb0d57.1c46528","name":"light","func":"var light = msg.payload.ls.l;\nlight = (1024-light)*100/1024;\nreturn {payload:Math.round(light,0)};","outputs":1,"noerr":0,"x":327,"y":120,"wires":[["1ee8bb69.e58355","bad10f38.5851e8"]]},{"id":"1ee8bb69.e58355","type":"ui_gauge","z":"deb0d57.1c46528","name":"","group":"495b4c5.d18e334","order":1,"width":"8","height":"5","gtype":"gage","title":"","label":"","format":"{{value}}","min":"0","max":"100","colors":["#b50000","#b5B500","#00B500"],"seg1":"20","seg2":"50","x":504,"y":228,"wires":[]},{"id":"bad10f38.5851e8","type":"ui_chart","z":"deb0d57.1c46528","name":"","group":"495b4c5.d18e334","order":2,"width":"8","height":"7","label":"Grafiek light","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1F77B4","#CCCCCC","#CCCCCC","#CCCCCC","#CCCCCC","#CCCCCC","#CCCCCC","#CCCCCC","#CCCCCC"],"useOldStyle":false,"outputs":1,"x":522,"y":180,"wires":[[]]},{"id":"495b4c5.d18e334","type":"ui_group","z":"","name":"Light","tab":"52d2455f.3011f4","order":2,"disp":true,"width":"8","collapse":false},{"id":"52d2455f.3011f4","type":"ui_tab","z":"","name":"Waardes plant","icon":"dashboard","disabled":false,"hidden":false}]

Step 6: Node-RED Setup: Temperature

Import the following code into your project.

[{"id":"fbad3799.f0e0e","type":"tab","label":"Temperature","disabled":false,"info":""},{"id":"b8618eb9.1c9288","type":"ibmiot in","z":"fbad3799.f0e0e","authentication":"boundService","apiKey":"","inputType":"evt","logicalInterface":"","ruleId":"","deviceId":"ESP","applicationId":"","deviceType":"ESP8266","eventType":"+","commandType":"","format":"json","name":"Get data from ESP","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":false,"allLogicalInterfaces":"","allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":145.5,"y":49,"wires":[["f76df5e8.6f6b4"]]},{"id":"f76df5e8.6f6b4","type":"function","z":"fbad3799.f0e0e","name":"temperature","func":"return {payload:msg.payload.ts.t};","outputs":1,"noerr":0,"x":361.5,"y":121,"wires":[["a7f607c7.451478","73d508e7.56d5b"]]},{"id":"a7f607c7.451478","type":"ui_gauge","z":"fbad3799.f0e0e","name":"","group":"48b7f60d.a98dc8","order":1,"width":"11","height":"5","gtype":"wave","title":"","label":"°c","format":"{{value}}","min":"-30","max":"60","colors":["#0000FF","#00B500","#CA3838"],"seg1":"10","seg2":"30","x":541.5,"y":274,"wires":[]},{"id":"73d508e7.56d5b","type":"ui_chart","z":"fbad3799.f0e0e","name":"","group":"48b7f60d.a98dc8","order":2,"width":"11","height":"7","label":"Grafiek temperature","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"-30","ymax":"60","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1F77B4","#AEC7E8","#FF7F0E","#2CA02C","#98DF8A","#D62728","#FF9896","#9467BD","#C5B0D5"],"useOldStyle":true,"outputs":1,"x":595.5,"y":207,"wires":[[]]},{"id":"48b7f60d.a98dc8","type":"ui_group","z":"","name":"Temperature","tab":"52d2455f.3011f4","order":3,"disp":true,"width":"11","collapse":false},{"id":"52d2455f.3011f4","type":"ui_tab","z":"","name":"Waardes plant","icon":"dashboard","disabled":false,"hidden":false}]

Step 7: Node-RED Setup: Humidity

Import the following code into your project.

[{"id":"144cd53b.c00473","type":"tab","label":"Humidity","disabled":false,"info":""},{"id":"d958f58b.2678e","type":"ibmiot in","z":"144cd53b.c00473","authentication":"boundService","apiKey":"","inputType":"evt","logicalInterface":"","ruleId":"","deviceId":"ESP","applicationId":"","deviceType":"ESP8266","eventType":"+","commandType":"","format":"json","name":"Get data from ESP","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":false,"allLogicalInterfaces":"","allEvents":true,"allCommands":"","allFormats":"","qos":0,"x":142,"y":87,"wires":[["547ad559.395f9c"]]},{"id":"547ad559.395f9c","type":"function","z":"144cd53b.c00473","name":"humidity","func":"return {payload:msg.payload.ts.h};","outputs":1,"noerr":0,"x":365,"y":168,"wires":[["c5821739.fa7278","7a6e10a3.399f58"]]},{"id":"c5821739.fa7278","type":"ui_chart","z":"144cd53b.c00473","name":"","group":"50dec0d1.5442c8","order":2,"width":"8","height":"7","label":"Grafiek humidity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1F77B4","#AEC7E8","#FF7F0E","#2CA02C","#98DF8A","#D62728","#FF9896","#9467BD","#C5B0D5"],"useOldStyle":false,"outputs":1,"x":571,"y":244,"wires":[[]]},{"id":"7a6e10a3.399f58","type":"ui_gauge","z":"144cd53b.c00473","name":"Gauge humidity","group":"50dec0d1.5442c8","order":1,"width":"8","height":"5","gtype":"gage","title":"","label":"%","format":"{{value}}","min":"0","max":"100","colors":["#CC8E35","#00b700","#66479A"],"seg1":"40","seg2":"60","x":566,"y":299,"wires":[]},{"id":"50dec0d1.5442c8","type":"ui_group","z":"","name":"Humidity","tab":"52d2455f.3011f4","order":4,"disp":true,"width":"8","collapse":false},{"id":"52d2455f.3011f4","type":"ui_tab","z":"","name":"Waardes plant","icon":"dashboard","disabled":false,"hidden":false}]

Step 8: Node-RED Setup: Moisture

Import the following code into your project.

[{"id":"4ee73536.ec6fc4","type":"tab","label":"Moisture","disabled":false,"info":""},{"id":"a6daac3e.2d5268","type":"ibmiot out","z":"4ee73536.ec6fc4","authentication":"boundService","apiKey":"","outputType":"cmd","deviceId":"ESP","deviceType":"ESP8266","eventCommandType":"update","format":"json","data":"msg","qos":0,"name":"Send command to ESP","service":"registered","x":804.1944580078125,"y":383.0000305175781,"wires":[]},{"id":"4134fdb7.18e9b4","type":"ibmiot in","z":"4ee73536.ec6fc4","authentication":"boundService","apiKey":"","inputType":"evt","logicalInterface":"","ruleId":"","deviceId":"ESP","applicationId":"","deviceType":"ESP8266","eventType":"update","commandType":"","format":"json","name":"Get data from ESP","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":false,"allLogicalInterfaces":"","allEvents":true,"allCommands":"","allFormats":false,"qos":0,"x":115,"y":76,"wires":[["2c2f3d20.08890a"]]},{"id":"2c2f3d20.08890a","type":"function","z":"4ee73536.ec6fc4","name":"moisture","func":"return {payload:msg.payload.ms.m};","outputs":1,"noerr":0,"x":145,"y":180,"wires":[["3de7f18b.e70a36"]]},{"id":"3de7f18b.e70a36","type":"switch","z":"4ee73536.ec6fc4","name":"Check if its moisture or not","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":165.5,"y":288,"wires":[["99721c3.db50be"],["66e9e70e.c7a988","f513e287.ae695"]]},{"id":"99721c3.db50be","type":"template","z":"4ee73536.ec6fc4","name":"Plant has enough water","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The plant has enough water!","output":"str","x":448.5,"y":62,"wires":[["54302773.52d24"]]},{"id":"66e9e70e.c7a988","type":"template","z":"4ee73536.ec6fc4","name":"Plant has not enough water","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Give the plant water!","output":"str","x":465.5,"y":133,"wires":[["54302773.52d24"]]},{"id":"54302773.52d24","type":"ui_text","z":"4ee73536.ec6fc4","group":"8849d5e.0a74c28","order":1,"width":"0","height":"0","name":"Show output ","label":"","format":"{{msg.payload}}","layout":"row-center","x":717.5,"y":56,"wires":[]},{"id":"f513e287.ae695","type":"function","z":"4ee73536.ec6fc4","name":"Check if alarm is on and format String to Json","func":"if (global.get(\"alarm\") === true){msg.payload = {\"song\":global.get(\"song\")}\nreturn msg;}","outputs":1,"noerr":0,"x":538,"y":269.25,"wires":[["5d15cf39.fa14e8"]]},{"id":"5d15cf39.fa14e8","type":"delay","z":"4ee73536.ec6fc4","name":"Check for command every 30 sec","pauseType":"rate","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":741.5,"y":176.25,"wires":[["a6daac3e.2d5268"]]},{"id":"a9c9b2ce.4a1a2","type":"ui_switch","z":"4ee73536.ec6fc4","name":"","label":"Water alarm button","tooltip":"","group":"cb9ed3a0.278608","order":1,"width":"8","height":"2","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":117.5,"y":419,"wires":[["f606d92d.bf5b9"]]},{"id":"f606d92d.bf5b9","type":"function","z":"4ee73536.ec6fc4","name":"setAlarm","func":"global.set(\"alarm\", msg.payload);","outputs":1,"noerr":0,"x":336.5,"y":360,"wires":[[]]},{"id":"4d4cae9f.372768","type":"ui_dropdown","z":"4ee73536.ec6fc4","name":"","label":"","tooltip":"","place":"Choose alarm","group":"cb9ed3a0.278608","order":1,"width":"11","height":"2","passthru":true,"options":[{"label":"Darude Sandstorm","value":"darude","type":"str"},{"label":"StarWars Theme","value":"starwars","type":"str"},{"label":"Frère Jaqcues","value":"jacques","type":"str"},{"label":"Wave","value":"wave","type":"str"},{"label":"Shooting Star","value":"shootingstar","type":"str"}],"payload":"","topic":"","x":92.5,"y":488,"wires":[["6bc9b596.b9c5fc"]]},{"id":"6bc9b596.b9c5fc","type":"function","z":"4ee73536.ec6fc4","name":"setSong","func":"global.set(\"song\",msg.payload);","outputs":1,"noerr":0,"x":349.5,"y":429,"wires":[[]]},{"id":"10065ff5.f1d3c","type":"ui_button","z":"4ee73536.ec6fc4","name":"","group":"cb9ed3a0.278608","order":1,"width":"8","height":"2","passthru":false,"label":"Play song button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":106.5,"y":563,"wires":[["c2234a84.9ad6e"]]},{"id":"b12d1be0.58d208","type":"function","z":"4ee73536.ec6fc4","name":"Format String to Json","func":"msg.payload = {\"song\":global.get(\"song\")};\nreturn msg;","outputs":1,"noerr":0,"x":550.5,"y":453,"wires":[["a6daac3e.2d5268"]]},{"id":"c2234a84.9ad6e","type":"delay","z":"4ee73536.ec6fc4","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"7","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":322.5,"y":514,"wires":[["b12d1be0.58d208"]]},{"id":"8849d5e.0a74c28","type":"ui_group","z":"","name":"Moisture","tab":"52d2455f.3011f4","order":1,"disp":false,"width":"27","collapse":false},{"id":"cb9ed3a0.278608","type":"ui_group","z":"","name":"Footer","tab":"52d2455f.3011f4","order":5,"disp":false,"width":"27","collapse":false},{"id":"52d2455f.3011f4","type":"ui_tab","z":"","name":"Waardes plant","icon":"dashboard","disabled":false,"hidden":false}]

Step 9: You Are Done!

Congratulations! you now have a working plant observation system.

If you have any question, don't hesitate to contact us!

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    Discussions

    None
    audreyobscura

    6 months ago

    Thanks for sharing your circuit and results!