Driving a LED with a CD4066 and a ramp generator

Thread Starter

Philexium

Joined Oct 15, 2017
110
The circuit is used for a model railroad.

Specification
To drive the progressive lighting of a LED ramp.

Circuit objectives
To prevent transient LED lighting when power is turned on or during the ramp generator cycle.
To enable gradual lighting via the CD4066 switch connected to the output of the ramp generator

Circuit operation
The R-C circuit generates a delay of >= 10 s when power is turned on.
It controls pin 13 (Control A) of the CD4066.
The output of the ramp generator is connected to input 1 of the switch to allow for gradual lighting.

To drive a LED ramp (40 mA) I use a transistor connected to the output 2 of the CD4066.
This transistor is connected to a DC-DC converter to generate 12 V at its output.
Unfortunately, the converter draws too much current
The input is about 2,8 V and the output about 7 V instead of 12 V.

I have tried different high beta transistor (BC549 C, BC517, …) but the result is the same.
The CD 4066 switches correctly but it seems to have a too low output current when it is switching.
I can’t use a buffer at the output of the CD4066 because I need a progressive lighting.

Any solution please ?
 

Attachments

crutschow

Joined Mar 14, 2008
38,322
Does the LED have a series resistor to limit the current?
What is its voltage rating?

If the converter is overloaded, it would appear the LED doesn't have a resistor, and thus is drawing too much current.
Show the LED circuit.
 

Thread Starter

Philexium

Joined Oct 15, 2017
110
Does the LED have a series resistor to limit the current?
What is its voltage rating?

If the converter is overloaded, it would appear the LED doesn't have a resistor, and thus is drawing too much current.
Show the LED circuit.
Hi @crutschow

Nice to hear again from you.

Does the LED have a series resistor to limit the current? : yes
What is its voltage rating? : 12 V

The LED circuit is on page 2. When 12 V directly from the power supply is applied, it draws 40 mA
 

Attachments

Thread Starter

Philexium

Joined Oct 15, 2017
110
Does the LED have a series resistor to limit the current?
What is its voltage rating?

If the converter is overloaded, it would appear the LED doesn't have a resistor, and thus is drawing too much current.
Show the LED circuit.
Additional information

The reason I am using the ramp generator is to simulate an incandescent light bulb.
So the light decreases too when the circuit is powered off
 

crutschow

Joined Mar 14, 2008
38,322
Okay, I better understand the circuit now.
It would seem that Q1 is not getting enough base current to supply the collector current for the DC-DC input of a least 100mA from the 5V supply.
A typical transistor requires around 5-10mA base current to fully turn on for that collector current, and you are supplying perhaps 0.3mA.

You can add another transistor to make a Darlington stage, which will reduce the base current requirement by about a factor of a 100.

But I'm not sure limiting the DC-DC input in that manner will give you the LED dimming result you want.
 

Alec_t

Joined Sep 17, 2013
15,103
With a 5V supply the LM324 output voltage will be only about 3V.
If the LED draws 40mA at 12V, the converter will need an input current of at least 40mA x 12/3 = 160mA to give a 12V output when its input is only 3V.
I doubt that the converter will provide a ramp output in response to a ramp input, since it is a switch-mode device.

Edit:
I suggest you drive the converter directly from the 5V supply, then generate a 12V ramp from the converter output to dim the LED.
 
Last edited:

sparky 1

Joined Nov 3, 2018
1,218
Using a power supply to estimate the needed current draw as a DC equivalent is a good start.
With a completed step up converter for small scale power transmission a breadboarding procedure is possible.
I did not include the sequential startup but I can understand that you want to power things using 4066 switches
and might use a timing diagram. RR HO scale hobby, I tried to follow the logic focused at one node using arbitrary 500mW.

Why a real locomotive light is such a challenge for HO scale?

Ohm's Law Calculator
Enter 2 values: 5V and 500mW
The current is 100mA 500/5 = 100

Then Change the voltage to 12V
The current is 41.7mA 500/12 = 41.7

A simple switcher like LM2577 well documented 5V to 12V step up most RR HO scale requirements.
Not sure that the 52kHz is an advantage over DC rectified with down line (end of a section of RR track)
possibly could use some capacitor storage the converter has the soft start and current limiting, adaptable.
multiple output regulators, using a basic diy PCB and a hand full of through hole parts.
LM1577/LM2577 SIMPLE SWITCHER Step-Up Voltage Regulator datasheet (Rev. D)

The XL6009 datasheet some improvement and is low cost readily available
 

Attachments

Last edited:

eetech00

Joined Jun 8, 2013
4,704
Expanding on Alex_t suggestion, this should work.
The fade On/Off time can be tuned (R7,R10,C2). R9 is optional depending on 12v LED having internal current limiter.
The converter would have to powered at minimum duration of fade on+fade off time, or the fade off will be lost, but this could be satisfied by using a separate 5v power on/off switch.

1757376407078.png
 

sghioto

Joined Dec 31, 2017
8,633
Analog version idea using a LM358 to drive the LEDs
R5 and C2 control the ramp rate. With the values listed the fade IN-OUT is every 8 seconds.
C1 and R1 provide an appx 8 second delay when first powered ON.
Max output to the LEDs is appx 9.5 volts. To get 40ma the 750 ohm resistor values can be reduced if needed.
1757383402636.png
 
Last edited:

Thread Starter

Philexium

Joined Oct 15, 2017
110
Okay, I better understand the circuit now.
It would seem that Q1 is not getting enough base current to supply the collector current for the DC-DC input of a least 100mA from the 5V supply.
A typical transistor requires around 5-10mA base current to fully turn on for that collector current, and you are supplying perhaps 0.3mA.

You can add another transistor to make a Darlington stage, which will reduce the base current requirement by about a factor of a 100.

But I'm not sure limiting the DC-DC input in that manner will give you the LED dimming result you want.
Hello @crutschow
I have tried a BC517 darlington but the result is the same.
The DC DC converter output drops at about 7 V instead of 12 V.
Unfortunately, the converter draws too much current

I have made a test : connected directly to the 5 V of a power supply, the converter draws about 250 mA !!!
So I have to forget this converter and find a new circuit design !
 

Thread Starter

Philexium

Joined Oct 15, 2017
110
With a 5V supply the LM324 output voltage will be only about 3V.
If the LED draws 40mA at 12V, the converter will need an input current of at least 40mA x 12/3 = 160mA to give a 12V output when its input is only 3V.
I doubt that the converter will provide a ramp output in response to a ramp input, since it is a switch-mode device.

Edit:
I suggest you drive the converter directly from the 5V supply, then generate a 12V ramp from the converter output to dim the LED.
Hello @Alec_t

Thank you for your message and the calculation : yes you are right !
The DC DC converter output drops at about 7 V instead of 12 V.
Unfortunately, the converter draws too much current

I have made a test : connected directly to the 5 V of a power supply, the converter draws about 250 mA !!!
So I have to forget definitely this converter circuit and find a new circuit design !
 

Thread Starter

Philexium

Joined Oct 15, 2017
110
What exactly is the timing on the ramp generator and is it suppose to ramp up and down?
Hello @sghioto

The timing is about 5 s.
An infra red circuit sends a signal to drive the ramp generator with the LM358.
Yes it is supposed to ramp up when the infra red light is cut and down.

I really think I gonna give up with the DC DC converter ...
 

sghioto

Joined Dec 31, 2017
8,633
I agree on giving up on the DC converter.
Is the infrared circuit shown as V2 in the ramp schematic and what is this voltage?
When activated by the infrared does it ramp up and down or just what?
 

Thread Starter

Philexium

Joined Oct 15, 2017
110
Yes we both agree !:)
I have added on V3 the schematic to explain how the infra red detector works to drive the ramp generator.

I have made new tests : under 5 V a warm white LED draws 10 mA with a 100 Ohms resistor.
The LED ramp with 5 LEDS in parallel will draw now 50 mA.
With a transistor with a beta of about 200, a base resistor of about 10 k would be fine.

So that is what I am going to test :
I would replace the 750 Ohms resistors with 100 Ohms and power the LED ramp under 5 volts and that's it !
 

Attachments

Top