Blinking LEDs out of phase

Started by samhay, February 24, 2013, 06:42:50 AM

Previous topic - Next topic

samhay

Over in the 4069 thread, Jimi requested a schematic get two LEDs to flash perfectly 180 degrees out of phase, and to be able to control the speed. Didn't want to derail the thread, so started this one.

Here is how I would do it, but not sure it is the best approach. It is how my optical compressor works (http://www.diystompboxes.com/smfforum/index.php?topic=101118.0).
The snippet of interest is the last op-amp and you can increase the LED brightness by reducing R6 down to 100R. The rest is biasing and a phase shift oscillator (vary e.g. R3 to change the frequency and other op-amp oscilltors should work). If it glitches the power supply too much, put a small (nF ish) ceramic cap across the LEDs like in the compressor.



A circuit simulation is also here:
http://www.falstad.com/circuit/#%24+1+5.0E-6+10.20027730826997+61+10.0+50%0Aa+224+240+352+240+0+15.0+-15.0+1000000.0%0Aw+224+224+224+176+0%0Aw+352+176+352+240+0%0Aw+352+240+352+304+0%0Ar+352+304+224+304+0+100000.0%0Aw+224+256+224+304+0%0Ar+224+304+128+304+0+100000.0%0Ag+128+304+128+336+0%0Ac+224+176+128+176+0+1.0E-6+5.031289115000884%0Ag+128+176+128+208+0%0Aa+432+256+560+256+0+15.0+-15.0+1000000.0%0Ar+352+240+432+240+0+100.0%0Ag+432+272+432+288+0%0Aw+432+240+432+176+0%0Aw+560+176+560+256+0%0Aw+560+176+560+128+0%0Aw+432+128+432+176+0%0A162+432+176+560+176+1+2.1024259+1.0+0.0+0.0%0A162+560+128+432+128+1+2.1024259+1.0+0.0+0.0%0A174+224+176+352+176+0+10000.0+0.41090000000000004+Resistance%0Aw+288+160+288+128+0%0Aw+288+128+224+128+0%0Aw+224+128+224+176+0%0Ao+11+64+0+35+20.0+0.2+0+-1%0A

Edit: Jimi - only one LED is on at a time. Iis this what you wanted, or do you want one to get brighter as the other dims?
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

R.G.

Quote from: samhay on February 24, 2013, 06:42:50 AM
Edit: Jimi - only one LED is on at a time. Iis this what you wanted, or do you want one to get brighter as the other dims?

If you want a linear cross fade, you can do that with an emitter current biased diffamp. Three NPN transistors and some biasing stuff and the diffamp pair keeps the sum of the two collector currents the same all the time. An LED in each collector shows the current in that transistor.

The bases go from on transistor full on, the other off and vice versa with a +/-25mV difference in the base voltages. You input your LFO through a resistor divider to make it cross fade one above/below the other by that amount and you get smooth transitions if the LFO waveform has smooth transitions. If you drive it with a square wave, they blink back and forth. The total current through the power supply is always constant.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

pinkjimiphoton

Quote from: samhay on February 24, 2013, 06:42:50 AM
Over in the 4069 thread, Jimi requested a schematic get two LEDs to flash perfectly 180 degrees out of phase, and to be able to control the speed. Didn't want to derail the thread, so started this one.

Here is how I would do it, but not sure it is the best approach. It is how my optical compressor works (http://www.diystompboxes.com/smfforum/index.php?topic=101118.0).
The snippet of interest is the last op-amp and you can increase the LED brightness by reducing R6 down to 100R. The rest is biasing and a phase shift oscillator (vary e.g. R3 to change the frequency and other op-amp oscilltors should work). If it glitches the power supply too much, put a small (nF ish) ceramic cap across the LEDs like in the compressor.



A circuit simulation is also here:
http://www.falstad.com/circuit/#%24+1+5.0E-6+10.20027730826997+61+10.0+50%0Aa+224+240+352+240+0+15.0+-15.0+1000000.0%0Aw+224+224+224+176+0%0Aw+352+176+352+240+0%0Aw+352+240+352+304+0%0Ar+352+304+224+304+0+100000.0%0Aw+224+256+224+304+0%0Ar+224+304+128+304+0+100000.0%0Ag+128+304+128+336+0%0Ac+224+176+128+176+0+1.0E-6+5.031289115000884%0Ag+128+176+128+208+0%0Aa+432+256+560+256+0+15.0+-15.0+1000000.0%0Ar+352+240+432+240+0+100.0%0Ag+432+272+432+288+0%0Aw+432+240+432+176+0%0Aw+560+176+560+256+0%0Aw+560+176+560+128+0%0Aw+432+128+432+176+0%0A162+432+176+560+176+1+2.1024259+1.0+0.0+0.0%0A162+560+128+432+128+1+2.1024259+1.0+0.0+0.0%0A174+224+176+352+176+0+10000.0+0.41090000000000004+Resistance%0Aw+288+160+288+128+0%0Aw+288+128+224+128+0%0Aw+224+128+224+176+0%0Ao+11+64+0+35+20.0+0.2+0+-1%0A

Edit: Jimi - only one LED is on at a time. Iis this what you wanted, or do you want one to get brighter as the other dims?

thanks sam, this looke pretty close to what i'm looking to do. i also am looking at this: http://sound.westhost.com/project49.htm and tim e's wobbletron/bearfoot fx's magnavibe.
ideally, fading led's is probably best, i think i need a triangle wave to do this, not a square wave.. tho i don't think it will really matter in this application.
i'm still trying to find a way to get a sound similar to the old blonde fenders for a bud who's jonesin' for that tone. my bro mike is building a custom amp for the guy, and we wanna implement a version of that kinda vibe into the amp... but without all the room required for the extra tubes and stuff.

i'll try this on my breadboard, and see what i can do.. i really appreciate the help bro! ;)
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

pinkjimiphoton

Quote from: R.G. on February 24, 2013, 10:11:35 AM
Quote from: samhay on February 24, 2013, 06:42:50 AM
Edit: Jimi - only one LED is on at a time. Iis this what you wanted, or do you want one to get brighter as the other dims?

If you want a linear cross fade, you can do that with an emitter current biased diffamp. Three NPN transistors and some biasing stuff and the diffamp pair keeps the sum of the two collector currents the same all the time. An LED in each collector shows the current in that transistor.

The bases go from on transistor full on, the other off and vice versa with a +/-25mV difference in the base voltages. You input your LFO through a resistor divider to make it cross fade one above/below the other by that amount and you get smooth transitions if the LFO waveform has smooth transitions. If you drive it with a square wave, they blink back and forth. The total current through the power supply is always constant.


hi rg,
i will try to google that up. i think i'm finally admitting to myself totally i am pretty clueless. i can do the monkey-see/monkey do kinda thing, and once in a while i get lucky adapting bits and pieces of other things. but this is way above my paygrade still. i'm a fair solderhand, but still a hack. ;)

i'm still trying to figure out a "sound alike" for the blonde fender (any luck with the kustom vibe by any chance?)... i built this recently, :


and it's a really simple design, and believe it or not, works really well. i gigged with it a few times LOUD and didn't experience any ticking, which i gather is fairly common.
i assume it's a square wave, but it sounds pretty good.. the led kinda fades in and out. i made a couple changes to the circuit shown as per paul (prr)'s suggestions..
made the 220k resistor 100k, made the 100u cap 1,000u, and used a 500k pot for the speed.

what i'd like to do is copy the buffered part of the circuit, and graft on a flip flopping led circuit. i was thinking a cap before the ldr to ground on one color led and a cap to ground after the other ldr  on a different color led may get me in the ball park, but i haven't got much of an idea how to implement it.
i googled up a bunch of different led flasher circuits, and got a few to work (and smoked a few pots and 2n3904's, too  :icon_mrgreen:) and tried a very simple implementation of my idea with the lo and hi pass filters, and it kinda works... but it ticks like a time bomb, and only seems to really do it's thing when the two led's are in sync. as soon as i turn the speed pot, i lose the sync... and can't get much response. it's a fine line between way too slow and mosquitoland. the only dual pot i had was a dual 100k linear, but i think it's too big.

do you by any chance have anything at geo or in your collection that could help me get a clue? i really appreciate all the help i get from you guys.
thanks!!  :icon_mrgreen:
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

pinkjimiphoton

sam, i'm looking at this and wondering, if i were to use passive hi and lo pass filters with a pair of ldrs, and had the ldrs only in the audio path, and made sure they DIDn't share ground.. like, the circuit's ground going to the negative of the power supply, but NOT connected to the audio ground, would i still get a tick?
i'm wondering if it could be done completely passively?

also.. i just watched the falstaff sim, that's wicked cool..
would i need a dual gang 100k pot in place of r3 and r4 for a speed control?
or is there a more elegant way to do it?

i was looking at this, too, which "swells" the led's in and out in sequence, and you can replace one resistor with a 100k pot.

i think the addiction is setting in again.... the diy jones.. gonna make it work. ;) GOT TO. ;)
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

R.G.

Quote from: pinkjimiphoton on February 24, 2013, 03:09:54 PM
i'm still trying to figure out a "sound alike" for the blonde fender
Is that like the Fender Concert?

Quote(any luck w ith the kustom vibe by any chance?)
Not yet. I haven't really had time to dig into it yet.
Quotewhat i'd like to do is copy the buffered part of the circuit, and graft on a flip flopping led circuit.
OK. That helps.

Quotedo you by any chance have anything at geo or in your collection that could help me get a clue?
I think I may. Look on the geofex index page for "Fender Pro Vibrato". I did a highpass/lowpass tremo based on the Fender Pro, but used the EA tremolo as the gain blocks. There are three different styles.

If you really want the LED/LDR based tremo, I can do some more hacking. The diffamp trick does a great job of doing two outputs out of phase, but it has some tricky requirements on the inputs that have to be satisfied to work. A dual opamp version may be less temperamental, but still needs some work. A good thing to do is to ditch the single transistor LFO for a single-opamp LFO in a similar style. That is - making a working unit is probably simpler with a redesign.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

pinkjimiphoton

Quote from: R.G. on February 24, 2013, 06:03:09 PM
Quote from: pinkjimiphoton on February 24, 2013, 03:09:54 PM
i'm still trying to figure out a "sound alike" for the blonde fender
Is that like the Fender Concert?

Quote(any luck w ith the kustom vibe by any chance?)
Not yet. I haven't really had time to dig into it yet.
Quotewhat i'd like to do is copy the buffered part of the circuit, and graft on a flip flopping led circuit.
OK. That helps.

Quotedo you by any chance have anything at geo or in your collection that could help me get a clue?
I think I may. Look on the geofex index page for "Fender Pro Vibrato". I did a highpass/lowpass tremo based on the Fender Pro, but used the EA tremolo as the gain blocks. There are three different styles.

If you really want the LED/LDR based tremo, I can do some more hacking. The diffamp trick does a great job of doing two outputs out of phase, but it has some tricky requirements on the inputs that have to be satisfied to work. A dual opamp version may be less temperamental, but still needs some work. A good thing to do is to ditch the single transistor LFO for a single-opamp LFO in a similar style. That is - making a working unit is probably simpler with a redesign.


yes please. i love the "compression" that the led/ldr combo seems to introduce. even if it's a square wave driving the led's, it seems to have a nice softness to it.
i think it will work. i did a rudimentary version that alternated, but i couldn't keep them in phase once i adjusted the speed pot.
which got me thinking maybe the way to do it is to use three led's and three ldrs, and three colours of led's... and in addition to hi and lo pass filters, may be a band pass filter to keep the middle full. but i think at that point it would start sounding more like a "phasered" tremolo kinda.

i do have the ersats fender trem from geo, but it seems just a little complex for me still to vero.
i like the idea of the simplicity of hotamp's circuit, it sounds "half like" what i'm looking for.
much like in music, i'm discovering distance makes depth applies with led's and ldr's.. a coulple millionths of an inch adjustment of angle and space between them can make a huge difference in how they work.

so if you could help me with this rg, understanding my understanding is fundamentally crippled and dense like it is, i'd appreciate it! thanks!
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

deadastronaut

hi jimi: heres another alternating fading led circuit....i swapped the 100k for a 100k pot..speed adjustable blah blah...works in my sim. :)



https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

samhay

I vote for a modern work-a-like too.
I would not suggest you try to use different colour LEDs to turn on LDRs with different colour sensitivities. There will be way too much cross-talk. Instead, just roll each LED with its LDR in e.g. shrink wrap or insulation tape.

Rob's schematic should work quite nicely. You can alternatively vary the rate by replacing the 47k resistor with a pot and if you bump the 100R LED resistors up a bit, you could use a single LED with each transistor.
By the look of things, it will give a triangle waveform (see e.g. here: http://www.play-hookey.com/oscillators/audio/function_generator.html). If you take the output from IC1b, you will get a square wave, which might be a bit choppy for a tremolo, but you can probably mix it with the triangle to get a funky waveform if you like.
Unless you use a rail-to-rail op-amp, the current through the LEDs will not quite get to 0. This might cause problems as the LEDs might not quite turn off completely. I will try and put one together on the breadboard tonight and see how it goes.

I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

pinkjimiphoton

thanks sam.
as soon as i box the 4069 distortion today, i'm gonna have a play with rob's circuit on the breadboard.
i was actually kinda counting on the cross talk between the leds to help with the "phaseyness" of the project, but i guess it shouldn't really matter.
my experimenting so far seems to show that a slight distance between led and ldr's seems to give a mellower trem; even with a square wave pulse driving them, they seem to fade in and out. maybe it's an optical illusion.
give yourself epilepsy playing with that fallstaff sym!! my bwain!!! why is it flopping on the floor? lol...
really appreciate the help guys.. will check in later hopefully.
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

deadastronaut

+1 on trying different colour leds man...(yellow might be best)...might be.

and yep led/ldr distance can make a real difference...suck it n see. ;)
https://www.youtube.com/user/100roberthenry
https://deadastronaut.wixsite.com/effects

chasm reverb/tremshifter/faze filter/abductor II delay/timestream reverb/dreamtime delay/skinwalker hi gain dist/black triangle OD/ nano drums/space patrol fuzz//

samhay

#11
Tried some things out on the breadboard last night - quite good fun, and the Mrs liked the blinking lights.
Rob's idea seemed to work nicely. My play on it is below. I used a TL072 and, as Rob suggested, I needed to use pairs of LEDs to get the voltage drop across them big enough to get above the rail voltage (1 LED would not quite go off). Pairs is cool anyway as you will get a set of indicators.
A switch to select either square or triangle waves would be a nice idea. Tying to mix these with a pot was not very useful.
I would suggest you do not vary the feedback resistance (R2) as this shifts the amplitude, and has knock-on effects. A limiting resistor (R3) and a pot pot between the op-amps (R4) worked well for me. You can tune the frequency range with C1 and a range switch with different caps is not a bad idea.

I like this enough to think about using it to drive something too - perhaps a tremolo with a sweeping cut-off filter.



Edit: Jimi - here is the ciruit simulation.

http://www.falstad.com/circuit/#%24+1+5.0E-6+19.056626845863+61+10.0+50%0Aa+80+240+208+240+0+9.0+0.0+1000000.0%0Aa+352+256+480+256+0+9.0+0.0+1000000.0%0Ar+208+240+288+240+0+100000.0%0Aw+480+176+480+256+0%0Ac+352+176+480+176+0+1.0000000000000001E-7+-1.120095509100862%0Aw+208+352+80+352+0%0Aw+80+256+80+352+0%0Ar+208+240+208+352+0+100000.0%0Aw+480+256+480+352+0%0A174+288+240+352+240+0+1000000.0+0.5198+Resistance%0Aw+480+352+368+352+0%0Ar+368+352+208+352+0+56000.0%0Aw+320+224+320+208+0%0Aw+352+208+352+240+0%0Aw+352+208+352+176+0%0Aw+480+256+512+256+0%0Aw+208+240+208+128+0%0Aw+288+240+288+208+0%0Aw+288+208+320+208+0%0At+576+160+624+160+0+1+-3.3799606912922258+0.6404804164807123+100.0%0A162+624+192+624+224+1+2.1024259+1.0+0.0+0.0%0A162+624+224+624+256+1+2.1024259+1.0+0.0+0.0%0Ar+624+256+624+304+0+100.0%0Aw+208+128+512+128+0%0AS+576+192+512+192+0+0+false+0%0Aw+512+256+512+208+0%0Aw+512+128+512+176+0%0AR+624+144+624+112+0+0+40.0+9.0+0.0+0.0+0.5%0AR+80+224+80+192+0+0+40.0+4.5+0.0+0.0+0.5%0AR+352+272+352+304+0+0+40.0+4.5+0.0+0.0+0.5%0Aw+624+176+624+192+0%0Ag+624+304+624+320+0%0Ag+720+304+720+320+0%0Aw+720+256+720+272+0%0AR+720+144+720+112+0+0+40.0+9.0+0.0+0.0+0.5%0Ar+720+144+720+192+0+100.0%0A162+720+224+720+256+1+2.1024259+1.0+0.0+0.0%0A162+720+192+720+224+1+2.1024259+1.0+0.0+0.0%0At+672+288+720+288+0+-1+5.620039308707774+-0.4946788718401365+100.0%0Aw+576+352+672+352+0%0Aw+672+352+672+288+0%0Aw+576+160+576+192+0%0Aw+576+192+576+352+0%0Ap+512+80+512+128+0%0Ap+512+256+512+304+0%0Ax+517+231+552+234+0+12+switch%0Ax+497+108+537+111+0+12+square%0Ax+494+286+537+289+0+12+triangle%0Ax+801+327+858+333+0+24+hello%0Ao+43+64+0+38+9.353610478917778+9.765625E-55+0+-1%0Ao+44+64+0+38+9.353610478917778+9.765625E-55+0+-1%0A


I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

duck_arse

pinkjimi, you should get yourself over to geofex and look up the "spiff up your ean tremolo" by r.g. it might be a useful thing for a second oscillator/led combo.

I modified the original circuit (much in the same style you use) to start or stop a trem, but the osc was a dual op-amp, and it did a strange, too long volume cut each time it started, in particular.
You hold the small basket while I strain the gnat.

R.G.

@ Samhay:
I messed with the LED-in-feedback setup that you started with. By splitting out one LED around two different opamps, and using different-phases of drive, I got a setup that will drive two opamps out of phase from zero to some resistor-settable current. I did this the formal analog computation way, so it uses a quad opamp for the full effect, but it contains adjustments for taking an LFO waveform from an existing LFO, and adjusting the DC level and scaling so the LEDs can go from full on to full off smoothly over quite a range.

A single LM324, some resistors, the LEDs, a trimmer for offset and another for gain to get the full range on the LEDS and you're done. It could probably be simplified, but I was trying to make it generally applicable.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

samhay

#14
R.G. - sounds promising, but I think I am going to have to see a schematic. I can get each LED to dim, but they are still on one at a time.

Edit - to clarify. This is not the case for Rob's dual BJT approach. This works quite well and both LEDs are on for all but the extremes of the LFO sweep.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

pinkjimiphoton

i'd really appreciate a schematic, cuz this is right over my head!! well, 90% of it.  :icon_redface:
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

R.G.

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

pinkjimiphoton

  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr

samhay

Ah - that makes sense. Nice job, thanks R.G.
I realised today that an inverting stage was probably involved but should have also realised you were using a single supply op-amp for a good reason. If I had read carefully, I would have also realised it used a quad PLUS the LFO op-amps. Now to marry the two...
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

R.G.

Yeah, you feed whatever LFO you have into it, and the adjustments let you scale and shift that to make the LEDs go full on to full off.

The LFO can be either a single opamp as in the Phase 90 or a two-opamp version. The MXR LFO is an integrator/Schmitt trigger that uses a capacitor as a stand-alone noninverting integrator.

All this sounds like a bit of a PITA to do, but it is very flexible to apply.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.