Possibly confused about using PWM

I want to control the brightness of a 12v light and so I am using transistors in the high side of the bulb
(NPN and then P-Mosfet) to control the light, and an Arduino pin to control the NPN. Actually, all I want to do here is run the bulb at a single reduced brightness when commanded by the Arduino. At other times it will be illuminated at full brightness.

Can I use PWM on the Arduino to the NPN base pin to get the transistors to turn on and off according to the PWM waveform? Or will the NPN just see the PWM wave as a reduced voltage signal and turn solidly ON if the voltage is high enough or solidly OFF if not? I will be sure to choose transistors that can switch at the speed of the PWM waveform.

If I'm on the wrong track, what do I need to investigate to change this design?

Thanks in advance
Peter

Can I use PWM on the Arduino to the NPN base pin to get the transistors to turn on and off according to the PWM waveform?

Yes.

That’s a very good answer. I must have asked a very good question :wink:

Thanks

pgsmick:
Can I use PWM on the Arduino to the NPN base pin to get the transistors to turn on and off according to the PWM waveform?

Maybe we're confused about the question?

pgsmick:
I want to control the brightness of a 12v light and so I am using transistors in the high side of the bulb...

Could this be a 12volt halogen bulb?
If so, halogen bulbs have a reduced lifespan when dimmed.

PWM turns the bulb rapidly on/off.
Power to the light bulb is reduced by varying the duty cycle.
Leo..

pgsmick:
Can I use PWM on the Arduino to the NPN base pin to get the transistors to turn on and off according to the PWM waveform? Or will the NPN just see the PWM wave as a reduced voltage signal and turn solidly ON if the voltage is high enough or solidly OFF if not? I will be sure to choose transistors that can switch at the speed of the PWM waveform.

Note you must use a base resistor or you’ll damage the Arduino pin and/or NPN transistor.

By default the Arduino PWM frequencies are 1kHz or 500Hz or so, dependent on which pin or processor.
No semiconductor device is that slow!

If you wanted to switch at 100kHz you would need to take care to use fast switching circuit
topologies - you’d probably need a MOSFET driver chip, for instance.

If you show us your circuit, we can comment further.

I'm fine now. I was momentarily confused by the idea that a PWM signal can be considered as a reduced voltage when averaged over the cycle. A light bulb would react to that reduced voltage, and be dimmed. So would an LED.

And so I thought that maybe a transistor would see it that way, too. But a transistor seeing merely a reduced voltage on its base (yes, with a resistor) might just turn on (assuming the "reduced voltage" was high enough) and stay on instead of following the waveform. That would cause the Mosfet to turn on and stay on, and so the bulb would not be dimmed. That would not be good, hence the question.

But since the transistors are fast enough to follow the wave form, the "averaging" is done by the slow reacting bulb (and slow reacting human eyes) at the end of the line.

Anyhow, on the strength of your responses, I built the circuit, and it works just fine.

This is not a halogen bulb, so flickering it should be fine. it is just a motorcycle turn signal (which could be either an incandescent bulb or an LED array).

Thank you all for your support.
Peter