2026-05-20 9:36 AM - last edited on 2026-05-21 1:08 AM by Andrew Neil
Moved from the STM32 MCUs forum - this has nothing to do with MCUs
For this circuit, how can I implement the tactile switch functionality using the dual-LED feature? Can any one explain how the circuit should be designed for a 28V input? I am unable Implement this Logic
Like My requirement is 28V I am getting upto 42mA So This switch Should Receive and that will be working like the Tactile and need to Glow the Once pressed one will glow if anoother Press other LED should Glow . How to Implement This Logic
please reply fast
2026-05-20 9:43 AM
Is there any STM32 involved?
2026-05-20 10:45 AM
Welcome to the forum.
Please see: How to write your question to maximize your chances to find a solution for best results.
@Balayyaa wrote:For this circuit, how can I implement the tactile switch functionality using the dual-LED feature?
Not sure what you mean by that?
The functionality of a switch (tactile or other) is simply to be open or closed - that has nothing to do with the LEDs.
In your diagram, the switch contacts are between pins 1 & 4
The LEDs are between pins 2 & 3 - completely independent of the switch.
@Balayyaa wrote:Can any one explain how the circuit should be designed for a 28V input?
You mean 28V input to an STM32 ?
A voltage divider could do that.
Maybe an opto-isolator if the 28V is "hostile" ?
@Balayyaa wrote:Glow the Once pressed one will glow if anoother Press other LED should Glow .
So each press on the switch alternates which LED is lit ?
A simple state machine should do that ...
2026-05-20 11:58 AM
And since the LEDs are connected in anti-parallel, you would need to drive them using a bridge circuit. You would just need to decide whether to power the LEDs from the 28V supply or from the MCU voltage. And that brings us back to the questions from @mfgkw and @Andrew Neil.
2026-05-20 12:26 PM
Up to now there is no involvement of the Processor
2026-05-20 12:30 PM
Hi peter
Here I am not involving the MCU So with out the Bride circuit is there any solution Like any Digital Gates
2026-05-21 1:06 AM - edited 2026-05-21 1:49 AM
@Balayyaa wrote:I am not involving the MCU
So why did you post this in the MCU forum?
Note that this is ST's forum, so questions should be related to ST products.
Other forums are available for general electronics questions...
PS:
See this post for some suggested general electronics forums
2026-05-21 1:19 AM - edited 2026-05-21 1:55 AM
@Balayyaa wrote:So with out the Bridge circuit is there any solution Like any Digital Gates
Think about it:
An LED lights when its anode is more positive than its cathode.
Your two LEDs are wired in "anti-parallel" (aka "inverse parallel") between pins 2 & 3:
So:
Think about how you could achieve that with gates ...
You will, of course, still need a current-limit resistor.
Some good basic electronics materials here: https://electronicsclub.info/leds.htm
2026-05-21 3:15 AM
@Andrew Neil wrote:
- When pin 2 is high and pin 3 is low, the top LED will light;
- When pin 2 is low and pin 3 is high, the bottom LED will light;
Or, to put it another way:
| Logic level at pin 2 | Logic level at pin 3 | Which LED lights? |
| Low | Low | Neither |
| Low | High | Bottom |
| High | Low | Top |
| High | High | Neither |