Author Topic: Super simple dimmer - but how does it work?  (Read 391 times)

0 Members and 1 Guest are viewing this topic.

Offline FriedMule

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: dk
  • Can make even the simplest task look imposible.
Super simple dimmer - but how does it work?
« on: June 17, 2021, 05:35:07 am »
So I have reverse engineered this two button LED dimmer and it works fine, both in a simulator and in reality, but I have no idea on why and how it works.
Could any of you explain a 400% noob how it works?

I think the cap and resistors value changes the speed of the dimming, but how does it "remember" the dim-value, what is the mosfet doing there?

« Last Edit: June 17, 2021, 07:54:29 am by FriedMule »
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 16199
  • Country: us
Re: Super simple dimmer - but how does it work?
« Reply #1 on: June 17, 2021, 05:50:27 am »
Did you intend to attach a schematic?
 

Offline FriedMule

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: dk
  • Can make even the simplest task look imposible.
Re: Super simple dimmer - but how does it work?
« Reply #2 on: June 17, 2021, 07:56:10 am »
Sorry but it wasn't visible for some reason, I have re-uploaded the image again. :-)
Even if I appear online is it not necessary so, my computer is on 24/7 even if I am not on.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15615
  • Country: za
Re: Super simple dimmer - but how does it work?
« Reply #3 on: June 17, 2021, 08:34:53 am »
The Mosfet is acting as a source follower, wityh the gate voltage biasing it into the linear region, and the 1uF capacitor acting as a storage element for the gate voltage. The 1M resistor allows the charge to be slowly increased or decreased, so the mosfet is going to turn on more or less, depending on the voltage on the capacitor. The charge will gradually leak away, so it will eventually dim and go out, and the mosfet will be running in a linear region, where you have to be aware of current flow and power dissipation, and most mosfet devices are not specified for DC use, as they have to be massively derated to run there. You might find big variance with temperature and between devices as well, and in general probably do not want to draw more than 2A or so of current, even with a 50A device, as it will need a pretty big heat sink to dissipate the power it is generating as heat.

Works sort of well if you only have a few small LED's to dim, and can handle the power loss, but it will drift brightness with time, and will eventually go off, but will still draw a small current as it dims.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 3700
  • Country: pl
Re: Super simple dimmer - but how does it work?
« Reply #4 on: June 17, 2021, 09:55:10 am »
It's common source, not follower.

When all switches are off, 1µF holds a constant charge and is effectively a voltage source. It keeps the gate X volts below drain voltage. If drain goes up, the FET is turned on harder, if drain goes down it's throttled down. Effect: drain voltage is regulated X volts higher than whatever voltage is needed at the gate to sink LED current at given drain voltage. So it's roughly constant.

Such circuit is know as Miller integrator. The resistor and switches are "current sources" which charge/discharge the cap and change the drain voltage. Leakage from gate to source charges the capacitor and causes slow increase of capacitor charge and dimming of the LED, leakage through the capacitor itself has an opposite effect. Brightness may slowly drift as a result.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 1701
  • Country: us
Re: Super simple dimmer - but how does it work?
« Reply #5 on: June 17, 2021, 11:49:16 am »
A more conventional schematic:

 
The following users thanked this post: tooki

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 16116
  • Country: gb
  • 0999
Re: Super simple dimmer - but how does it work?
« Reply #6 on: June 17, 2021, 12:16:29 pm »
The LED needs a current limiting resistor, if it doesn't have one built-in, or the on resistance of the MOSFET is enough to limit the current.
 

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 7146
  • Country: gb
Re: Super simple dimmer - but how does it work?
« Reply #7 on: June 17, 2021, 12:23:13 pm »
Just an obvious one. You need a series resistor somewhere in the chain between the positive supply, S1, S2 and Gnd, otherwise you will short the supply if you happen to push both buttons at the same time.
Regards, Chris

"Victor Meldrew, the Crimson Avenger!"
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf