Please how can I control 4 relays to work one at a time with a push button

danadak

Joined Mar 10, 2018
4,057
Thanks for your reply. We’ve had this conversation before. YOU knew that the debounce was included. But, no one else (ok, maybe me) had a clue!

Your post reminds me a a quote Robert Heinlein had Lazarus Long say in his novel, “Time Enough for Love”...

“Never try to teach a pig to sing. It wastes your time and annoys the pig.”​

You are trying to teach pigs to sing and as well as join together in a chorus. Good luck with that!
The whole forum is precisely teaching humanoids new stuff......not sure what you are trying to say.
 

danadak

Joined Mar 10, 2018
4,057
That not all "humanoids" like to program or want to learn how to program. :rolleyes:

Everybody programs, when you make a list of parts to build a board, or go to the grocery store,
or operate and config your TV controller or operate a calculator.....you are programming...

You know crutschow you want this real bad......:)

No more using 555 timers and finding out they are only accurate to +/- 1 giga percent.

You know crutschow you want this real bad......:)


Regards, Dana.
 

djsfantasi

Joined Apr 11, 2010
9,156
Everybody programs, when you make a list of parts to build a board, or go to the grocery store,
or operate and config your TV controller or operate a calculator.....you are programming...

You know crutschow you want this real bad......:)

No more using 555 timers and finding out they are only accurate to +/- 1 giga percent.

You know crutschow you want this real bad......:)


Regards, Dana.
I like that you like microprocessors. Like it real bad.

What I don’t like - and we discussed this a while back - is that you don’t like “humanoids”, what the rest of us call people.

Because if you did, you’d show more restraint and more respect in the forum.

A “person” would respect where other people are coming from. A “person” could understand other viewpoints different from their own. A”person” would be sensitive to their own behavior and would realize that they’re hurting themselves with a “non-humanoid” attitude.

At one point, I thought you understood. Today, I’m convinced you are incapable of understanding.

Do you know what the Ignore list is? Welcome to it...

Regards,
dj
 

crutschow

Joined Mar 14, 2008
34,283
when you make a list of parts to build a board, or go to the grocery store,
or operate and config your TV controller or operate a calculator.....you are programming...
That meets no definition of computer programing I'm familiar with. o_O
You know crutschow you want this real bad......:)
What the hell does that asinine comment mean, danadak? :confused:
 

be80be

Joined Jul 5, 2008
2,072
I love then little uC but for some stuff there way over kill the time it took to figure out the code i would of just grab a 4017
and setup as crutschow showed it would take a little time getting switch bounce right on uC
 

djsfantasi

Joined Apr 11, 2010
9,156
I love then little uC but for some stuff there way over kill the time it took to figure out the code i would of just grab a 4017
and setup as crutschow showed it would take a little time getting switch bounce right on uC
Great comment! As I said earlier, we all see things differently. By the time it takes me to look up the 4017 pinout, I’d have written the code in my head. I figure it’d take me 10 lines of code (given that I do this so often, I have my own libraries of code, including pushbutton debounce). Three or four lines , in a sketch skeleton, to initialize all the pins. One line to initialize variables. Two lines to read the push button. And three lines to control the relays.

But the TS isn’t me. And it looks like neither is @be8obe.

And that’s what we need to appreciate!
 

danadak

Joined Mar 10, 2018
4,057
I love then little uC but for some stuff there way over kill the time it took to figure out the code i would of just grab a 4017
and setup as crutschow showed it would take a little time getting switch bounce right on uC
I did an evaluation on a number of mechanical switches/buttons moons ago, and
with some ap note input, settled on 200 mS of bounce time. I have found the logic
flow fairly straightforward. First logic value on pin indicating closure I start a loop,
waiting in loop either as a blocking approach or timer ISR method, waiting at least
one bounce cycle for it to stay true, if its not loop/wait again. If true then I bounce
out to insure release. Same routine actually. Reuse this basic approach design to
design.

As far as simplicity historically I used C, and that can take longer remembering
specifics about part I am working with. Lately playing with block languages, and
they are fast to program because they "simplify" basic operations. For example
all data in one version treated as floats, and converted for you in the compiler,
for specific HW constraints. So not optimum, but no more manual searching and
API studying to figure out data type needed. One block language allows you to couple
Arduino to PC, and simply make an ap like a talking voltmeter w/o writing any
PC code, the compiler/iIDE took care of that. Pretty cool. I used that recently to work
across a room doing adjustments while the Arduino speech issued readings to me.

So for simple stuff I do the block languages, more complex C based.


Regards, Dana.
 
Last edited:

be80be

Joined Jul 5, 2008
2,072
It's all cool like today some house have switched plugs. Owner wants a light in the ceiling no big deal
remove the outlet install the new one with tab unbroking move white wire to the neutral side of plug
take white wire off switch install new wire for light tie white wire to white put new black on switch
your done or do like they did and start all over.
and install 2 new wire in the wall and ceiling the both get the job done only one just meant add one wire.

Using a uC for a timer or a bunch of outputs I do all the time but some times i wonder the logic behind
hitting a button and writing code to do simple things just to stay its what better na
the both got the light on lol
 

be80be

Joined Jul 5, 2008
2,072
Then I read today there new look for arduino the uno going to be a thing of the past.
the new boy on the block the feather is faster and better
You now have 600 mhz arm's the feather 48 mhz and the tessy4 is 600 mhz
I can see a 600 mhz switching 4 relays soon LOL.

Then there a new counter for carwashes the old one had 4 buttons and 3
seven segments the new one has touch screen like from a phone looks like a old iphone 3 screen. No buttons
But they both do the same thing count how many feet the car has moved .
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
And needed would be a shift register or decoded counter to create
the sequence.....and logic / circuitry to prevent any glitches on power up......


Regards, Dana.
 

BobTPH

Joined Jun 5, 2013
8,813
Has anyone noticed that the TS has has nothing more to say while this pissing contest goes on and on?

I still think the best solution is no relays, no 4017 no microcontrollers, and one rotary switch (with no debouncing needed,) but I guess we will never know.

Bob
 

danadak

Joined Mar 10, 2018
4,057
Thanks Bob, excellent advice.

Although TS did stipulate a push button in initial post....of course there
are mechanically interlocked radio buttons available. If they can be had
break before make that would suffice. But mechanical reliability was never
exactly their calling card.


Regards, Dana.
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,501
Good day people, please am building a charger with 12v, 24v 36v and 48v tappings. I have a problem of how to make a tapping work at a time with a switch without using Arduino or any other programming tool.
How much current? Want it real simple just use a Rotary Switch with contacts rated for the load(s) you want to switch. Since you have provided little information that is as simple as it gets. You want a Break before Make type.

Ron
 
Top