1
\$\begingroup\$

I have a microcontroller, TTL logic that expects its input to be connected to the ground via a brake lever to tell the microcontroller that the brake has been applied. I believe it uses an internal pull-up resistor as measuring the voltage on the input shows 5 V.

Current microcontroller setup

Currently my brake lever is connected to a ~12-13.8 V system that runs to brake lights.

Current brake lever setup

How can I intergrate the two circuits together so that the brake lever lights the brake lights, as well as informs the microcontroller that the brake lever has been pressed? I feel like this circuit would do the job:

Proposed circuit

  1. Would this be an ideal circuit and if not what would be better?
  2. What would be good resistor values and transistor to minimise power usage from the 12 V circuit?
\$\endgroup\$
3
  • 3
    \$\begingroup\$ Your transistor is upside down. \$\endgroup\$
    – Hearth
    Commented Apr 15, 2023 at 16:21
  • \$\begingroup\$ Oops, first time using the diagram software and must have hit flip by mistake. This should be a standard NPN transistor. \$\endgroup\$
    – Scott
    Commented Apr 15, 2023 at 16:25
  • 1
    \$\begingroup\$ the pullup resistor should not be drawn inside a component ... put it above the switch and above the transistor \$\endgroup\$
    – jsotola
    Commented Apr 15, 2023 at 16:54

1 Answer 1

2
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. The simplified circuit.

There's no need for your resistor divider. Just set R1 to control the current into Q1's base. It will be about 1 mA if set to 10 kΩ as shown.

I've shown R2 inside your LED lamp as there must be some current-limiting resistor built in.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.