File component issue (Using Bluetooth, TinyDB to control a Plant watering system)

Ok

"Duration ON" and Duration OFF would be better suited.

What is the Time field for? Shows the current time?

Yes that is the proper indication Patryk!

Also if you notice in the lower left corner I indicate specific file name for this timing information. there will be hundreds of files eventually each with different timing information.

I do use list boxes for those 2. PLANT TYPE and WATER MODE .When the user selects the PLANT TYPE a list of plants appear in the dropdown list and when they select the WATER TYPE a list also appears for that. I then combine the 2 lists to create the specific file name for that particular timing setup.

Eventually I will us the TIME FIELD so the user can select a specific time to perform the timer cycling. In case they need to leave the area for whatever reason and are out of Bluetooth range. I have provided them with a separate phone designed for their specific application.

Yep in anticipation of your next question I will eventually be setting them up with WIFI but that will be down the road aways because they will need cameras also to guarantee that everything is functioning properly. I am really excited about that as I have never worked with WIFI and look forward to learning about it.

I have a question about that pump in your diagram.

It services all the valves.

Is it wired to turn on and off based on valve settings (like my household boiler), or is it also going to be controlled remotely?

Remote control would be more complex, needing to consider all the current valve settings (On/Off) to decide whether or not to let the pump run.

What if the OFF field is empty? The relay will be turned on permanently?

That's why I put 10 second in the last OFF column Patryk because we don't want the relay to stay ON. But yes if that filed is empty it would be better if it shuts OfFF the relay in the last cycle.

Should be OK.

clock (6).aia (195.8 KB)

Yes ABG it does service all the valves. That is on a different page. When the Timers is set the user on the other page identifies what process they are performing based on several factors.

  1. Which plants are you working with.
  2. Are you Feeding or Flushing or are you mixing the Food n the fertilizer tank.
  3. Those selections are partially based off the last half of the File name (Fill, FEED or FLUSH)
  4. I am using a 16 Channel Bluetooth board and several relays would be turned on at certain times. i.e. if I am feeding the plants in bay 5 then the bay 5 relay would be turned on along with the Fertilizer relay and the pump relay.
  5. The timer cycling page will then take affect and since watering plants requires turning ON the pump for several seconds then turning it back OFF that relay will be cycled to do so. The reason behind turning ON and OFF is because when you water dry soil, if you apply to much water all at once most of it will just run off the sides of the pot, unless you give it short burst, wait for it to soak in, then apply another burst.

Does that give you a better idea on what is happening?

i was worried about the case where different timer programs for different plants might be running simultaneously, and have different requirements for that one pump to be running or not running.

How is that conflict resolved, electronically through wiring, or programmatically in Blocks?

This page will allow only ONE option at a time to be performed. you select the bay you are Fertilizing, the FILE NAME you select will determines if you are Filling, Fertilizing our Flushing on the TIMER page.

You select which bay you are working on. The bay selection only allows 1 bay selection at a time. The other buttons are only there to show the user which option has been chosen. I have not started working on this page yet as I do not have the 16 Channel Relay board yet. I do however have the vales, power supply all the necessary electronic components to assemble it.

I would like to point out that this has been an exciting journey in building this system. I come from a long background in prototyping some 26 years since 1980. Got out of it for a little while. Feels good to be back at it.

It is not fully automatic. A simple application that controls the relays. The phone must be within range of transmitters for this to work. You can use a telephone as the heart of the system, the telephone would have to be within the range of transmitters all the time. But still, I think that even a regular IOT ESP32 module would be a better solution.

Yeah! it's good though up to 50 feet which is fine for this application. I will however be switching to WIFI eventually that should give them more versatility
.
Not familiar with that board Patryk i will however look into it. I don't like complex boards that require extensive wiring, and intermediate redundant coding to get it to work. I have gone that route in the past and there is always a long and tedious debugging process to get it to work right. Phone to Board is pretty simple. if I understood coding using the MIT APP INVENTOR better.

ESP32 is a development board. It has a micro controller that can be programmed in the Arduino environment. It has bluetooth and WIFI on board. It requires programming, e.g. in C ++. It has several dozen pins, you can connect relays and various sensors to it. You can write a program that controls everything, while the phone could only be used to change settings.

In your case, the app is the heart of automation and controls everything just like a micro controller. On the one hand, an easy solution because you don't know the programming rules, some PowerUser will write the code for you :smiley: . On the other hand, this solution has limitations, it is definitely more expensive.

Patryk Patryk Patryk

You are the king. This new timer routine is exactly what I was trying to achieve and you nailed it. Thank you so much for everything you have provided in support for this project. I can not sing you praises enough.

I have one more small change I would like to make but for the life of me I can't find the right components to do it. I think I know where to insert the change and have indicated where I THINK they should go but not sure how to do it.

Thank you for sticking with me through all the emails back and forth.