I have a STM32F4 Discovery board and I want to activate a LED connected to an external power supply.

I could connect the LED to the 5V supply of the STM32F4 DISCOVERY but I'm testing this to use it with a load that will consume a lot of current, so I need that external power supply. In addition I'm planning to use a N-Channel MOSFET instead of the NPN transistor, but for the moment I'm just testing a main idea.

In order to correctly control the LED toggling I've had to connect the STM32F4 GND to the LED power supply GND using a simple cable (purple cable in the picture below).


simulate this circuit – Schematic created using CircuitLab

If not, the LED is always turned on with a lower light intensisty (transistor not fully switched). I understand this is because there is a voltage offset between both grounds.

Is this procedure correct? If not, how should I proceed?


1 Answer 1


Yes, the purple link to connect the grounds are needed for the transistor to work.

  • \$\begingroup\$ Thank you very much \$\endgroup\$
    – LazyTurtle
    Jul 7, 2020 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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