PWM with Hex Schmitt Trigger: I'm confused

Wendy

Joined Mar 24, 2008
23,796
At this point the OP is only flashing one LED, and was last stated he was using a 5V in lieu of planned wall wart, so the 5VDC is firm. It is the reason for the low voltage circuitry. He also wants a fader, not just a PWM modulator. If he was using 9V the earlier faders would have worked OK, you came in late on this thread.

I think I have you beat in functionality and parts count this time. 4 resistors, 2 capacitors, and one transistor, and 2 chips. If he wants a 3 channel fader it would be 10 resistors 4 capacitors, 3 transistors, and still 2 chips.

Yours would require 12 resistors, 2 caps, one transistor the OP would have to acquire (he already has these) and one chip. 3 channels for RGB is 26 resistors, 4 caps, 3 transistors, and 2 chips. Parts count and complexity is still in my favor.
 
Last edited:

Thread Starter

DaedalusYoung

Joined Sep 29, 2010
13
Thanks guys, it looks great!
Bill, regarding the frequency, during my research, I came across this page: [link]. It says the frequency of a Schmitt oscillator is \(f = {\frac{1.2}{RC}\) with f in Hz, R in Ohm and C in Farad.
My LEDs are rated 3.5V at 25mA, but should still function at 20mA, but I suppose I could just change R4 if needed, or if I use two LEDs for example.
 

bertus

Joined Apr 5, 2008
22,937
Hello,

R4 can be easely calculated.
The value is :

(Vsupply - Vled - Vtransistor)/wanted current

Assuming Vsupply = 9 Volts
Vled (red) = 2.0 Volts
http://www.oksolar.com/led/led_color_chart.htm
Vtransistor = 1 Volt
Wanted current = 20 mA

(9 - 2.0 -1)/0.02 = 300 Ohms.
The next higher values are 330 or 360 Ohms.(depending what Eseries)
http://www.educypedia.be/electronics/resistancevalues.htm

This is a link from the EDUCYPEDIA on component codes:
http://www.educypedia.be/electronics/datacomponent.htm

Bertus
 

Thread Starter

DaedalusYoung

Joined Sep 29, 2010
13
Oh thanks. I knew how to calculate R for LEDs, but I would've completely forgotten the transistor V drop. Where in the datasheet could I find that, because it's full of info, but as we say in the Netherlands, I can't make cheese of it ;)
Anyway, my LEDs are 3.5V 25mA, and if I want 2 of them in series, they both drop 7V, the transistor 1V, so I assume then, so with a Vsupply of 9V, I have 1V left. 1/0.025 = 40, so a 47R would be used.
But what if I have LEDs in parallel, I would calculate R values for each separate string of LEDs, but now they share a transistor. Do I divide Vtransistor by the number of parallel strings? (see attachment)

And while I'm writing this, what's the purpose of R3? Is that when the comparator outputs high, this pushes current to the transistor? Do I change its value when I need to have more mA going through the LEDs in a parallel configuration?

Also, is my understanding correct this will oscillate the LED's perceived brightness at a rate of about 0.5Hz (or differing frequency if R2 is variable)? If so, if I would want to manually set a fixed brightness, would I just make a voltage divider out a potmeter instead to input comparator's -in?

Thanks everyone so far for your answers, it's very, very helpful!
 

Attachments

bertus

Joined Apr 5, 2008
22,937
Hello,

The Voltage drop of the tansistor will be the same for all strings.
If the leds are the same in each string the resistors will also be.

R3 is needed as the output of the comparator is an "open collector".
Without the resistor the output will not go "high".

Bertus
 

Wendy

Joined Mar 24, 2008
23,796
Oh thanks. I knew how to calculate R for LEDs, but I would've completely forgotten the transistor V drop. Where in the datasheet could I find that, because it's full of info, but as we say in the Netherlands, I can't make cheese of it ;)
Anyway, my LEDs are 3.5V 25mA, and if I want 2 of them in series, they both drop 7V, the transistor 1V, so I assume then, so with a Vsupply of 9V, I have 1V left. 1/0.025 = 40, so a 47R would be used.
But what if I have LEDs in parallel, I would calculate R values for each separate string of LEDs, but now they share a transistor. Do I divide Vtransistor by the number of parallel strings? (see attachment)

And while I'm writing this, what's the purpose of R3? Is that when the comparator outputs high, this pushes current to the transistor? Do I change its value when I need to have more mA going through the LEDs in a parallel configuration?

Also, is my understanding correct this will oscillate the LED's perceived brightness at a rate of about 0.5Hz (or differing frequency if R2 is variable)? If so, if I would want to manually set a fixed brightness, would I just make a voltage divider out a potmeter instead to input comparator's -in?

Thanks everyone so far for your answers, it's very, very helpful!
I just noticed you had some unanswered questions.

Last word is you were using a 5V power supply. If you are using 9V then you can have two LEDs in series, with 5V it isn't practical, but you can have 4 LEDS/resistors in parallel. R3 turns Q1 off, I think I said that. The input on the comparator is a voltage controlled input, so the potentiometer would work fine.

Wookie's schematic on post #20 would also work well.
 

Thread Starter

DaedalusYoung

Joined Sep 29, 2010
13
Last word is you were using a 5V power supply. If you are using 9V then you can have two LEDs in series, with 5V it isn't practical, but you can have 4 LEDS/resistors in parallel.
Yes, I used 5V to power the IC, but with the 40106 I can use full 9V.

R3 turns Q1 off, I think I said that. The input on the comparator is a voltage controlled input, so the potentiometer would work fine.

Wookie's schematic on post #20 would also work well.
Thanks, yes, then I did understand it correctly. The schematics also are clear to me. So I'll order some more components and I'll get this circuit working :)

Thanks once more, I truly hadn't expected so much help. I initially just asked how that circuit worked and you came up with entirely new circuits, that's just amazing!
 
Top