Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: LED processing  (Read 1312 times)

0 Members and 1 Guest are viewing this topic.

Super_Chicken

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:October 21, 2020, 03:41:50 pm
  • I want to build my own arcade controls!
LED processing
« on: October 21, 2020, 12:10:05 pm »
Hello all!  Got a question I was hoping to get some input on. I am developing an arcade cabinet prop for a movie. It will contain some arcade LED push buttons. I want to set it up so that the buttons light up (when pushed) and turn off (if pushed again). To clarify, I only need the buttons to light up, they do not need to function (as input) and serve no real purpose other than acknowledging they were pressed. What equipment would I need to accomplish this?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: LED processing
« Reply #1 on: October 21, 2020, 07:41:18 pm »
I want to set it up so that the buttons light up (when pushed) and turn off (if pushed again).
Latching behavior like that will require either a physical latching switch (AFAIK there aren't any arcade-style latching LED buttons) or some sort of Arduino microcontroller and relay board.
- The relay board is probably needed because the LEDs draw too much current (about 20 mA each) to power a bunch of them directly from the Arduino output pins.



What equipment would I need to accomplish this?
Closest setup that I can think of is WannabeJoy's soundboard toy build here.
- The relevant parts are the battery pack, the modified USB cable for powering both the Arduino and the LEDs, and the microswitch input wiring at the bottom.
- Instead of the soundboard, use an Arduino Pro Micro.
-- You may need a full-sized Arduino , depending on how many buttons you need to control.   :dunno
- Obviously, the relay wiring and LEDs are not shown in this diagram.
- Use the relays as switches between "5v for LEDs" and the LEDs.



You'll need an Arduino sketch (program) that does three things:

1. Define and initialize variables, input pins from microswitches, and output pins to a relay board that switches LED power on/off.

2. Monitor input pins looking for a button press.

3. When a button is pressed, invert the logic level (high==>low or low==>high) on the associated output pin.
- The logic level controls whether the relay is on (logic high = 1) or off. (logic low = 0)

Also, if you want some of the buttons to have non-latching, momentary functions or add bank-switching (more than one LED per relay), here are some simple wiring diagrams.




Scott

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
Re: LED processing
« Reply #2 on: October 22, 2020, 09:39:48 am »
 It might be easier to actually handle the input to accomplish what you are asking. Any old computer will do, and then you'll need a keyboard or game pad encoder, buttons, and some software.

On the software side of things, there is an app for Linux that can do this. LEDSpicer has an "action" nput plug-in that can toggle a led based on input. It can handle simple toggles or complex interactions like when button 1 is pushed then blink button 2 until it is pushed then button 3.

This kind of setup is pretty basic. Linux Computer (including Raspberry Pi) with working button inputs which requires a keyboard or game pad encoder board (Ultimarc i-Pac is a good choice) to manage the button input and LEDSpicer installed.

Im not 100% sure if there is a method to make the button stay ON vs. just BLINK on press, but the author of the software 1. Is avtive on this board 2. Has a slack channel and is very responsive. You could find out more if interested.

On the windows side of things there is software called LEDblinky, but I'm not sure if it has this feature. Would be good to look into as it's common. 
« Last Edit: October 22, 2020, 09:46:27 am by mahuti »
Raspberry Pi, AttractMode, and Skeletor enthusiast.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9405
  • Last login:Today at 10:18:34 am
  • Designated spam hunter
Re: LED processing
« Reply #3 on: October 22, 2020, 11:57:34 am »
Here's an Arduino tutorial showing a single relay setup and code.
- You'll probably want to use the second example "Arduino Code - Button Toggles Relay With Debouncing".

https://arduinogetstarted.com/tutorials/arduino-button-toggle-relay


Scott