IoT Water Control and Monitor Using NodeMCU & Cayenne

9,555

37

5

I'll try to create IoT water control and can be monitoring using Cayenne.

The valve will close when water reached top level of the sensor.

This project is to ensure that water reservoir always in full condition, because in my location the water supply only flow when midnight, but if midnight we are not need water.

Step 1: Bill of Materials

Hardware Required :

1. NodeMCU ESP-12E

2. Liquid Level Sensor (calibrate first to get top level value and bottom level)

If you need more deep sensor, you can cut the top strip of sensor and take some wire to two side of sensor

3. 1 CH Relay Module

4. 12V Solenoid Valve

5. 12V 2A Power Supply

6. Jumper Cable

Software Required :

1. Arduino IDE

2. Cayenne for iOS/Android/Web Browser

Step 2: Connecting NodeMCU to Liquid Sensor, Relay Module, and Valve

NodeMCU_______Sensor__________Relay

VIN_____________ Not connected____VCC (+)

3.3V____________ +_______________Not connected

GND____________-________________GND

A0______________S_______________Not connected

D5______________Not connected____ Not connected

Relay___________Solenoid__________Power Supply

NO_____________Not connected______+

Center PIN_______+________________ Not connected

Not connected____- ________________ -

Step 3: Upload Code to NodeMCU

In this step we will program the NodeMCU with Arduino IDE.

You need to open WATER_CONTROL.ino, edit your Cayenne token, SSID, password, edit top level and bottom value and then connect your NodeMCU with USB Cable to your computer and upload the code to NodeMCU.

Now your NodeMCU is online.

Step 4: Setting Up Cayenne

Do this step on Cayenne :

  • Add Valve Switch widget from Cayenne Dashboard, and select Virtual Pin 1.
  • Add Analog Sensor widget from Cayenne Dashboard, and name it to Water Level, select Virtual Pin 10, Unit Percentage
  • Add triggers and set if water level above 100 % then valve switch turn off.
  • Add triggers and set if water level below 100% then valve switch turn on.

Share

    Recommendations

    • Big and Small Contest

      Big and Small Contest
    • Toys Contest

      Toys Contest
    • PCB Contest

      PCB Contest

    5 Discussions

    0
    None
    IntanN12

    6 months ago

    Hi, can i replace 12V power supply to 4V battery?

    0
    None
    irfanh22

    Question 9 months ago

    Can you show me the schema of relay, solenoid, and the power ? I dont understand the table

    0
    None
    Rsharma93

    11 months ago

    hello . great project. my cayenne is unable to detect my device. and btw, where would i get my Cayenne token for this ?

    0
    None
    JuniorC24

    1 year ago

    Can you show schema ?

    i'm interest

    0
    None

    This is pretty cool. I hadn't heard about the Cayenne system until recently. I am going to have to check it out.