Envolysis

25,720

118

56

Published

Introduction: Envolysis

About: Please support and share our mission; the Plant Doctor is a non-profit, open source online research laboratory specializing in electronics+plants. Our vision is to bring together nature and technology in a s...

hello everybody,

please suppport & share our mission;igg.me/at/smartplants

envloysis is an online updating environment analysis "bug". this tiny mobile device connects to the WiFi network and uploads sensor data to the cloud and graphs your data, also tweets you when something is wrong. it is also solder free to build. no prior electrical/programming experience is required. cost is ~17$

.

it can be built with raw analog sensors such as, LDR photocell (light sensor), NTC thermisor (temperature), soil probes (plant water level), humidity sensor, flame module etc. basically anything that you can connect to a microcontroller. you can create almost anything wifi using these simple components; a door alarm, a sun tracker, thermometer, possibilities are endless.

.

I work at a restaurant. We have 6 fridges and 1 large freezer. the owner of the business asked me if it was possible to record/upload sensor data. this is where the idea came about. it is still in progress and open for upgrades (especially battery), but we can now collect data that we've never seen before.

.

envolysis can be used as a simple cost-analysis device for restaurants and other business alike, or for anyone who wishes to monitor their home wirelessly. - i am also developing this system for plant monitoring.

Step 1: Parts

wifi module ( also need a UART to set up the wifi module for first time use )

microcontroller

breadboard

battery clip

sensors (water, light, temperature, humidity, fire... )

resistors

cables

Step 2: Thingspeak Setup

1. go to https://thingspeak.com/users/sign_up & fill out the form to create an account

2. once the account is created, the page will change to your channels, click "new channel"

3. change the channel name and type in the fields that you want to record (temperature, light, humidity etc.) - save channel

4. click to "API Keys" tab and copy your write API key, this will be inserted into the code.

-

we are now ready to upload and capture data to our online channel where it will be graphed automatically and can be downloaded later on in excel format.

-

after you have created your channel you can also set e-mail alerts where the web page will automatically tweet "alarms"

-

5. go to https://twitter.com/ and create an account

6. go to https://thingspeak.com/apps/reacts and create a "new react"

7. name your react and change the alarm values, choose thing tweet as your action and add a twitter account (link your accounts). condition type: numeric, test frequency: on data insertion etc.. for more help: https://thingspeak.com/docs/thingtweet

8. once your react is saved and your twitter account is linked everything should be working, and you should be getting the alarms on your twitter channel/phone.

Step 3: Set Up Wifi + Upload Code

the wifi module is very simple to set up, even for a true beginner like me. there are many great articles on this module and how to set it up. I will let other great authors do the explaining on how to do this step. please ask me any specific question you may run into.

1. https://www.instructables.com/id/ESP8266-mini-Tutor...

2. https://www.instructables.com/howto/ESP8266/

3. wikipedia

.

wifi module schematics;

GND on wifi to > GND on arduino

RX on wifi to > TX on arduino

TX on wifi to > RX on arduino

CH_PD on wifi to > 3V3 on arduino

VCC on wifi to > 3V3 on arduino

.

upload code;

download the code first;

-single sensor code: https://drive.google.com/file/d/0B8bvYGugxvFFR0JPU...

-multiple sensors code: https://drive.google.com/file/d/0B8bvYGugxvFFMjk4Q...

now connect your microcontroller to the computer and launch the arduino software.

before uploading;

make sure to change your wifi name (SSID) and password (PASS) in the code, as well as thingspeak write API key.

also make sure that the wifi module is not connected to 3V3 while uploading the code to arduino. otherwise it will not upload.

Step 4: Add the Sensors + Battery

choose your sensor(s) first

I will be using light & temperature sensors for demonstration. light sensor gets a 10k ohm resistor and the temperature sensor gets a 10ohm resistor. match the resistor color codes.

.

single sensor connection;

connect either leg of the sensor to 3V3

connect the other leg of the sensor to A0

connect either leg of the corresponding resistor to A0

connect the other leg of the resistor to GND

.

multiple sensors connection;

same as the single setup, just add the next sensor to 3V3 and A1/A2/A3... etc

resistors will connect the same way again, one leg to A1/A2/A3 and the other to GND

.

battery 9V;

positive (+) of battery to > Vin on arduino

negative (-) of battery to > GND on arduino

Step 5: Conclusion

you can seal your device in many different things. I chose to use tupperware. a more durable and air-seal kind would also be more protected.

.

this device runs on a 9V battery. you can use other options such as rechargable li-ion. you can also run it on AC with an adapter, look at custom arduino parts for more information. i am currently working on a lithium-ion rechargeable battery pack. which should provide a much better mobile lifetime, i will update this post once complete.

.

make sure to check out my plant care instruments. I will be installing a similar system inside of plant pots and other devices.

.

i have to thank author diy_bloke for his help with the code (please visit his profile and check out his posts!). it was him who adjusted the code to accept regular sensors instead of modules. with his help now we can make such a device for a very low cost. also with his help i was finally able to get my smart pot system online as well.!

.

thank you so much for your time, please ask any questions in the comments below.

remember to subscribe for updates

love & peace,

akin

Step 6: Updates

finally got the ESP chip to work by itself, no arduino. programming the chip directly. you can connect upto 3 sensors this way :)

check these out

1. https://www.instructables.com/id/Low-cost-WIFI-temp...

2. http://homes-smart.ru/index.php/oborudovanie/bez-p...

.

i am currently testing battery life and working on a 3D printed magnetic case.

Share

    Recommendations

    • Creative Misuse Contest

      Creative Misuse Contest
    • Oil Contest

      Oil Contest
    • Water Contest

      Water Contest

    56 Discussions

    Hi there I'm trying to connect to my send the data to my database from Arduino+esp8266+DHT22 with PHP code.. but for some reason I cant make it to the database... I only get this code to my Serial monitor:

    AT

    AT+CIPSTART="TCP","188.121.46.6",80

    GET /advertacs/test/chart/add_data.php?&s1=23.00&s2=27.00&s3=0.00&s4=0.00&s5=0.00&s6=0.00&s7=0.00&s8=0.00&s9=0.00&s10=0.00&s11=47.45&s12=47.45

    AT+CIPSEND=144

    AT+CIPCLOSE

    AT+CIPSTART="TCP","188.121.46.6",80

    GET /advertacs/test/chart/add_data.php?&s1=23.00&s2=27.00&s3=0.00&s4=0.00&s5=0.00&s6=0.00&s7=0.00&s8=0.00&s9=0.00&s10=0.00&s11=69.12&s12=69.12

    AT+CIPSEND=144

    AT+CIPCLOSE

    ----------------

    Arduino Code:

    http://188.121.46.6/advertacs/test/chart/arduino_c...

    PHP code:

    http://188.121.46.6/advertacs/test/chart/add_data....

    Conection Setup:

    http://188.121.46.6/advertacs/test/chart/pic.jpg

    5 replies

    Ah I found out what it was. I wasn't sending AT+CIPSEND so I re-wrote it.

    val = analogRead(ANTENNA); // read the ANTENNA
    String T = String(val);
    mySerial.println("AT+CIPSTART=\"TCP\",\"184.106.153.149\",80");
    delay(2000);
    String cmd = GET + "&field1=" + T +"\r\n";
    mySerial.print("AT+CIPSEND=");
    mySerial.println( cmd.length() );

    It works great on the Uno as Serial returns

    AT+CIPSTART=45

    then follows up with successfully sending the GET command.

    However, THE SAME EXACT CODE on the ATTINY85 returns:

    AT+CIPSTART=2
    8

    and Errors out an I get a return 400 page in the Serial. So I believe its how ATTINY85 handles cmd.length()

    hello, i am wokring on a smiliar project i am trying to send my water sensor data to thingspeak and then resend it as an SMS to my phone, however i am stuck at the coding, i don't know what is going on actually, some advised to put an external power to my esp8266,but i didn't buy it as my esp8266 respond to commands normally when linked to the arduino.
    this is my code:
    #include <SoftwareSerial.h>

    int sensor_water = A0;

    int value_water;

    #define DEBUG FALSE //comment out to remove debug msgs

    //*-- Hardware Serial

    #define _baudrate 115200

    //*-- Software Serial

    //

    #define _rxpin 2

    #define _txpin 3

    SoftwareSerial debug( _rxpin, _txpin ); // RX, TX

    //*-- IoT Information

    #define SSID "waterfirst"

    #define PASS "waterfirst"

    #define IP "184.106.153.149" // ThingSpeak IP Address: 184.106.153.149

    // GET /update?key=[THINGSPEAK_KEY]&field1=[data 1]&field2=[data 2]...;

    String GET = "GET /update?key=MYKEY";

    void setup() {

    Serial.begin( _baudrate );

    debug.begin( _baudrate );

    sendDebug("AT");

    delay(5000);

    if(Serial.find("OK"))

    {

    debug.println("RECEIVED: OK\nData ready to sent!");

    connectWiFi();

    }

    }

    void loop() {

    value_water = analogRead(sensor_water);

    String water =String(value_water);// turn integer to string

    updateTS(water);

    delay(3000); //

    }

    //----- update the Thingspeak string with 1 value

    void updateTS( String W)

    {

    // ESP8266 Client

    String cmd = "AT+CIPSTART=\"TCP\",\"";// Setup TCP connection

    cmd += IP;

    cmd += "\",80";

    sendDebug(cmd);

    delay(2000);

    if( Serial.find( "Error" ) )

    {

    debug.print( "RECEIVED: Error\nExit1" );

    return;

    }

    cmd = GET + "&field1=" + W +"\r\n";

    Serial.print( "AT+CIPSEND=" );

    Serial.println( cmd.length() );

    if(Serial.find( ">" ) )

    {

    debug.print(">");

    debug.print(cmd);

    Serial.print(cmd);

    }

    else

    {

    sendDebug( "AT+CIPCLOSE" );//close TCP connection

    }

    if( Serial.find("OK") )

    {

    debug.println( "RECEIVED: OK" );

    }

    else

    {

    debug.println( "RECEIVED: Error\nExit2" );

    }

    }

    void sendDebug(String cmd)

    {

    debug.print("SEND: ");

    debug.println(cmd);

    Serial.println(cmd);

    }

    boolean connectWiFi()

    {

    Serial.println("AT+CWMODE=1");//WiFi STA mode - if '3' it is both client and AP

    delay(2000);

    //Connect to Router with AT+CWJAP="SSID","Password";

    // Check if connected with AT+CWJAP?

    String cmd="AT+CWJAP=\""; // Join accespoint

    cmd+=SSID;

    cmd+="\",\"";

    cmd+=PASS;

    cmd+="\"";

    sendDebug(cmd);

    delay(5000);

    if(Serial.find("OK"))

    {

    debug.println("RECEIVED: OK");

    return true;

    }

    else

    {

    debug.println("RECEIVED: Error");

    return false;

    }

    cmd = "AT+CIPMUX=0";// Set Single connection

    sendDebug( cmd );

    if( Serial.find( "Error") )

    {

    debug.print( "RECEIVED: Error" );

    return false;

    }

    }

    but i just keep reciving this message:
    AT

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    AT+CIPSTART="TCP","184.106.153.149",80

    AT+CIPSEND=45

    AT+CIPCLOSE

    Hi Akin,

    I have a question.

    First off I wanted to thank you for these brilliant tutorials. I've been tinkering with arduino for a while and I've built a few things... I love the fact that you used this for plant monitoring, and I'm pretty much trying to do the same thing. But since I travel I'd like to automate it a bit more!

    I'd like to measure temperature, air humidity and soil moisture, and a few other things, but I'd also like to connect a water pump and a full spectrum led that I can turn on and off by my needs.

    Now I know that this isn't possible with just the ESP8266 because it doesn't have any pwm port, but is this possible with say, an Arduino Nano or Uno? Can I read all this data and command the lights and watering as well?

    I haven't found any real answer on the internet because all the ESP8266 projects are fairly simple and monitor just one thing. Could you give me the answer?

    Thanks in advance,

    Michele.

    10 replies

    hello Michele,

    ESP by itself is very flaky that is why all my projects have been updated to the nodemcu board; http://www.ebay.com/itm/NodeMCU-V3-Newest-Lua-WIFI...

    it's just $5 and can do all that you have mentioned. you just need relay modules to control the AC outlets (pump + water); http://www.ebay.com/itm/1pcs-5V-2-Channel-Relay-Mo...

    and a good power source, minimum 5V 2A; http://www.ebay.com/itm/2A-Fast-Charging-Wall-Char...

    it is very simple to put together and cost is around $20. the suggested nodemcu board has pwm outputs but in your case you actually don't need to use this function. just need relays

    Hi and thank you for your explanation! So, do you mean I just need a NodeMCU v3 instead of an Arduino+ESP8266?

    exactly, here is all you need. this device can check for soil moisture, temp & humidity, and light levels. based on this data it can then control 2 AC outlets automatically. or manually over wifi anywhere in the world from blynk app, all free open source.

    .
    it can also alert you with the onboard RGB LED using color, in case you don't have your phone around. below is the wiring, the code will be available soon as well, but it's all very simple.

    Screenshot_2016-02-17-12-29-39.pngnodemcu_plantdoctor.png

    Wow! Thank you for the amazing answers, you cleared a lot of things I would've had to google for elsewise...

    One last question: Do you program it with Arduino IDE or with NodeCMU firmware? Is it necessary to flash/update the firmware?

    Sorry for making you crazy!

    here you go, until I make a detailed instructable, this is the rough sketch.
    it goes with the wiring above. it can email you when sensor values are below/above user set range (line 49 for example). it can also turn on/off 2 AC outlets based on the data.

    You are truly a lifesaver! One final, last question: I still have 2 ESP8266 modules laying around, if I want to use them for more simple uses, how do I program it using arduino IDE? Same as before? I mean, install a driver --> get arduino ide ready for esp8266 module?

    it's a little more complicated than that. first of all you need a usb UART programming module, if you don't already have one. and then you also need to learn about how to put esp into bootloader mode (changes based on which model esp you have). and also you have to make sure that it is connected to exactly 3.3V and minimum 500mA dc power source.
    .
    you do still have to follow the below initial steps. if you succeed with esp-12 you can actually do the exact same connection above without the need of a nodemcu board. but speaking from personal experience, if you are relying on this device to automate your greenhouse, you should definitely use nodemcu because it has a lot of internal protection and voltage adjustments. its also plug and play without the usb UART programming module. it comes breadboard ready and has all the pins easily laid out.. for only $2 more than a regular esp. it's the best board out there right now hands down.

    .

    which esp do you have, 01 or 12.?

    Oh yeah well I agree with you on everthing you said, in fact for the plant monitor I am planning to make by your great suggestion I already ordered a NodeMCU v3 and also ordered the relays. The sensors and RGB I already had. I want something reliable and not very flaky like you said... The cost is just a few $ difference, so I don't see any reason not to get it for all the bonus features you already said...

    Btw I have ESP-01 and I already have a voltage converter because I'm aware of the 3v3 it needs and the high mAh it draws, I also have a USB RS232 to TTL adapter to load the programs onto the ESP. I just wanted to tinker around with the software code and see how it works before I move on to the NodeMCU with the plant monitor. Does the NodeMCU still draw so much current or has it been improved?

    Thanks again, you've helped me clear up a lot of doubts as I'm a Software Engineer and some parts of all these tutorials are very obvious to me, while the Electronics parts are a bit less clear since my knowledge base is a bit lacking.

    sounds like you have everything you need to make away with the 01s.

    read this to get going; http://www.allaboutcircuits.com/projects/breadboar...

    .

    below is a solar powered digital sensor using esp01. it can only do digital sensors. no analog read function on esp01 unfortunately. which is another plus that nodemcu has onboard. i do need help in software. hope you can update the sketch in the future.
    .
    2x http://www.ebay.com/itm/5V-500MA-2-5W-Mini-Solar-P...

    1x http://www.ebay.com/itm/Auto-DC-DC-Boost-Buck-Conv...

    1x esp01

    1x relay

    1x zener diode
    .
    this device will automatically come to life when there is enough light and can check for temp & humid and also control a single AC outlet as esp01 has only 2 pins to play with. you can add a powerbank and keep it alive forever too

    solar connection.png

    my pleasure. you program it just like an arduino, using arduino IDE. no flashes or updates, all that is in the past now with the nodemcu board.
    .
    there are a few initial steps to follow however,
    1. install cp2102 driver; https://www.silabs.com/products/mcu/Pages/USBtoUAR...

    2. get arduino IDE ready for nodemcu; https://www.instructables.com/id/Quick-Start-to-Nod...

    .

    once you complete these first time steps, it will be plug & play forever. i will update the code and let you know here soon. you can then copy & paste, it will work right away
    3. you can learn about blynk phone app here, which the updated code will include; https://www.instructables.com/id/ESP8266-12-blynk-w...

    Hello Akin, is there a way of accessing these sent data on a Local Area Network web server? Cause I'm planning to install a project like this on my small farm but the Internet is not accessible there.

    2 replies