As you may have guessed from the title, I am a beginner in electronics so please forgive any absurdity that might follow.

I am playing around with powerful COB LEDs and how to drive them. To that end I have built a battery-powered power-limiting circuit using a 16V battery, a step-down converter, an Arduino to generate a PWM signal, and something that Amazon translates as a trigger switch drive to switch the load.

The Arduino is powered via the buck converter (set to output a bit above 5V) and generates a PWM signal at around 32kHz, the duty cycle of which is determined by a potentiometer's position.

That PWM signal is then fed to the switch drive, which switches the current coming directly from the battery. I know using an Arduino for this is overkill but I have other features in mind that I will add later.

I have made a schematic, not using the recommended stack-exchange tool sorry about that I didn't know about it.

enter image description here

This contraption of mine works quite well to control the intensity of the LED and prevent it from burning (the battery is a beefy LIPO so it's definitely needed.)

Adjusting the potentiometer to control the LED feels a bit random even though I have set a safe maximum value for the duty cycle of the PWM output, and I would like the duty cycle to automatically increase when the voltage of the battery drops.

In order to do that I want the Arduino to monitor the power consumption of the LED. For this, I have built a shunt resistor using sixteen 1 ohm resistors in parallel and I'm measuring the voltages with the Arduino across the shunt resistor.

I want the LED to operate between 0.2A and 2A so if I'm not mistaken I should measure voltages across the shunt between 0.2 / 16 = 0.0125 V = 12.5 mV and 2 / 16 = 0.125 V = 125 mV. Around 12.5 mV I'm not expecting the measurement to be very precise since the Arduino has a resolution of around 5mV but for higher intensities I figured it would be enough for my purposes, but the circuit is not behaving at all the way I expected it to.

The things I do not understand are:

  • The voltage I measure across the shunt resistor (between points A and B in my schema) is systematically negative, but it looks more or less correct at high enough intensities when I compare it with the value I obtain from my voltmeter
  • I measure a positive voltage difference between the negative side of the LED, i.e. the terminal labeled "V_OUT-" of the switch drive, and ground. This happens both with the Arduino and with my voltmeter. I was expecting this voltage to be zero. This voltage diminishes when the duty cycle increases.
  • The voltage on the "V_OUT+" terminal on the other hand is constant at 16V.
  • The potential difference between "V_OUT+" and "V_OUT-" is 6V at 0 duty-cycle and increases with the duty cycle. Why isn't it zero when the duty cycle is zero?

So, in summary, I think I do not understand what this switching component does exactly and I'd appreciate some pointers to help me figure it out. And about my negative voltage across the shunt resistor, do you think it is just a precision issue or is something obviously wrong in my circuit?

  • \$\begingroup\$ Welcome! Please draw a schematic of what you are proposing. Click edit and click on the schematic symbol. \$\endgroup\$
    – winny
    Nov 19, 2021 at 21:58
  • \$\begingroup\$ Thank you! I did draw a schematic and I have included the link in my post, unfortunately I did not know there was an integrated tool for that. \$\endgroup\$
    – djfm
    Nov 19, 2021 at 22:03
  • \$\begingroup\$ Your schematic does not show the 16 X 1ohm resistors used as a current shunt. \$\endgroup\$ Nov 19, 2021 at 22:05
  • 1
    \$\begingroup\$ Please embed it as an image in your post if you already have a schematic. \$\endgroup\$
    – winny
    Nov 19, 2021 at 22:12
  • \$\begingroup\$ This circuit either shouldn't work or burn the Arduino. \$\endgroup\$ Nov 19, 2021 at 22:14

1 Answer 1


That setup isn't going to work so well. Your n-FET is working as a follower, so the source voltage isn't going to go above about 2.5V (assume 2.5V Vgs threshold.) So the FET is taking a large voltage drop across it, and shedding a lot of heat in the process. That's not good.

Also, you need to make sure the Arduino input voltages across your sense don't go above the 5V supply. You kind of lucked out here since the n-FET was working as a follower so the I/O swing is limited, but keep this in mind if you change the design.

Finally, measuring the current like you're proposing isn't all that useful because it's messed up by the PWM activity.

If you're determined to set a precise current through the LED using PWM control, consider instead a driver that does that. This is popular as a module; you'd select a step-down type. Using a module like this you don't need to sense the current as it's doing it for you. Instead, you'll characterize the current vs. duty cycle and work from that.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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