IoT Water Control and Monitor Using NodeMCU & Cayenne

by Kuncono in Circuits > Microcontrollers

18265 Views, 38 Favorites, 0 Comments

IoT Water Control and Monitor Using NodeMCU & Cayenne

IMG_1093.JPG

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.

Bill of Materials

113990105 1.jpg
03_86.jpg
relay_brd.jpg
2405752_8a01db5c-febc-42a6-9ea1-72f5fae2ebea.jpg
HTB1EsmbLXXXXXbwXpXXq6xXFXXX0.jpg
FGFQB07HX7P7I3J.MEDIUM.jpg

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

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____- ________________ -

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.

Downloads

Setting Up Cayenne

valve dashboard.JPG
valve setting.JPG
valve trigger.JPG
water-widget.JPG

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.