Hi I'm last minute taking over a project, and I'm struggle to find the correct circuit to dim a dimmable ballast and TL fluorescent lamp (Philips HF-R 258 TL-D EII 220-240V)

The ballast has a 0-10v dim input that I'm controlling with a PWM through an opamp LM358 (edited). The code below works with a led and makes the TL lamp go on and off. But does not really dim it.

I'm wondering how I could improve the circuit. (Add a better ADC chip? Wire it before the OPAMP?)

Or am I overlooking something and is there another reason why this doesn't work?

This is the current circuit:

enter image description here

Simple test code:

//pwm from pin 5 slowly increases,
//then decreases repeatedly

//Initializing LED Pin
int led_pin = 5;
void setup() {
//Declaring LED pin as output
pinMode(led_pin, OUTPUT);
void loop() {
//Fading the LED
for(int i=0; i<255; i++){
analogWrite(led_pin, i);
for(int i=255; i>0; i--){
analogWrite(led_pin, i);
  • Your circuit makes absolutely zero sense whatsoever. I can't undestand what you hope to achieve with it.
    – Majenko
    Sep 26 at 10:04
  • I think because you are using the wrong components in your fritzy thing the resultant schematic is meaningless. I suggest you throw away the fritzy rubbish and draw your schematic properly, otherwise it's pointless even having it.
    – Majenko
    Sep 26 at 10:15
  • It looks like your second stage has a 10x gain. You only want 2x (or at most 2.5x) gain. Also note that the LM358 is a poor choice as it is not rail-to-rail, so you will never get down to 0V unless you use a split rail power supply.
    – Majenko
    Sep 26 at 11:04
  • If you only amp and don't filter the pwm in the op amps, you're essentially relying on everything downstream to handle the filtering that will produce dimming from the on-off that is pwm- probably better to filter to an analog while it's still low voltage.
    – Abel
    Sep 26 at 12:55
  • 1
    @Abel That's what the 3k3 + 22uF do...
    – Majenko
    Sep 26 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.