Time input widget to switch digital pins

Thank you for the feedback. The reason for using a mega with the nodemcu is because I need to switch about 21 digital pins. I just do not know how to. I am new to all this but this is something that is important for me to get it working.

1 Like

Does your father’s garden cover half of Florida?

21 pins?

1 Like

:smile: not that big. There are 18 solenoid valves and 3 pumps

Sounds like 3 ESP’s using Bridge to me :slight_smile:

Do you have the “Mega” system set up or is it all at the planning stage?

ESP’s are so much easier to work with for iOT jobs.

1 Like

I must agree with you. The esp’s(nodemcu) is nice to work with. If i can get the time input widgets to switch digital pins then it would be nice.

If you only need simple manipulation of pins (on/off). You could also use the eventor widget or the timer widget.

Thank you for the info. Need to be able to set different times for different channels. By channels I mean that the time input widget shoud switch a relay pin.

You didn’t say if you are the planning stage or of you have the hardware set up.

Code exists on this site to do what you want to do.

With the basic Timer widget you can have dozens of Timers for different channels and then it’s a simple digitalWrite. Do you have Arduino coding experience?

The only drawback I see using the eventor or timer widgets is if you plan on sharing the project with others (which it sounds like you plan on doing). With the timer/eventor widget, once the project is shared, the times cannot be edited by the person whom the project was shared with (may be an advantage in some cases). They also do not have sunrise/sunset features.

I have not used the time input widget, but it looks as if it allows the user to change the times with the project running. This may be more handy when sharing the project, as it allows the end user to determine when would be the best time to do a certain task. Although, I am not sure how it would work when one user of the shared project changes the time. I would think it would change the time setting on all of the shared projects all at once.

@Toro_Blanco the OP should clone the project for his father rather than share it, so all features will be available.

If I was going to do something like this for my father, I would probably share it, rather than clone. I can just picture my dad pressing the stop button and changing a bunch of settings before he realizes what he has done. While he is tech savy, I am not sure how far I would trust that. Especially with someone who has no exposure to BLYNK. You would almost want to make a “key” that could be referenced if case the wrong buttons are pushed.

I did a simple garage door monitor for my grandfather, and shared it with him. He doesn’t even know how to open/look at the app, but as long as the light on the receiving unit is green when the garage door is closed and red when it is open he doesn’t care. I keep the main project on my phone, so he doesn’t have to worry about that part of it (plus I can check on his door if need be). If I just mention the word APP, I can see the confusion/frustration almost immediately. Granted he is 83, so I cant blame him. I can only imagine what technology will be like If I am lucky enough to make it to that age, and I hope my grandchildren will be as nice to me in that aspect.

I would clone and “share” access to the account.

Thanks again for all the help.I am still planning this. I have the hardware for this. I am not sure how to do a digitalwrite in the widget code. I have the mega set for 11ch so far. I made the code as if there is buttons because the mega need to switch the relays on and off. I did this because I had the hardware already.

This is what I have in mind:
In Blynk I added 3 tabs on top just to split thing a bit.
Tab 1 says “Valves to the left”
Tab 2 says “Valves to the right”
Tab 3 says “General” (here I only have an RTC widget and a Notifier widget)
There is 3 pumps:
1x Main pump (which should always start on the time input widget)
2x Fertilizer pump (This should be a choice if it must run with the water pump or not)

For experts like you people this is easy I assume. :slight_smile:
For me this is a nightmare

Daily use of Blynk including keeping up to date with developments helps but it also depends how much “coding” experience you have.

Over the last few years Blynk have made it much easier for novice coders to control their hardware via the internet. They have added lots of additional widgets, Sketch builder and provide comprehensive documentation.

So it’s possible for a “tech savvy” individual to put together a pretty impressive project and even publish it on Google Play and the Apple i-Store with little or no coding experience. That said it’s always going to help if you have some coding experience or are prepared to learn a little as you progress from a simple LED blinking project.

It would help fellow Blynkers if we had an idea of your “coding” experience from:

  1. I have uploaded code to Arduino’s but only code written by others.
  2. I have made minor modifications to other people’s code for my own projects.
  3. I have used the Arduino IDE for a few years but have a lot to learn.
  4. I use the Arduino IDE quite regularly and feel confident with C++.
  5. I code for 18+ hours a day.

I am guessing you are somewhere in categories 1 to 3 but it’s important to know precisely where.

With assistance from Blynkers even a total beginner could get an irrigation system up and running but not as easily as someone in categories 3 and above, unless you are a very fast learner. The projects produced by someone in category 1 are unlikely to be as slick as someone from category 5 but if the project is for personal use and it performs the intended task then that’s all that really matters.

The Time Input widget is much more advanced than the Timer widget but requires user code to make it effective. It may be that you just want to make the one project for your father and take the Timer / Eventor widget route or if you plan to make dozens of projects that you familiarise yourself with the code required to use the Time Input widget etc.

Just to clarify the issue of sharing and cloning projects / accounts. For friends and family that are not tech savvy I would create a Blynk account for them, in their name, that I have the credentials for. I would tell them the buttons they can and can’t press, like never press the project stop button etc. This way they have control of their designated hardware and I can login and make full use of all the widgets on their behalf.

So project cloning with shared account access, but others might prefer sharing the project and accept the lower end user functionality that normally provides. It depends on each project but the “time” aspect of your project, the widgets available and your skillset suggests the former would be best.

Edit: there is also a category 0, just found Blynk and never uploaded any code to a MCU.

Thank you for the reply. I would say that I am in category 1&2.
I am new with all of this. Using Arduino and raspberry pi3 for about one year now. this is not my daily job but I like to do this in my free time.
I have a few projects that I am working on at home.
The project for my father with the pumps and solenoids is something I want to give him because he is 70years old and would like to control this stuff from home. This why I want to help him to be able to do this.
They live 2000km from me and are far away from all the technology.

@RiaanEngelbrecht I’m glad you didn’t say category 0, which I almost overlooked :slight_smile:

The way forward for you is to search this site for “irrigation” and sort by most recent thread.
Study the similar projects created by other Blynker and decide which one is the best fit for you.

Come back to us or the code author if there are parts of their sketch that you don’t understand or you have a specific requirement to do something a little differently.

If you specifically want to learn about the Time Input widget, which would be beneficial for your specific project, take a look at the general concepts in this fairly recent thread Automatic scheduler. ESP-01 with 4 Time Input Widgets

Also search this site for Time Input but beware the RTC widget that is normally used alongside Time Input was changed a few months ago. Ensure you use the syntax as provided in Sketch Builder and not that of sketches written many months ago.

One further tip, do a bit at a time, test it, move on to the next bit.

IMHO… 1 ESP + 1 MCP23017 should be enough…:wink:

Not with my soldering skills :slight_smile:

Not everything are lines of code (fortunately)… LOL.


1 Like

@Costas, :wink: