How do I connect multiple LEDs to one push-button switch?

Thread Starter

Circuitn00b

Joined Aug 12, 2019
8
I read about something called ”arduino”, can that be an alternative solution?

I thought about another possible solution to. Instead of going through a flip-flop/counter device in order to get the circle to work correctly, maybe it’s possible to create some kind of device that open and closes each connection physically? Like this: https://streamable.com/tjfvn There’s only 4 switches in the video but you get the concept.

I believe that, especially alternative 2, could be achieved mechanically, so that the same push of an button will force a device to close each switch one after another. In order to make them open again, like in the first and original alternative which i prefer, a spring tension (like that of an ordinary normally open push button) can reopen the switches after the mechanical device has gone past them.

I don’t know exactly how this should be achieved, what’s your thoughts? Is there something similar to my design that already work like this? I bet there’s plenty of things with other intended purposes that atleast reminds of something mechanically similar to this, that may work with smaller modifications otherwise?
 

ElectricSpidey

Joined Dec 2, 2017
3,335
Arduinos also require resistors and drivers to do what you want.

Two people spent their time designing you working solutions to your requirements, you reject them both, and now you want someone to design a mechanical solution…

Good luck.
 

AnalogKid

Joined Aug 1, 2013
12,139
The original Ford Mustang debuted the staggered turn signal indicator. Three bulbs were controlled by small switches against a cam shaft, turned by a gear motor.

ak
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,237
With respect to an Arduino (or microprocessor) solution:
  • Do you know how to program?
  • Do you know how to program in C?
  • Are you confident in designing a circuit to upload the code you write?’
  • Do you know how to drive the LEDs from an Arduino?
  • Do you have the debugging skills on an Arduino?
  • How long will it take you to debug your system!
And there’s more!!

IMHO, I see someone who doesn’t understand the basic skills to accomplish what you want - AND WHO HAS REJECTED SOLUTIONS THAT ARE NECESSARY IN ALL PROPOSED SOLUTIONS.

Something to think about!
 

danadak

Joined Mar 10, 2018
4,057
Using Arduino Nano -

upload_2019-8-18_18-47-40.png


You could replace the 10 R's with a resistor array, one part.


Regards, Dana.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
Using mBlock to code the Arduino (This is a partial solution, not debugged, but
an approach. Code only shows 2 of the 10 leds handled so I could fit on post)-

You drag and drop the functional blocks, config them, and mBlock generates the
Arduino code. Lots of videos on web.


upload_2019-8-18_19-44-11.png

The code it produces -

Code:
// generated by mBlock5 for <your product>
// codes make you happy

#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

float WchLED = 0;
float Button = 0;

void ClearAllLED (){
  digitalWrite(12,1);
  digitalWrite(11,1);

}

void _delay(float seconds) {
  long endTime = millis() + seconds * 1000;
  while(millis() < endTime) _loop();
}

void setup() {
  pinMode(3,INPUT);
  pinMode(12,OUTPUT);
  pinMode(11,OUTPUT);
  WchLED = 0;
  Button = 0;

}

void _loop() {
}

void loop() {
  while(!(Button == 1.000000))
  {
    _loop();
    Button = digitalRead(3);

  }
  _delay(0.2);
  Button = digitalRead(3);
  // Button is debounced and valid
  if(Button == 1.000000){
      WchLED += 1;
      // Roll WchLED back to 0
      if(WchLED == 10.000000){
          WchLED = 0;

      }
      if(WchLED == 0.000000){
          digitalWrite(12,0);

      }else{
          digitalWrite(12,1);

      }
      if(WchLED == 1.000000){
          digitalWrite(11,0);

      }else{
          digitalWrite(11,1);

      }
      Button = digitalRead(3);
      while(!(Button == 0.000000))
      {
        _loop();
        Button = digitalRead(3);

      }
      ClearAllLED();

  }

  _loop();
}
 
Last edited:
Top