I have a package plant (sewage) with three clarifying chambers. I need to pump the chambers sequentially with a rest time between pumps to let the water table stabilize.
The motor that drives the blower is on a timer and it is adjusted seasonally between 30 and 45 minutes.
Theory of operation is: Timer on for 45 minutes, one minute delay, pick solenoid 1 for one minute, two minute rest, pick solenoid 2, etc. After all three chambers are pumped, how do I keep them from going through the cycle over and over until the timer signal drops out?
I need to use my Iphone to fine tune the on and rest times so that's why I chose the Uno R4 Wifi.
@fishbonzwv Put all the code in Setup and nothing in loop?
OR
end the loop with a dummy while(1); or for(;;){}
I have not heard of a quit option, what does return do?
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@fishbonzwv
Don't power the relays directly from the Arduino, use a separate power supply or split it from the same supply independently from the UNO.
Anything seems possible when you don't know what you're talking about.
@will I didn't notice that, good catch.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@zander This is all in the planning stage right now and trying to learn the programming. I've watched a bunch of vids and read a lot but never saw a way around what I need. Figured it would take some if's, when's, goto's or adding a one-shot relay.
First step is getting the air lifts built (carved the pattern to cast the saddles today), then cast a manifold block to mount the air solenoids. Once those are tested, it will be adding the automation.
I am not familiar with the UNO R4 WiFi but there may be another hitch in your proposed wiring. You seem to be powering the UNO from a 5V supply run from mains. But it appears that you're connecting the power supply GND to the UNO GND (which is fine) but sending the power supply 5V through the UNO's VIN pin.
That won't work because the VIN input goes through a voltage regulator which will drop the voltage by a volt or two leaving the UNOs operation unstable at best. The reference material suggests 5V-24V fed into the VIN pin to get a stable 5V supply for the UNO.
You should be able to connect the power supply's 5V directly to the UNO's 5V pin to power the UNO.
Anything seems possible when you don't know what you're talking about.
@fishbonzwv I just realized I left out the 1960's solution, just add a one boolean variable that is initialized to true that drives the main loop. At the end of the main loop simply switch the switch off. Beyond that you could even get fancy and have a timer return the switch to true so the loop runs again after some amount of time or even every 24 hrs. Lot's of tools.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
@will @fishbonzwv Did you leave a pin name out, you first say VIN is being used for 5V in, then say that is a bad idea, it has to be in the range of 5 to 24V, isn't 5 in range of 5? 2nd point is in the last paragraph you say UNO's 5V in. Isn't that the same VIN? Also look at the doc screen grab I got. 6V-24V
I am also attaching the power tree diagram.
Colour me confused.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
1) It's a typo - should have read 6V-24V for the R4 VIN (not 5V)
2) No, I mean connecting the power supply's 5V directly to the UNO's 5V pin, not the VIN pin. You can power the UNO directly through its 5V pin but I believe that means that you should NOT try to apply power via the VIN pin at the same time.
Anything seems possible when you don't know what you're talking about.
@will I must have missed that, can you describe where it is, according to the power tree I see only USB, DC jack, and VIN. All the other 5V pins are output but my eyes are old.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
The R3 allowed powering via the 5V pin. I'm assuming that the R4 will do the same. AFAIK there is only one 5V pin on the board. I see that it's now labeled as "out" so it's possible that the redesign for the new chip has eliminated that alternative 🙁
Perhaps the simplest method would be to create a 2 wire USB cable from the power supply and plug it into the UNOs ISB socket.
Anything seems possible when you don't know what you're talking about.
This article < https://thepihut.com/blogs/raspberry-pi-tutorials/how-do-i-power-my-arduino?srsltid=AfmBOoq2rhy73-MAqgrjcnnq5gjhJE--fGeov0w0cKqujxtTCXOs2m16> describes powering the R4 via the 5V pin in the section labelled "Mode 3 – Via the I/O".
I offer this reference as information, not recommendation.
Anything seems possible when you don't know what you're talking about.
@will LOL, this is getting hilarious. The problem is you said 5V when it should have been 6V and you said the VIN can be used and can't be used.
Here is where you said can't use VIN
but sending the power supply 5V through the UNO's VIN pin.
That won't work because the VIN input goes through a voltage regulator which will drop the voltage by a volt or two leaving the UNOs operation unstable at best.
You then said. The 5V (MUST be at least 6V since the VR will drop a volt) directly to the UNO's 5V pin .I assumed that to be VIN, but if it's another pin I stand corrected.
You should be able to connect the power supply's 5V directly to the UNO's 5V pin to power the UNO.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
My personal scorecard is now 1 PC hardware fix (circa 1982), 1 open source fix (at age 82), and 2 zero day bugs in a major OS.
I think the article I referenced above says it all. As I mentioned earlier, I'm not experienced with the R4 so I'll bow out now and leave the above URL as the reference point.
Anything seems possible when you don't know what you're talking about.