Jump to content

5 Pin Latching Switch W/LED Help


Kenpilot

Recommended Posts

I'm trying to wire up and program the navigation switches on the Navigation Control Panel of the A10C. I have 5 pin latching 12V switches with an LED. I'm connecting them to an Arduino Mega to control them and using DCS BIOS. I have tried every wiring combination imaginable and I can't get the switches and LED to work correctly. I want the LED in the switches to only illuminate when the switch is pressed and "ON". According to some videos I've watched, I should connect the NO and LED + together, and then connect them to an input on the Arduino. The C should connect to 12V+, and the LED- should go to 12V- and Arduino GND. When I do this, the LED is dimmly lit the entire time, regardless if the switch is pressed in/ON or OFF, and the switch in the cockpit goes crazy, in and out really fast. If I push the switch in/ON, the LED turns bright and the switch in the cockpit continues to go crazy in and out. I tried separating the NO and LED + and putting them each in to their own input in the Arduino since DCS BIOS has sketch lines for each of them, and the LED was still dimmly lit the entire time and it did turn Bright again when pushed, but the switch itself, while it didn't go crazy, it didn't work at all. Does anyone have any clue how to wire these switches so that the LED is only ON when the switch is ON and the switch actually turns ON and OFF like it's supposed to? Here is the switch that I'm using:

https://www.ebay.com/itm/114958766441?var=415078452986

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Link to comment
Share on other sites

LED + to 12V

LED - to NO

Arduino input to NC

GND to C

Set your DcsBios switch to use "TRUE".

This stops you feeding 12V into an Arduino pin.

Another option is to connect the LED + to an Arduino output and drive it with software.  That removes the 12V supply entirely. 12V LEDs in those switches will light with 5V.

Link to comment
Share on other sites

29 minutes ago, No1sonuk said:

LED + to 12V

LED - to NO

Arduino input to NC

GND to C

Set your DcsBios switch to use "TRUE".

This stops you feeding 12V into an Arduino pin.

Another option is to connect the LED + to an Arduino output and drive it with software.  That removes the 12V supply entirely. 12V LEDs in those switches will light with 5V.

Awesome, I'll give this a shot, thanks!!

How do I set the dcsbios switch to read "True"? I don't know what that means.


Edited by Kenpilot

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Link to comment
Share on other sites

12 minutes ago, No1sonuk said:

I think it's add ",TRUE" (without the "") inside the brackets, immediately after the pin number.

Ok awesome, I'll try it later on today. Thanks again!!

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Link to comment
Share on other sites

It worked!!! But I did have to type TRUE in all lower case. It was giving me an error code when I typed it in all caps. I searched and found that TRUE is no longer allowed and you have to use true. Thanks so much No1sonUK!!!!

Windows 10

ASRock Z370 Extreme4 LGA 1151 (300 Series) MOBO

intel i7-8700k (Not overclocked)

16 GB Ram

EVGA GeForce GTX 108ti SC Black Edition

SSD

Trackir

Link to comment
Share on other sites

35 minutes ago, Kenpilot said:

It worked!!! But I did have to type TRUE in all lower case. It was giving me an error code when I typed it in all caps. I searched and found that TRUE is no longer allowed and you have to use true. Thanks so much No1sonUK!!!!

Glad it worked.  I wasn't sure about the case of "true".

For future reference, I've included a schematic of the hardware light version.
Adding ",true" to the switch function line may seem a bit of a faff, but the idea of doing it the way I described is to prevent the LED supply voltage being fed into the Arduino input.SPDT_LED.png

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...