Again LED dimming and fading on

Thread Starter

Chillum

Joined Nov 13, 2014
546
OK, there's loads of information on the internet about LED throbbing circuits, none of which I could get to work, I tried RED and BLUE leds, but most of the throbbing circuits we're variations on the same 555 throbber. Now the only dimmer I could get to work is 409-1254421784-9c718363261fbb7d665830298c46f0cd.gif the one on the right, it's from a blog on this site: http://forum.allaboutcircuits.com/blog/leds-555s-pwm-flashers-and-light-chasers-index.378/ --------figure 5.2
now there's a curious effect, don't know if it is intended, D2 doesn't respond to the PWM signal (tried blue and red)

Now because PWM is the only way I could find that actually changes the brightness of a LED I'm thinking the circuit I require should be based on PWM, but I haven't learned enough (self study here) to build the circuit on my own...

Ultimately I need 2 out of phase variable speed throbbers (from 0 to bright) that connect's to a optocoupler's 2 infrared leds to replace the phototransistors of a photosensitive theremin, then ultimately build a fart piano, http://www.instructables.com/id/How-To-Build-An-Optical-Theremin/ In the video it shows how fading light onto the first phototransistor and then the second one produce a pretty real sounding fart sound!

Now any guidance will be appreciated, this is my long term project, but so far I've only been playing lego with other peoples circuits, I haven't done much designing myself. I kinda see you guys designing the circuits to be god-like!

PS. the only non infrared phototransistor I can get breaks the bank x4, dunno why they are so expensive in South Africa?
 

cmartinez

Joined Jan 17, 2007
8,257
Chillum,
There are many, many ways of building a PWM circuit without resorting to a 555 chip. And as you have probably seen already, the 555 circuit cannot normally be used in the full range of 0 t 100% PWM.

One good possibility is that you make a triangle wave oscillator, and then connect it to a voltage comparator. This chip would compare the basic voltage to your circuit against a voltage provided by a potentiometer connected as a voltage divider. The output of this circuit could then be connected to a bipolar transistor, or a mosfet, depending on the power (how many LED's) you wish to handle.
Start by googling "triangle wave oscillator circuit" and "comparator IC" and then we'll take it from there.

BTW.... there are plenty of people here that have my admiration and respect too... but none of them are God-like as you say (though some come close to be archangels ... :)) Anyway... in time you will notice that most of us have an area of expertise, and some have broader knowledge. I consider myself an almost-noobie... but I'm pretty sure I can help you with this. My point is, no one was born knowing electronics, and also no one knows everything there is to know either... we all have to start somewhere. With patience and time, this sort of projects will be like a walk in the park for you one of these days.
 
Last edited:

Thread Starter

Chillum

Joined Nov 13, 2014
546
OK I read MAXIM's tut on selecting comparators, pretty scary... I read 2 articles on generating a triangular wave both using LM741, and one on generating PWM using sine and sawtooth and another LM741; but I need a *how much volt*? sine wave?, guessing it could be a transformer not rectified or filtered. Or RATHER I need a sine wave generator that sweeps the speed of the PWM so I can fade my LED on. Am I going in the correct direction here?

PS triangular wave generators
http://www.circuitsgallery.com/2012/04/triangular-wave-generator-using-op-amp.html
http://www.pcbheaven.com/circuitpages/Triangle_Wave_Generator/
PWM:
http://www.circuitsgallery.com/2012/06/pulse-width-modulation-pwm-generator.html

EDIT the most difficult bit I see at the moment is I don't have a dual power supply, only +36V and a LM2576 3A 40V buck.
 

cmartinez

Joined Jan 17, 2007
8,257
OK I read MAXIM's tut on selecting comparators, pretty scary... I read 2 articles on generating a triangular wave both using LM741, and one on generating PWM using sine and sawtooth and another LM741; but I need a *how much volt*? sine wave?, guessing it could be a transformer not rectified or filtered. Or RATHER I need a sine wave generator that sweeps the speed of the PWM so I can fade my LED on. Am I going in the correct direction here?

PS triangular wave generators
http://www.circuitsgallery.com/2012/04/triangular-wave-generator-using-op-amp.html
http://www.pcbheaven.com/circuitpages/Triangle_Wave_Generator/
PWM:
http://www.circuitsgallery.com/2012/06/pulse-width-modulation-pwm-generator.html

EDIT the most difficult bit I see at the moment is I don't have a dual power supply, only +36V and a LM2576 3A 40V buck.
Ok... don't let yourself be intimidated by this stuff... let's take things one step at a time.
  1. What type of LEDs would you like to dim?
  2. How many LEDs would you like to control?
  3. What sort of power supply do you have readily available? Volts, Amps, power output?
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
I only need blue leds (blue was recommended by another poster for dimming circuit, so I bought lots, because transport to the supplier is a problem, which I always solve ;-) but now I have them (20) ) so, as I was saying; I need it only for status of what the infrared leds state is, if this is possible. The leds are infrared because its a dual optocoupler in a DIP8 package anode/cathode + anode/cathode on the one side and emmiter/collector + emmitor/collector on the other side. Ideally 8 notes that means 8 different speed settings for switching/fading on the LED and then out of phase fade on the second LED, but only one note at a time, and then the theremin in the article noted in the first post. I have a 36V 9.7A 360Watt bench PSU, but I'd (and now I see a solution for +V and -V, use 2 PSUs) like to use 2A or 2.5A switch mode 12V PSU or (I've got more of these) 5V (and I'm only sure that it delivers 1A, will still get off my * and test if it will deliver the advertised 2A). I can of course use 2 of the 5V USB chargers, the one to go +5V, and the other to go -5V (I have 10 of these chargers)

next step?

edit: question 1: infrared the blue is only extra, unnecessary if infrared works
question 2: 2 per channel, 8 channels, one at a time
question 3 USB charger 5V x10 available
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,257
Ok, let me get this straight...
  • You want to build a LED dimmer through PWM that would work in both blue and infrared LEDs, right?
  • You want this circuit two drive two LEDs in a complementary way, one would be on, while the other one off, and vice versa
  • You later want to couple these LED dimmer with an optical theremin.
  • You couldn't make the infrared LED that you have to get to work properly
Is that it?
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
1. Doesn't need the blue, topping... but yes
2. halfway through (adjustable) the first LED fading on; the 2nd one kicks in
3. yes, replace the phototransistors (2) with optocoupler; the optical theremin produces a realistic fart sound (see the video at the end of the link in the first post) to build a fart piano for my stepmom's sister's 6year old
4. haven't tested the infrared leds yet, don't know how, except with a fader that works (with the 555 fader that didn't fade my LED with or without infrared LED in series --- I figured if the infrared is in series with the blue then it HAS to fade WITH the blue --- it's in series... is that a wrong assumption?)
 

cmartinez

Joined Jan 17, 2007
8,257
1. Doesn't need the blue, topping... but yes
2. halfway through (adjustable) the first LED fading on; the 2nd one kicks in
3. yes, replace the phototransistors (2) with optocoupler; the optical theremin produces a realistic fart sound (see the video at the end of the link in the first post) to build a fart piano for my stepmom's sister's 6year old
4. haven't tested the infrared leds yet, don't know how, except with a fader that works (with the 555 fader that didn't fade my LED with or without infrared LED in series --- I figured if the infrared is in series with the blue then it HAS to fade WITH the blue --- it's in series... is that a wrong assumption?)
I'm not sure why you want to replace the phototransistors with an optocoupler, since the former would allow you to interact with the device freely, while the latter is normally encapsulated and is normally used to isolate circuits.... but oh well... no other quest can be nobler than building a fart piano... :)

Anyway, if you want to first build a complemtentary PWM circuit for LEDs, and if you want to build it using an infrared LED, there are several ways to test your LED. Here are two:
  • Method #1, find yourself a smartphone (Samsung should do it, but definitely NOT an iPhone) and point its camera to your TV's remote. Look at your smartphone's display while pointing the remote at its camera, and press the remote's buttons... see what happens... You see, some (but not all) smartphones' cameras are sensitive to infrared frequencies and react accordingly. If you can make this trick work, then you're all set to connect your IR LED in series with a 330 or 470 ohm resistor to a 5V power supply and test if it's lighting up or not.
  • Method #2, connect your IR LED in series with a 330 or 470 ohm resistor in series to a 5V power supply, and measure the voltage across its two terminals. You should get a reading of about 3.8V since most IR LEDs have a voltage drop of 1.2V. If you get a reading of 5V that means that either your LED is busted or it's not properly connected
No, your assumption is not wrong. If you connect both LEDs in series, then both should light up, or not at all if they're not properly polarized or damaged. I guess that would be another way to test your infrared LED. The worse that would happen is that your blue LED won't burn as brightly because of the voltage drop of both LEDs together.... just connect them in series to a 5V power supply with a 330 ohm resistor, even a 220 ohm should be ok in this case.
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
visible light phototransistor would be ideal but they cost in excess of R150 each (a 0.1uF Ceramic cost R0.28);
The infrared LEDs are INSIDE the optocoupler/optoisolator, so that disqualifies Method 1, will try method 2 tomorrow, but then I only know that the optocoupler works, doesn't really bring me closer to designing the circuit.
Thanks!
off to bed its an hour past my bedtime (00h00) continue tomorrow?
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
Hi cmartinez, I'm only going to be able to work on my electronics past 18h00 (GMT+2) and Eskom, our humble nuclear powerplant, who neglected to maintain their hardware, are predicting blackouts from 16h00 through to 22h00, so I might not be able to continue my journey of learning tonight... but you'll help me when I get back ;-) please and thank you. (hopefully I'll just be the normal 2h blackout per area) anyway, I'll try to be here if I can.

PS s*t, the touch up solderwork, how the * am I going to do that? (one of the power connectors -- ground of the 9V battery clip on MrChips' gate alarm broke off, easy, single wire solder, oh and of course desolder the remains of the previous piece of the connection wire)
 
Last edited:

Thread Starter

Chillum

Joined Nov 13, 2014
546
Still no 2h blackout, maybe we'll be 18h00 to 20h00.

Method 3: the reason for the blue LEDs, connect it in serie with the optocoupler's infrareds
Result: both works
 

cmartinez

Joined Jan 17, 2007
8,257
Another question, what do you mean by having one led fade in and the other fade out?
Do you mean to gradually turn them on and off (in a complementary way), or do you mean to simply switch them on and off (in a complimentary way)?
Is this the sort of circuit that you want, but with an additional complimentary LED?
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
that's almost exactly what I want, the fading should stop at brightest, and I need one shot, reset by keypress, and 0.5s-2s after the first LED started, the second LED starts ending in its brightest state a variable time after the first LED ends in its brightest state (also with a variable time duration for turning up to it's brightest) did you watch the video at the end of the theremin link in the first post? It'll give you a very clear idea of what I'm trying to mimic... a hand fading light onto the first transistor and then moving his hand further to shed light on the second transistor?
 

cmartinez

Joined Jan 17, 2007
8,257
that's almost exactly what I want, the fading should stop at brightest, and I need one shot, reset by keypress, and 0.5s-2s after the first LED started, the second LED starts ending in its brightest state a variable time after the first LED ends in its brightest state (also with a variable time duration for turning up to it's brightest) did you watch the video at the end of the theremin link in the first post? It'll give you a very clear idea of what I'm trying to mimic... a hand fading light onto the first transistor and then moving his hand further to shed light on the second transistor?
Haven't seen it yet, but I will tonight. Gotta go to work. I'll follow up later, promise.
Have a good one!
 

cmartinez

Joined Jan 17, 2007
8,257
that's almost exactly what I want, the fading should stop at brightest, and I need one shot, reset by keypress, and 0.5s-2s after the first LED started, the second LED starts ending in its brightest state a variable time after the first LED ends in its brightest state (also with a variable time duration for turning up to it's brightest) did you watch the video at the end of the theremin link in the first post? It'll give you a very clear idea of what I'm trying to mimic... a hand fading light onto the first transistor and then moving his hand further to shed light on the second transistor?
Can you make a graph of what you want? Say x axis would be time, and y axis would be brightness, using two different color lines, one for each led. That way both you and me will have a perfect picture of the results you want.
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
The results unfortunately cannot be determined yet, I have to play a setting, see what it sounds like then adjust, see what it sounds like, etc

I dont have the phototransistors, so I cannot even experiment with my hand to see what setting I need for each of the 8 notes, and if possible, I'll try and make it an octave of 8 notes like a real piano, know that will take a lot of tinkering and effort, but I do it properly or not at all ;-)

I can tell you the dimensions I need:

speed of fading up the first LED
delay before second LED starts fading up and of course
the speed of fading up for the second LED
 

cmartinez

Joined Jan 17, 2007
8,257
Exellent, that's what I needed to see.... now, you press a button, and I assume you hold it, then both leds reach maximum brightness, and then it all ends when you release it, right?
Also, you'd like to be able to adjust the slopes of both leds independently, right?
 

Thread Starter

Chillum

Joined Nov 13, 2014
546
Exellent, that's what I needed to see.... now, you press a button, and I assume you hold it, then both leds reach maximum brightness, and then it all ends when you release it, right?
Also, you'd like to be able to adjust the slopes of both leds independently, right?
Yup, adjust both slopes, and adjust the delay of the second led's slope kicking in
 
Top