Dimming a constant current LED?

Hello,

I want to get a constant current LED tube. This particular brand called toggled. And I would like to hijack it and place some sort of a dimming device AFTER the LED driver and before the LED strip (between the LED driver and LED). I would then control the device with an ESP32.

With traditional constant voltage LEDs, I would use a MOSFET for this. However, using a MOSFET would control the voltage and not the current. Is this some other transistor that would allow me to do what I'm looking for?

Again, I would like to control the DC part of the circuit and not the AC 110v part.

If the current is constant then further control is possible only by voltage (PWM). But a combination of both controllers may not work - find out yourself.

The manufacturer states:

Toggled D-Series (dimmable) LED fluorescent-replacement lamps perform best with ELV (reverse phase) type dimmers. ELV-type dimmers require a neutral wire at the switch and can be more expensive, but they typically resolve compatibility issues (including noise and/or flickering when dimming).

My suggestion is to mimic the AC controller and integrate the ESP component at that location avoiding issues with the LED driver circuit which is UL approved.
https://toggled.com/resources/product-support/compatible-dimmers/

I'm aware that it would be easier and everything, but I don't have the luxury of placing it there. Whatever I do, has to be done within the tube and not before it.

I think the last time I did that, if I remember correctly, the whole thing kept on flashing rather than dimming. As in, it would completely turn on/off.

Something like this can be implemented at the lamp on the AC:
https://www.ebay.com/itm/114337828337

However in my personal experiences, some projects with unusual constraints are best walked-away from as they often turn out to be major issues and no one is happy.

You cannot control a LED after the constant-current driver because the constant-current driver will drive it with - guess what? - a constant current.

That is, a constant average current, for constant brightness. If you attempt to use PWM then what will happen is that the current drawn during the "on" part of the PWM will increase in inverse proportion to the "on" time such that the average current (and LED brightness) remains constant. This is a very bad consequence, as the LED will be subjected to extremely high peak currents.

All that explained, there is actually one way to dim the LED - by providing a constant-current shunt in parallel with the LED. This will dissipate a proportion of the power and the LED will dim - the constant-current shunt will heat up accordingly.

This approach of course, makes no sense at all. You are obviously better off to use a constant-current driver which is designed to vary the current.

Constant-current drivers designed to be dimmable by phase dimmers work as the switchmode frequency is orders of magnitude higher than the chopped mains - the switchmode driver actually starts and stops for the variable part of every (half) cycle of the mains.

1 Like

I totally agree with you. I'm working in a startup with little to no mentor/help and a crazy manager that asks things that are not doable and doesn't expect no for an answer. Basically, he will not trust what I say until I try a couple of different options before hand. I already said that through research I couldn't find anything, his reply was " you were able to do it with the constant voltage LEDs, so you must be able to do it with this". So I'm trying to exhaust all options before I get back to him.

This driver is designed for varying current though. The bulb is advertised as a dimmable light bulb.

Yes you can, I have done so successfully. I have exactly that working: PWM on white LED lights driven from standard constant current LED drivers. Works perfectly. I don't claim that it will always work with any LED and any LED driver, but it works with the ones I have.

There are no constant voltage LEDs, the nature of an LED means it must be fed with constant current.

I suggest you try using a MOSFET and PWM. Take @Paul_B 's warning as indicating that it might not work. Take my success as indicating that you are in with a chance of making it work.

Good luck.

Precisely what do you mean here? What sort of constant current LED drivers and how did you connect it all?

I am referring to mains, switchmode LED drivers which have a capacitor across the output.

Hello Paul,
I'm sure we've discussed this before :thinking:

The LED drivers are indeed the ones that are mains powered and have the capacitor on the output that you are concerned about.

Drivers:

Inside:

The basic PWM circuit:


(I know! That's not a proper MOSFET symbol, I am too lazy to hand draw them properly.)
The MOSFET needs to be N channel, logic level with a high enough drain - source voltage to withstand the highest possible output voltage from the LED driver.

History:
I didn't know if this would work, I had similar concerns to those @Paul_B expressed but my attitude to electronics is to try things, to see if they work. I consider that I knew what I was doing and I knew the risks. Something might have gone up in smoke, I understood that and tried it. Nothing went up in smoke.

  • Version 1 had 1 MOSFET controlling all 8 LED lights, which worked fine but I wanted to control them in groups of 2.
  • Version 2 was built on perf board and had 1 MOSFET for 2 lamps, 4 MOSFETs for 8 lamps.
  • Version 3 is on a PCB and uses a Microchip TC4468 MOSFET driver to drive FQPF20N06L MOSFETS.
  • Version 4 is just an idea at the moment, I am not happy with the wood backboard, I would prefer if everything were on a sheet of earthed aluminium with an aluminium cover.

I built the first one at least 5 years ago and there have been no problems with the lamps or the drivers, I've not had any fail so far.

Safety
If you want to build this please only do so if you understand how to work with mains safely and understand that @Paul_B 's concerns are legitimate. Mine works, yours might not, be prepared for that.

Noted as a point of interest that those are isolated LED drivers, not series regulators.

Sorry for the late reply

I tried this. The outcome is flashing white light. Kind of like a strobe effect. It does not dim. I think what happens is that the voltage goes below the LED's threshold and just turns off instead of dims.

This is the MOSFET that was used.

Let me explain and give some background to what I was trying to do.

Previously, I was trying to hijack the LED tube I had in hand. The requirements is to power a device from 110v and to be able to control the lights without turning off power to the device. But all of this had to be done from within the light bulb, i.e I couldn't touch the cables before the lightbulb.

I was already able to hijack power from the LED tube's pins and feed it to the device, now the trick was to get dimming to work. I tried just turning on/off the lights using the MOSFET and that works as expected. Dimming is the issue.

The question now is, can I do this with a custom LED tube, if I were to manufacture one? As in, can I get a constant current LED driver that will let me control dimming from within it? Some sort of a control pin or something linked to a microcontroller?

Correct, that's the wrong way.
I see two possible solutions:

  1. reduce the constant current as desired
  2. use PWM at a sufficiently high (not flickering) frequency

Most probably your LED tube does not support either approach.
Don't there exist properly dimmable lamps for just your application?

The whole point of PWM is that the LEDs are turned on and off quickly, so quickly you don't see the flashing, they just look dimmer. I am not convinced you really did PWM. I'm also not convinced you used a logic level MOSFET.

Please post your circuit and your code (don't forget the code tags </>).

This is a dimmable lamp. The thing is, as I mentioned, I'm trying to control the dimming within the lamp and not before it (switch side).

I'll free hand sketch this, if you don't mind.


This is the MOSFET I used. In the test I did, I used an Arduino not an ESP32. After drawing it, I realized that I did the dimming test with the Arduino. But then used an ESP32 to wirelessly turn on and off the lights using the MOSFET. On the arduino, the output pin was 6.

void setup() {

  pinMode(6, OUTPUT);
}

void loop() {
  analogWrite(6, 50);
  delay(3000)
  analogWrite(6, 100);
  delay(3000)
  analogWrite(6, 150);
  delay(3000)
  analogWrite(6, 200);
  delay(3000)
  analogWrite(6, 250);
  delay(3000)
  analogWrite(6, 100);
  delay(3000)
  
}

Dimmable by phase controlled modulation, I suppose. There exist other lamps with analog or logic level PWM input.

I mean, I have other LEDs, the ones that are power by a constant voltage power supply. These work with the same setup, and I can PWM into them to dim them. Like these

That being said, I found that the constant current LEDs (that are powered by constant current LED driver) tend to be more bright, while also being more efficient and requiring a smaller LED driver.

You just found out that constant voltage and constant current drivers behave differently. If one supports PWM control this does not mean that the other one supports it as well.

I'm now aware of this and the result is that one dims and the other flickers. Having said that, is there something I can do to support my requirements? Change the driver somehow while keeping it as small, but still having the ability to dim from within the led tube and NOT before it?