In this lesson, we’ll learn how to read the water sensor remotely through Cayenne IOT platform. Water sensor module is an Analog sensor. When reading Analog devices with the Arduino microcontroller, the Arduino’s built in analog to digital converter (ADC) will be used to read the water sensor data then send to virtual Pin. Then you can read the data remotely from web browser or smart home through Cayenne IOT platform.
2 Hardware connection
|UNO R3 Board||1|
|Ethernet Shield W5100||1|
|Water detector sensor module||1|
3 Hardware connection
Connect the water sensor module with UNO as following diagram.
|UNO Board||water sensor module|
4 Add new device
Log in Cayenne IOT platfrom, Add new…->Device/Widget
Choose : Sensors->”Generic”
click Analog Input, setting the datasheet as followed:
Please Note: If V0 pin was used by other widgets, you can select other pins. and change the VIRTUAL PIN in
sketch to the pin number you have selected.
In your dashboad click”Step 1:Sketch File”, the sample sketch will be displayed, in this example,we creat a new sketch, please download fromhttp://osoyoo.com/driver/waterlevel_sensor.txt
Copy and paste the sketch into Arduino IDE ,please remember to use your own authentication token. Upload to your Uno board, then click “Setp 2 :Add Sensor”, you will find the water level sensors was added on your dashboad:
When you put down the water sensor into water, the value will become higher. while put in dry environment, the value will become lower. with this DIY Project, now you can monitor if water leak in you house remotely from your smart phone no matter where you are.