Sprinkler system controlled by phone with Arduino

Hi all,

I am (still) a beginner using the Arduino and I hope somebody can help my with my project for using a controlled sprinkler system in my garden.

The case what I trying to build:
I want to control from inside the house my sprinkler system by phone. For example, at the end of the day (05:00 PM) I want to turn ON my sprinkler system, I give this information to my phone and the system goed ON. At the end of the night (10:00 PM) I want the system turns OFF, I give this information to my phone and the system turns OFF.

What I have done at the moment:
I have made a test using a light turning ON and OFF (see video --> Arduino test with light - YouTube).
Now I am looking for an app(?) for my phone to control this system. Besides, I think I need to modify my Arduino code a bit in future for the sprinkler system. Hopefully someone can advice me in this case :).

I hope the description is clear, please let me know if additional information is needed.

Ciao,

Luuk

Sprinkler_system_test.ino (390 Bytes)

Your arduino has GSM? or WiFi? or ...

Haha you mean Bluetooth?

But with Bluetooth, should you connect to the Arduino everyday?

BT is another pestilence. If you have a ESP8266 or ESP32, you don't need an app, just implement a webserver and connect to your accesspoint. But it looks like you have an uno without anything, so how do you intend to connect it with the phone?

This just seems like an intellectual exercise for no real purpose. If that is what you want, you could just put a clock like a ds3231 on Arduino, and it will do that by itself - no phone app required. The youtube is meaningless but, if you can turn a light on and off, the same code will work with a sprinkler. Having said that, using the phone to change the timing is a more legitimate Arduino exercise.

IF you used the keyboard to control the light, you can control it from the phone via Bluetooth as mentioned in reply #2. It will cost you about $3 to do that, no change in your Arduino code required. Nothing more than a plain vanilla terminal is required on the phone. The Uno you already have would be fine for this purpose.

Nick_Pyner:
This just seems like an intellectual exercise for no real purpose. If that is what you want, you could just put a clock like a ds3231 on Arduino, and it will do that by itself - no phone app required. The youtube is meaningless but, if you can turn a light on and off, the same code will work with a sprinkler. Having said that, using the phone to change the timing is a more legitimate Arduino exercise.

IF you used the keyboard to control the light, you can control it from the phone via Bluetooth as mentioned in reply #2. It will cost you about $3 to do that, no change in your Arduino code required. Nothing more than a plain vanilla terminal is required on the phone. The Uno you already have would be fine for this purpose.

This project is for real purpose. Thank you for the information. I am going to buy a ESP8266 and try to find the solution I want to have.

By having this information, should I need to use a powerbank whether provides the 5V for the Arduino?

luukos97:
should I need to use a powerbank whether provides the 5V for the Arduino?

If you use an ESP8266 in the job as you describe it, you don't need an Arduino. A 5v powerbank is hardly a good idea for this sort of job but should be just fine to prove the point in an intellectual exercise. I understand ESP8266 is not particularly frugal with power. Uno's aren't either.

Nick_Pyner:
If you use an ESP8266 in the job as you describe it, you don't need an Arduino. A 5v powerbank is hardly a good idea for this sort of job but should be just fine to prove the point in an intellectual exercise. I understand ESP8266 is not particularly frugal with power. Uno's aren't either.

Hmm okay. I have ordered a ESP8266-01, I will do some more homework on this part, I am not familiar with it yet.

Thanks for the explanation.

So I did some research on the ESP8266, but (but my knowledge) it is quit hard to understand it in main lines...

Some question marks for me are:

  1. How can you run this ESP8266 without Arduino?
  2. If I am not going to use an Arduino board, how can I convert the 5v to 3.3v?

Currently I have build a simulation in Fritzing (see image), the LCD screen is for later purpose. Am I correct when I say that I can use pin 7 in the Arduino code to turn ON and OFF the sprinkler system, and the next step is to combine this with the ESP8266 Wifi controller?

https://ibb.co/SNbgW5y

*The image link wasn't working, a link is used instead

Sprinkler_system_test.ino (390 Bytes)

Get a Wemos D1 and read the docs. Install ESP8266 board using Arduino IDE board manager.

luukos97:
Some question marks for me are:

  1. How can you run this ESP8266 without Arduino?
  2. If I am not going to use an Arduino board, how can I convert the 5v to 3.3v?
    I can use pin 7 in the Arduino code to turn ON and OFF the sprinkler system, and the next step is to combine this with the ESP8266 Wifi controller?

Notes on ESP8266

What you may find difficult to research is running an ESP off an Arduino. This is because it is generally a pointless exercise. ESPs are cheaper, faster, and have more memory than Arduino so, if you want WiFi, you look at them first and forget Arduino.

  1. ESP8266 has its own intelligence and can be programmed with the Arduino IDE. The item in your picture looks like an ESP-01, which should do the job just fine by itself. It has two regular i/o ports, which is one more than you need. It may also be used as serial>WiFi module with an Arduino.

  2. I don't think it is OK to run an ESP off Arduino's 3.3v as you imply. You need a good 3.3v source, like perhaps an 18650. There is plenty of information on this round here but I don't know much about it, as I use a NodeMCU, which I only run on 5v from USB like a Uno.

ANY vacant pin can be used to drive the relay.

Nick_Pyner:
Notes on ESP8266

What you may find difficult to research is running an ESP off an Arduino. This is because it is generally a pointless exercise. ESPs are cheaper, faster, and have more memory than Arduino so, if you want WiFi, you look at them first and forget Arduino.

  1. ESP8266 has its own intelligence and can be programmed with the Arduino IDE. The item in your picture looks like an ESP-01, which should do the job just fine by itself. It has two regular i/o ports, which is one more than you need. It may also be used as serial>WiFi module with an Arduino.

  2. I don't think it is OK to run an ESP off Arduino's 3.3v as you imply. You need a good 3.3v source, like perhaps an 18650. There is plenty of information on this round here but I don't know much about it, as I use a NodeMCU, which I only run on 5v from USB like a Uno.

ANY vacant pin can be used to drive the relay.

Hi Nick,

Thanks for this reply, very clear to me. I have ordered an ESP-8266-01 and a Wemos. When it arrives I am going to build and test the things (at least I will try). As well, I will search to a 18650 as you mention for the source of the power.

Thanks again. I will post the updates asap.

Update:

Hello,

So finally the parts have arrived and I could go on with this project :slight_smile: . I have made a new circuit with a Wemos D1 mini and a relay (see Fritzing picture). I haven't connect this system to the power supply because I am reservedly for short circuit the system by adding 230V. For adding power to the Wemos, I want to use a adapter with micro USB cable which I can plug into the 230V network.

Would this system work with 230V? Or should I modify a bit before adding the 230V to the system?

Fritzing picture: https://ibb.co/LkdB76f
BLYNK button: https://ibb.co/CtfBrrm
Arduino/BLYNK code see attached

Thanks

Sprinkler_system_v3_BLYNK.ino (2.76 KB)

Might work, just try it.

IF the relay is made to switch 240v, that should be clearly written on it. If it is, it should do what it is supposed to do. Arduino is totally uninvolved with the 240v, it just sees a relay coil.

I have tested it, and it works besides some adjusments in the Blynk app :).

Thanks for the help!

Maybe I will ask some more questions in future, I will going to make more project like this. I am starting to like Arduino and Electric.