So wire for the LED the same way I would wire a switch for a button?
Close, but not quite.
Wire the LED circuit separate from the switch circuits.
It
looks like the ZD encoder circuit board has 5v and ground available based on the red connectors in this pic.
- The boards you linked to don't have the red connectors, but you should be able to solder wires to the through-holes of one connector and use 0.250"/6.3mm Quick Disconnects to attach the wires to the "stirrup" tabs on your LED button.
- Since you're only powering one LED, current draw shouldn't be a problem.
If that doesn't work, keep in mind that ZD encoders are "active high" devices.
- The outer pins are all tied to 5v so you can use one of them for the LED anode. (+)
- The only thing remaining is to find a ground for the LED cathode. (-)
-- The microswitch circuit draws less current than the LED circuit so you
do not want to use an input port to ground the LED.
I don't have a resistor handy. What's the harm in running it without one? Burn out the bulb too fast or be too bright? Would running without a resistor do any harm to the encoder, cause a safety issue or be a cause of concern for any other reason?
Here's the button on amazon:
https://www.amazon.com/gp/product/B07BNFXLZ1/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
Description: The led lights have to distinguish between positive and negative interface. If not bright. Please change the LED interface.
Supports DC 12V power.
No worries.
Good news, part 1: There is already a current-limiting resistor in the LED holder.
- No need for a second resistor, especially since the LED is rated for 12v.
Good news, part 2: The 12v LED will also run on 5v. (see pic above)
- Not quite as bright, but the LED will draw less curent and last longer.
- Instead of the LED drawing about 20mA @ 12v, it draws 5.83mA @ 5v.
Good news part 3: If it isn't as bright as you'd like, you can swap the wedge-base 12v LED for a 5v LED.
Scott