1.Introduction
While some areas are more prone to flooding than others, the establishment of flood warning systems near any major waterway or body of water provides critical information that can protect property and save lives.
If even small areas which are prone to flood or sensitive areas, it could be a small idea to get notified if there is a flood or excessive/set water flow.. If you go out, get a message from your alert device that you need to rush back to your area & save/protect that you wish for :-)
The goal of this project was to develop some form of a communication line between house and myself to notify me that something's wrong.
In order to maximize efficiency, I created this project with these points in mind:
1) Some sort of ultra-fast connection via SMS, and for its service to be free.
2) Once the excessive level reaches, the Arduino sketch should easily connect to the Internet with W5100S-Evb-Pico.
Product: Water sensor that can quickly notify through text if floods at home occurs by connecting to the internet via Wiznet's W5100S-Evb-Pico.
2.Hardware
Wiznet's W5100S-Evb-Pico.
W5100S-EVB-Pico is a microcontroller evaluation board based on the Raspberry Pi RP2040 and fully hardwired TCP/IP controller W5100S – and basically works the same as Raspberry Pi Pico board but with additional Ethernet via W5100S.
- Raspberry Pi Pico Clone
- Ethernet (W5100S Hardwired TCP/IP CHIP)
- AWS IoT Core Qualified
- Microsoft Azure Certified
Sensor
This water level sensor module has a series of parallel exposed traces to measure droplets/water volume in order to determine the water level. Very Easy to monitor water level as the output to analog signal is directly proportional to the water level. This output analog values can be directly read via ADC and can also be connected directly Arduino's/W5100s EVb pico's analog input pins.
The working of the water level sensor is pretty straightforward.
The series of exposed parallel conductors, together acts as a variable resistor (just like a potentiometer) whose resistance varies according to the water level.
The change in resistance corresponds to the distance from the top of the sensor to the surface of the water.
Hardware connection
The water level sensor is super easy to use and only has 3 pins to connect.
S (Signal) pin is an analog output that will be connected to one of the analog inputs on your Arduino.
+ (VCC) pin supplies power for the sensor. It is recommended to power the sensor with between 3.3V – 5V. Please note that the analog output will vary depending on what voltage is provided for the sensor.
– (GND) is a ground connection.
First you need to supply power to the sensor. For that you can connect the + (VCC) pin on the module to 3V3 on the Board and – (GND) pin to ground
Finally, connect the S (Signal) pin to the ADC0 pin on your W5100S EVB Pico.
Working with Arduino IDE:
The W5100S-EVB-Pico has the same role as the Raspberry Pi Pico platform and includes W5100S, so the Ethernet function is basically included.
It is easy to use an Arduino IDE with W5100S-EVB-Pico.
The W5100S-EVB-Pico is a microcontroller evaluation board based on the Raspberry Pi RP2040 microcontroller chip and a full hardwired TCP/IP controller W5100S chip.
Please refer Arduino Raspberry Pi Pico/RP2040 Ethernet : W5100S-EVB-Pico to set your arduino ide environment to operate W5100S-Evb-Pico.
SMS
There are many ways to approach sending an SMS from an Arduino using the Internet. However, the easiest method is to split the job between Arduino and an online service like ThingSpeak which passes the SMS request to a second service Twilio. The latter integrates the Internet with the telephony infrastructure.
Setup needed:Online services setup:
Sending SMS from W5100s-EVB-pico over the internet using Thingspeak and Twilio:
A Twilio account. Register at https://www.twilio.com/try-twilio. After signing up, verify your number
Verify SMS/notification receiver number (To number)
Get Trial Number (From number)
To send an SMS, you will need a phone number from Twilio. On your trial account You can get one free phone number.
A Thingspeak account. Register at IoT Analytics - ThingSpeak Internet of Thingsafter login configure ThingHTTP service, as shown in below image
Apps -> ThingHTTP
- Apps -> ThingHTTPGo to Thingspeak.com, click on apps, then ThingHTTP, and then New ThingHTTP. This will take you to the setup page. You will have to find your Twilio account SID and auth token on your Twilio dashboard page
Copy the following data into the fields. Where italics and caps you must replace with the data from Twilio.
- Name it Twilio Send SMS
- URL is https://api.twilio.com/2010-04-01/Accounts/YOUR TWILIO ACCOUNT SID/SMS/Messages
- HTTP Auth Username is YOUR TWILIO ACCOUNT SID
- HTTP Auth Password is YOUR TWILIO AUTH TOKEN
- Set the method to POST
- Content type is application/x-www-form-urlencoded
- Click remove headers, and leave host blank
- Body format: From=YOUR TWILIO NUMBER&To=%%number%%&Body=%%message%%
Click Save ThingHTTP
Take note of the API key for your ThingHTTP. You will need it in the Arduino sketch
Add Twilio account info as shown below. Where caps replace the data from Twilio.
Click Save ThingHTTP
Take note of the API key for your ThingHTTP. It is needed at W5100s-EVB-Pico sketch
Testing Thingspeak URL on browser
Working URL:
https://api.thingspeak.com/apps/thinghttp/send_request?api_key=GYHM9JCY7SMIHVOQ&number=<your Mobile Number>&message='my Basement is flooded'
Notification received 📷
A Twilio account. Register at https://www.twilio.com/try-twilio.After signing up, verify the Twilio number.
A Thingspeak account. Register at https://thingspeak.com/users/sign_up
The TS account must point to the Twilio account.
Working with actual setup:
Comments
Please log in or sign up to comment.