I have built the following to dim the brightness of the LED backlight of a display: enter image description here I am using a BS170 MOSFET (the diode is no extra part but included in the MOSFET, according to the datasheet). The BL pin is the supply of the LED backlight. (I have left out all other pins.)

Unfortunately, it does not work. Even if I set the PWM pin to 255, the backlight does not light (actually it's completely off). If I short BL and Vcc, it lights up as it should.

Also, the voltage readings confuse me: I measure 3.3 V on the gate and drain against ground, 1.5 V on source against ground (= the voltage across the backlight) but only 1 V if I measure drain against source.

So my questions are:

  1. Shouldn't this add up to 3.3 V?
  2. More importantly, why do I get only 1.5 V at BL?
  3. Most importantly, what do I need to change? Different MOSFET? No MOSFET?

The primary aim of controlling the backlight is to be able to switch in off completely, thus reducing power consumption. (Being able to dim it is only a plus.)


I should have added details about the display. It's one of those: enter image description here

I haven't found a datasheet / specs for exactly this model. Most datasheets I found refer to a different version that is not 5 V compatible. A very similar model is described here.

Concerning my question I haven't found information on how much current the backlight would draw. Therefore I didn't want to drive it directly from the PWM pin. (Actually I could just measure it...)

2 Answers 2


Summary: It looks as though you can just drive BL directly with the PWM-output.
What happens when you do?


(1) As shown, even if the circuit did what you wanted, all you would be doing is providing a rail to rail (0V to 3.3V ) signal to the BL pin. You can do this by connecting PWM-out to BL directly.
Does this work?

If the LCD and Arduino used differing power supplies the MOSFET may be useful.

(2) To use circuit almost as-is you need a PChannel FET. Swap Drain and Source and it will provide PWM to the BL pin. When BL is high the FET is off. When BL is low the FET is on. The FET used must turn on with about 3V between gate and source.

(3) To use the N Channel BS170 you must drive the gate +ve above the source by an amount that is enough to just turn it one "plus a little more". This is called Vth (Vthreshold). The BS170 has Vth ~= 1.8V at low currents. Vth varies somewhat between samples. When you connect the gate to +3.3V the FET tried to turn on but as the source rises it reduced Vgs until it reaches about Vth. Raising the source above this level reduced Vgs to below Vth so the FET is not turned on.
ie this is what a=accounts for the 1.5V that you see as 3.3V - 1.8V = 1.5V.

To use the BS170,
connect the source to ground,
connect drain via a say 1k resistor to +3.3V,
connect drain to BL,
drive gate with PWM.

BUT why does not just driving BL with PWM do what you want?
A data sheet for the display would be useful.

  • Driving BL directly from the PWM might actually work, I will consider that. But what I was trying to learn is what I was doing wrong when using the BS170 like that, and you answered that nicely! May 2, 2015 at 12:48
  • It turns out the backlight draws 4.5 mA @ 3.3 V. So I can get rid of the MOSFET altogether. May 2, 2015 at 13:01

Since you are switching on the high side, you need a P-channel mosfet, not an N-channel like the BS170. (Or you need a higher voltage on the Gate to reach the VGS(th)).

I have a similar display, but mine will light up if BL is connected to ground. For these kind of displays you'd use a N-channel mosfet.

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.