DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: artifus on February 27, 2011, 02:14:14 PM

Title: envelope/edge detection
Post by: artifus on February 27, 2011, 02:14:14 PM
looked at dr. q, nurse quacky, sea moon, dod 440, etc., found this (http://bertrik.sikken.nl/bat/convert.htm) and stumbled upon stuff like this (http://www.instructables.com/id/Lightning-effect-using-camera-flash-units/step3/The-circuit/) and am playing with triggering led's/controlling ldr's, etc.

what's your simplest, dirtiest, most minimalist method of lighting an led from the initial attack of a guitar/bass/input? so far going down the passive (cap) hpf route but wondered if anyone had any pearls of wisdom/experience/advice to impart. once lit i thought a simple pot/cap for decay. what about further envelope manipulation? ie - initial attack triggers led as does simultaneously triggered (pitch related?) osc/pulse which subsequently effect led. hope that makes sense. any thoughts?
Title: Re: envelope/edge detection
Post by: R.G. on February 27, 2011, 02:54:05 PM
Quote from: artifus on February 27, 2011, 02:14:14 PM
what's your simplest, dirtiest, most minimalist method of lighting an led from the initial attack of a guitar/bass/input? so far going down the passive (cap) hpf route but wondered if anyone had any pearls of wisdom/experience/advice to impart. once lit i thought a simple pot/cap for decay. what about further envelope manipulation? ie - initial attack triggers led as does simultaneously triggered (pitch related?) osc/pulse which subsequently effect led. hope that makes sense. any thoughts?
A passive guitar or bass does not have enough voltage or power from the pickups to drive an LED to light up in almost all cases. The most minimal way to do this is to amplify the pickup in some way to drive the LED. Transistors work, but an opamp circuit has the best chance of doing it with the simplest and smallest circuit.
Title: Re: envelope/edge detection
Post by: artifus on February 27, 2011, 03:29:56 PM
thanks r.g. i'm sorry i wasn't clear enough in my original post that i had taken that as a given. working with op amps and looking for the most efficient method of detecting the very edge of a plucked note/strummed chord to trigger the led without subsequent input interaction as the rest of the led's envelope would be dictated by c/r mentioned. thinking initial pick attack contains most hf hence hpf. maybe a timer (cap/555?) to delay retrigger. sorry. just thinking out loud - back to the books and breadboard. thanks for the reponse.
Title: Re: envelope/edge detection
Post by: deadastronaut on February 27, 2011, 03:44:22 PM
do you mean sound to light?..initially.!..

a 386 with leds on the output works fine...lights up when plucked..

Title: Re: envelope/edge detection
Post by: artifus on February 27, 2011, 03:54:07 PM
i've played with led's and 386's a few times with mixed results. often work for a few seconds (if at all) and then fail over time.
Title: Re: envelope/edge detection
Post by: Gurner on February 27, 2011, 03:56:41 PM
You requirements still aren't that clear - you want a guitar signal to trigger an LED, but you don;t want the fading guitar signal to turn the LED off....rather a 555 timer arrangement? (which on the face of it, sounds like a hammer to crack a nut)

So can you outline exactly when you'd like the LED to turn off in relation to the guitar pluck that turned the LED on?
Title: Re: envelope/edge detection
Post by: artifus on February 27, 2011, 04:07:20 PM
yeah sorry, being a bit vague, rushing and trying to do too many things at once. ok. been playing with triggering led with guitar and notice sustain and bass keep led lit after initial attack of note/chord resulting in random jitter/flicker on fade and was thinking about taking just the edge of the signal to trigger the led, as per norm, but from that point on have a pot defined decay/fade and/or waveform take over. with a view to applying to wah/filter/whatever pot you wanna hack it into. hope that makes sense. need sleep. should sleep. thanks.
Title: Re: envelope/edge detection
Post by: Gurner on February 27, 2011, 05:00:34 PM
If you don't want to go to the LM386 route (which is somewhat blunt, but at least it's condensed!),  I've just knocked you up a rough 'n ready eagle schematic which IMHO  outlines the minimum for what you need....

(I've asumed you want to use a single 9V supply, so the VCC/2 means you need to connect all those points to about 4.5V )

(http://img62.imageshack.us/img62/5157/ledcct.jpg) (http://img62.imageshack.us/i/ledcct.jpg/)

The opamp amplifies your signal (R2 & R3 set the gain, make R3 smaller for more gain), the diode rectifies it (only positive cycles get through), R4 sets the attack (in conjunction with C2...larger means less attack...ie slower for your LED to light up after you've plucked a string), the comparator trimpot sets the level at which the LED actually lights.

How long the LED takes to extinguish is dictated by R6.....( release), the lower in value you make R6, the quicker the LED will go out after you muted your string...& vice versa.
Title: Re: envelope/edge detection
Post by: R.G. on February 27, 2011, 06:00:58 PM
There's also the "note processing" article at GEO, which outlines something very much like what you mention Gurner.
Title: Re: envelope/edge detection
Post by: petemoore on February 27, 2011, 06:03:12 PM
  Perhaps some signal limiting via clipping diode's for the Env. Input to control the LED driver input voltage will also limit the output current...enough to work the goal and be reliable ? ..dunno, just thinking out loud...
  Another way might be to limit the PA current or voltage input to the 386, using the 386 itself and it's 'weak' power supply as 'current limiter' ? [you'd clip the 386 but it's not in the signal path, who knows what the LED'd make of it.
Title: Re: envelope/edge detection
Post by: artifus on February 28, 2011, 06:37:02 AM
thanks for all the input everyone. lot's to read, think about and experiment with. let you know how i get on.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 14, 2012, 09:26:04 PM
Quote from: Gurner on February 27, 2011, 05:00:34 PM
If you don't want to go to the LM386 route (which is somewhat blunt, but at least it's condensed!),  I've just knocked you up a rough 'n ready eagle schematic which IMHO  outlines the minimum for what you need....

(I've asumed you want to use a single 9V supply, so the VCC/2 means you need to connect all those points to about 4.5V )

(http://img62.imageshack.us/img62/5157/ledcct.jpg) (http://img62.imageshack.us/i/ledcct.jpg/)

The opamp amplifies your signal (R2 & R3 set the gain, make R3 smaller for more gain), the diode rectifies it (only positive cycles get through), R4 sets the attack (in conjunction with C2...larger means less attack...ie slower for your LED to light up after you've plucked a string), the comparator trimpot sets the level at which the LED actually lights.

How long the LED takes to extinguish is dictated by R6.....( release), the lower in value you make R6, the quicker the LED will go out after you muted your string...& vice versa.


old thread i know but i'll blow the dust off it... :)

@G: hi man, so this is an envelope detector then...if i rig this up to a wah filter led/ldr i have an envelope filter if i understand ya!...R4 could be an  attack  pot....?.........R5 trim sensitivity?...correcto!.. :)


erm....values to kick of with? ;)
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 07:31:21 AM
IC1A amplifies the signal, D1, R4 (attack), C2 & R6 (release) for the evelope detect part ...the latter part is a comparator & I glued it on to the end because artifus's requirements we to light up an LED whe a signal level is met (so I wouldn't recommend using the bits to the right of R6).

Re values R4, would need to be lowish value (something about 220R-ish might be a reasonable start), C2 about 4.7uf to 10uf  (to start)& R6 something like 1k-2k (you'd need to experiment), what I would do if you want to use that voltage to control something is tag a voltage follower to the right of R6....that stops an follow on circuit loading down the control voltage that sits on C2.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 08:21:50 AM
Cheers G:   like this?. (regardless of values)   i kept the numbering the same though for easy reference..

(https://dl.dropbox.com/u/7464107/ENVELOPER.jpg)

or should ther be a tranny on the end with the led?.
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 08:35:17 AM
Sort of!

A couple of immediate obs...

All points on my circuit were at Vref (i.e. VCC/2 ....so no grounds involved)...therefore C2 & R6 goto Vref as does the cathode of the led.....tbh, the cathode should really go to Vref-fwd voltage of the led. So if your led is red with a fwd voltage of 2V, therefore the cathode should sit at vref -2V (the original cct I furnished was to either switch an led on or off, but what you probably seek is a nice smooth fade from max brightness to extinguished)...now that I can see what your ultimate goal is, it's probably not the way to approach.

The Vref should be low impedance (two resistors won't cut it), therefore feed the junction of R7 & R9 into a voltage follower....the output of that becomes your vref

there should be a resistor in series with the LED
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 08:49:16 AM
image above updated...probably wrong still though.. ;D

excuse my ignorance!.. :)
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 09:11:39 AM
Quote from: deadastronaut on October 15, 2012, 08:49:16 AM
image above updated...probably wrong still though.. ;D

excuse my ignorance!.. :)

The diagram looks better now, but like I said earlier, the Vref (VCC/2) needs to be low impedance....so rather than connect everything back to the junction of R7 & R9, that junction should feed into a voltage follower & then everything connects to the output of the voltage follower.

R5 could probably be lower...it'll depend on the led & ldr you are driving.

R8 & R9 need to be 1M.

R2 should be about 10k (this would give a gain of about 10x)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 09:26:56 AM
hmmm....image updated,  don't laugh!.. ;D :icon_redface:


btw my internet is being a right b....d.......keeps cutting off.. ::)
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 10:06:03 AM
Quote from: deadastronaut on October 15, 2012, 09:26:56 AM
hmmm....image updated,  don't laugh!.. ;D :icon_redface:


btw my internet is being a right b....d.......keeps cutting off.. ::)

Looking better....R1 & R8 still need to be at least 1M though (assuming you are feeding a guitar straight into the circuit), then assuming that change C1 needs to be at least 10nf (but I'd shoot for 33nf or higher).

I'm still non too certain about the use of the circuit for your intended application...obviously this is only a simplae half wave envelope detect circuit so there'll be a fair degree of AC ripple present on the LED anode....whether that has any audible impact to the circuit you are driving would need to be ascertained.

A lot of components to tweak to suit ...if more gain needed increase R2, if less attack needed increase (slower response) increase R4, if a snappier release needed decrease R6 (though there's a limit how low you can really go here), if led too dim when guitar played R5 (or increase circuit gain by making R2 larger), etc, etc....so this is very much just to get you in the starting zone...also once you establish the best values (using swap & replace methods!) you could put pots in place for attack & release. 
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 10:14:46 AM
updated:

i'll give it a go and see if the led, 'ripples' ..flickers on the dying out...

so if i swap R4 and R6 for pots i should be able to adjust attack,release?...
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 10:16:52 AM
Quote from: deadastronaut on October 15, 2012, 10:14:46 AM
updated:

i'll give it a go and see if the led, 'ripples' ..flickers on the dying out...

so if i swap R4 and R6 for pots i should be able to adjust attack,release?...

yes, but I'd put some series resistance in situ in that case (rather than just a pot) ...so a small value resistor followed by a pot - that way at least when the pot is fully turned & presents zero resistance, then at least you've still got some resistance in play via the additional resistor I'm speaking of.

One other point a TL072 should be able to drive the LED, but it hasn't that much brute force in reserve, (there are better opamps out there), but nevertheless it should still work.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 10:24:46 AM
cheers for your help G. ;)

i have other opamps 358's 5532's etc...i'll try those too..

nice one...i'm on it now!!.. :icon_cool: :icon_cool: :icon_cool:
Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 10:58:37 AM
Quote from: deadastronaut on October 15, 2012, 10:24:46 AM
cheers for your help G. ;)

i have other opamps 358's 5532's etc...i'll try those too..

nice one...i'm on it now!!.. :icon_cool: :icon_cool: :icon_cool:

The main problem I foresee, is that the signal is going to have to charge up C2 to the 'fwd voltage' of the LED before it starts to conduct (this is why I said a few posts back that the cathode should really be sitting at a voltage of Vref minus the fwd voltage of the led, so for a red led, the cathode should probably be sitting at about 2.5V)

On a 9V supply, red led, with no guitar signal both the LED anode & cathode are sitting at 4.5V, the signal arrives, the cap C2 starts charging up, but the led won't turn on until it has charged up Vref+2V (6.5V)   ....how this works in practice....dunno - like I say, you're taking a circuit that I was recommending for an LED on/off requirement (vs. a smooth fadeout from max brightness to led extinguished ...relating to incoming guitar signal)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 11:07:31 AM
no worries i'll try it and see what happens......that's if i can see, my overhead bulbs have just gone!!!! arghhhhhhhhhh.....ffs..... ::)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 15, 2012, 12:18:07 PM
yep tried it, checked connections, kept bottom rail seperate,  no led response though , tried standard red/ super blue led......

i used a 1n914 diode..


Title: Re: envelope/edge detection
Post by: Gurner on October 15, 2012, 01:56:20 PM
Quote from: deadastronaut on October 15, 2012, 12:18:07 PM
yep tried it, checked connections, kept bottom rail seperate,  no led response though , tried standard red/ super blue led......

i used a 1n914 diode

If you've a dvm, remove the LED & put the dvm on the output pin of the final opamp that drives the led .......plug in an input signal to the cct - you should have about 4.5V when the input signal is silent & this voltage should  rise when you put a signal into the circuit.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 04:36:10 AM
hi G:   yep i pulled the led out,  i put my DMM + on the output pin 7, and the - lead to ground (instead of botom rail VCC2) ...getting 4.54v with no signal

which raises  to 5.60v when strummed/whacked really hard...

when DMM ground lead is on bottom rail VCC2 , 0.00 with no signal , then when guitar strummed 1..10v....
Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 04:47:01 AM
Quote from: deadastronaut on October 16, 2012, 04:36:10 AM
hi G:   yep i pulled the led out,  i put my DMM + on the output pin 7, and the - lead to ground (instead of botom rail VCC2) ...getting 4.54v with no signal

which raises  to 5.60v when strummed/whacked really hard...


That's only a difference of 1.1V (between quiescent = 4.5V & strummed hard= 5.6V, you'll need much more DC voltage swing than that (a red led will only start lighting up with 1.9V)...... try increasing the gain of the 1st opamp (up R2 in value), you will need at least 3V of swing (therefore the output of the first opamp should get to about 7.5V)....you should only use a red led here. (& ideally you want a rail to rail opamp, not a TL072)

Quote from: deadastronaut on October 16, 2012, 04:36:10 AM
when DMM ground lead is on bottom rail VCC2 , 0.00 with no signal , then when guitar strummed 1..10v....

This doesn't make sense (perhaps I'm not understanding the way you've measured it) ......VCC/2 should measure 4.5V & not stray when the guitar is plucked. Can you clarify?

edit: last bit deleted pending me checking my facts!.


Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 05:27:06 AM
morning... ;D

i raised the R2 all the way up to 1M , led lights when plucked , but only just...not full bright...


clarification/re-measure:  with led taken out, and DMM + from out of ic.(pin7) .and DMM - Lead from where led - was (bottom rail not -ve rail).... i now get oscillating voltages.

in the range of 0.33 to 0.75....when not plucked....when plucked i get 1.6v..


opamp sugestion?..i'll see if i have a couple...
Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 05:49:23 AM
Quote from: deadastronaut on October 16, 2012, 05:27:06 AM

i raised the R2 all the way up to 1M , led lights when plucked , but only just...not full bright...

1M is a tad excessive! I wouldn't go any higher than 47k (& even then that's excessive).....that's a gain of approx 50. (meaning once your initial pluck transient has died to a say a 200mV AC signal level, the output of the 1st opamp preamp should be a signal of about 10V...which of course is impossible with a 9V supply & non rail to rail opamp). I think you're being imapcted by the TL072's output inability to swing to rail here...meaning the cap can't get charged sufficiently, meaning not enough swing on the LED anode.


Quote from: deadastronaut on October 16, 2012, 05:27:06 AM
opamp sugestion?..i'll see if i have a couple...

I seldom work with 9V opamps (normally 5V), so I have no immediate suggestion....I'm sure others can suggest a rail to rail opamp capable of 9V supply though.

Edit,
I've just spotted an error with your schem...the cathode of the diode D1 should not go to VCC/2 take it out!

Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 06:08:50 AM
yeah i spotted that line mistake after the diode yesterday...its not there... ;)


it goes straight to the cap/resistor..

edit.

i was looking at this and thinking of ripping just the attack/sense off this tried n tested envelope but just adding my own filter to it...

might be easier.....erm....he says... ;D...it'll handle most opamps by the look.

http://www.muzique.com/schem/quack.gif


Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 06:19:22 AM
Another plan of attack  - which might be better for what you seek (& you wouldn't need a rail to rail opamp)  & it's quite quick....

1. Make  R7 = 7.2k & R9 = 1.8k (or if you don't have those values, then approximate multiples thereof so 15k/3.6k, 33k/15k etc)....what you're shooting for is the output of the R7/R9 junction to be about 1.8V

2. Connect the LED cathode to ground (not VCC/2) ....you should use a RED LED.

Ok, now you've got a situation where with no signal the LED anode should be at about 1.8V (so if a red led is used, then just off, becuase it normally needs 2V), guitar signal arrives & that last opamp DC voltage will increase a fair bit (you might wish to decrease the gain of the first opamp stage and use a higher value LED series resistor initially, else there's a chance your LED might get stressed!)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 06:38:08 AM
edited.

i stuck the led to ground,




right i have 1.81v on the junction,  i used a 22k/5.6k...
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 07:04:31 AM
ok i have 1.84v on the juncton.


i changed the resistor led to 1k.

and left the R2 gain resistor at 10k...

i now have sound to light......led is off with no signal, .but i have to whack guitar hard to get it to light....getting there.. :)


changing the gain R2 from 100r to 47k doesn't change the intensity...


i now have this:

(https://dl.dropbox.com/u/7464107/envelope2.jpg)
Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 07:19:00 AM
So try increasing the value of R8 up at touch until the RED LED is visibly faintly on...then reduce the resistor back  a little (we are try to get the LED biased just off with no signal)...it might need nearer 2V.....also try reducing the LED series resistor (R5) a tad, & also up R6 to something like 4.7k to stop the cap draining so quickly.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 07:43:16 AM
R8 now at 2.2M..

led resistor at 470r

R6, is pretty cool to adjust, on 68k it has a nice smooth fade...no flickering... :icon_cool:.(.lower resistor quicker fade etc..(pretty cool, that'll be nice with the filter.) (i'm using my resistor sub box to switch R'S).. ;)



still takes a good hard whack to get it lit though.(but does go bright)....led still completely off when no signal....

Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 10:07:23 AM
Quote from: deadastronaut on October 16, 2012, 07:43:16 AM

still takes a good hard whack to get it lit though.(but does go bright)....led still completely off when no signal....


That's because of the forward voltage drop loss of D1 (you are losing 0.7V across the diode, which is quite a percentage at these signal levels) ...if you use a schottky diode for D1, there'll be less diode voltage loss, less whacking the strings to overcome the D1 voltage loss, which means the led will light earlier.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 10:15:52 AM
right gotcha...hmmm i don't think i have a shottky diode.....i have various diodes though...i'll try some others..

after tweaking around a bit (in between my cat smashing a vase of flowers on the floor..the b.....d ::))  i can see its a bit of a juggling act with voltage and led resistor to get it going properly..

but its much much better than the ol'386 mularky... ;)...very promising, i love the slow fade when R6 is upped...i can imagine a pot on there for sure... 8)

i'll have a twiddle with the attack R4 too...

i'm guessing an input buffer would kick it into being more responsive to a lighter pluck?...

maybe the other half of the voltage follower could be used?..hmmmm....thinking aloud..
Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 11:07:12 AM
the signal path is like thus...

Signal arrives from guitar....it's piddly so we need to amplify. That's what the first opamp does. An AC guitar signal obviously has a positive & negative cycle...but here we've thrown away the negative cycle (that's what D1 does).

So signal arrives at a post pluck (transient) level of say 200mV to 300mV, but gets whacked up to something workable ...ideally about 5V positive cycles only  (that's not gonna be possible with a tl072 biased at 2.0Vish ). Nevertheless let's shoot for about 30x gain (Therefore make R2 30kish or even a little higher). Ok, so now we dispensed with the negative cycle & we've about 5V of half wave rectified positive cycle AC signal to charge up the cap C2 with, but we'll lose some here too...probably best we can expect is something like 3.7V voltage swing on the cap....but that should be sufficient for the requirements.

Strategy...

1. try & find/source a rail to rail opamp.
2. Make the gain of the first stage at least 30X (therefore R2 about 33k & R3 1K)
3. try & source/use a schottky diode for D1.
4. Experiment with R5's value.
5. Tweak the value of R8 until the RED LED is just off with no signal (a pot in place of R* would be good toe set this level)

(I've just noticed another error on your schem.....on the last opamp the feedback loop from the output pin to the -ve input pin should not also go to Vref)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 16, 2012, 11:38:15 AM
yeah i didn't have that on breadboard that way...just my crappy drawing..fixed!.
(https://dl.dropbox.com/u/7464107/envelope3.jpg)


i might nip to maplin tomorrow,  can you suggest a schottky and rail to rail opamp?..

i'm running out of light, hopefully my bulbs for my overhead will arrive tomorrow..and i'll be able to see again.. ::) ;D

cheers G: i appreciate your patience man!.. 8) ;)


edit btw i tried using the opamp as a buffer...nopey nope nope... :)
Title: Re: envelope/edge detection
Post by: Gurner on October 16, 2012, 11:42:25 AM
still error on the schem - the led cathode goes to ground *not* vref.

Just about any small signal schottky will be better than what you're using (you want the lowest fwd voltage drop you can find for diode D1)

Re a rail to rail opamp....like I say I mainly work with 5V circuits so have none I' familiar with & can recommend (hopefully someone else can chime in)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 17, 2012, 05:50:02 AM
(https://dl.dropbox.com/u/7464107/envelope3.jpg)


edit:  morning.. ;D

i upped the R2 TO 56k..much more sensitive...

i'll try a pot on the r8 too in a bit...

i'll have to nip out and get a schottky.. :)....hmmm

http://www.maplin.co.uk/search?criteria=schottky
Title: Re: envelope/edge detection
Post by: Gurner on October 17, 2012, 06:02:47 AM
looking good. i would drop R5 to 470R or even 330R.......at 7v DC out of the last opamp, a 330R resistor for R5 would be about 20mA through the Red led (briefly)...so it's within saftey zone.


R6 likely needs to be increased (say 4.7k) & R2 something like 20k-33k
Title: Re: envelope/edge detection
Post by: deadastronaut on October 17, 2012, 06:36:47 AM
hmm not sure on which schottky to get though...i don't want to get the wrong one as maplins is several miles away from me now....(they closed my local one the b......ds ::))

http://www.maplin.co.uk/1a-schottky-barrier-rectifiers-46408

?
Title: Re: envelope/edge detection
Post by: Gurner on October 17, 2012, 07:36:44 AM
There's not a huge selection at Maplin, but the 1N5817 should yield a lowish forward voltage (look at figure 2 here  http://www.fairchildsemi.com/ds/1N/1N5818.pdf  ....the fwd voltage increases with current, but you should still be able to attain somthing las low as 0.3V with it)
Title: Re: Re: envelope/edge detection
Post by: slacker on October 17, 2012, 07:44:38 AM
This is just off the top of my head so it might not work but couldn't you put the diode in the feedback loop of the opamp, there by eliminating the loss due to the diode drop. Output to diode, diode to feedback resistor, with the output to the next stage from that junction. That would save the hassle of going to Maplin.
Title: Re: Re: envelope/edge detection
Post by: Gurner on October 17, 2012, 07:50:59 AM
Quote from: slacker on October 17, 2012, 07:44:38 AM
This is just off the top of my head so it might not work but couldn't you put the diode in the feedback loop of the opamp, there by eliminating the loss due to the diode drop. Output to diode, diode to feedback resistor, with the output to the next stage from that junction. That would save the hassle of going to Maplin.

Yes, that's often done to eliminate the fwd drop of the diode ....but that said, I've only ever seen it implemented in a unity gain opamp configuration  ...I ain't too sure of the impact of putting it in an opamp setup that has 30x gain - it might work...dunno! (also, all the associated circuits show bipolar supplies...so it'd likely need a bit of thought to implement in the single supply setup in use here)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 17, 2012, 08:11:02 AM
just tried it...no difference,  if i did it right that is... ::)


@ian: can you recommend a rail to rail opamp?....while i'm at maplins, i know there stock is limited, but hey in for a penny etc...
Title: Re: Re: envelope/edge detection
Post by: slacker on October 17, 2012, 08:12:23 AM
Yeah, the fact it has gain is why I couldn't decide if it would work or not.

Not sure Rob, had a quick squiz at their website and couldn't see any.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 17, 2012, 08:28:14 AM
ok, cheers man...no probs.

i was having a nose around...and found this...hmmmm...could i get this to force an led to respond to attack/release...smoothly..just wondering.

http://members.shaw.ca/roma/attack.html

Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 05:05:31 AM
morning, well i got my 1n5817's....amongst other bits while i was there..

but it still needs a good whack to get it to light....hmmmmm.... :)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 06:27:44 AM
hmmm just found this ...

http://www.diystompboxes.com/smfforum/index.php?topic=95116.msg822997#msg822997
Title: Re: envelope/edge detection
Post by: Gurner on October 18, 2012, 06:56:26 AM
Quote from: deadastronaut on October 18, 2012, 05:05:31 AM
morning, well i got my 1n5817's....amongst other bits while i was there..

but it still needs a good whack to get it to light....hmmmmm.... :)

Well don't fret....always good to have schottkys in your component selection box :-) (& they do help in this particular circuit) Are you sure your LED is *just* biased off (reduce the value of R7 until the LED is very faintly discernibly lit, & then increase R7 a tad until the LED looks off - a preset would be best for this)  ...also did you reduce R5 to say 330R?

I'd say you're now getting to the point were you need a little more 'controlled' conditions (whacking the guitar - whilst immediate & fun - ain't that scientific, lol)  - so maybe consider inputing a sig gen (use your PC sound card and siggen softwtare), slowly increasing the input signal amplitude, seeing what happens with the led & taking DC voltage measurements at the output of the final opamp.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 07:17:23 AM
lol...whacking a guitar into it is very scientific for me... :D

right i put a trim in place of  R7, trimmed, led is only just on now... :icon_cool:

led resistor is at 100r..


man i need a sig generator..

Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 07:29:46 AM
ok i just got a tone generator...installed...i'll take an output into the breadboard...what ideal freq shall i use?.

http://www.ringbell.co.uk/software/audio.htm
Title: Re: envelope/edge detection
Post by: Gurner on October 18, 2012, 07:33:17 AM
Quote from: deadastronaut on October 18, 2012, 07:29:46 AM
ok i just got a tone generator...installed...i'll take an output into the breadboard...what ideal freq shall i use?.

http://www.ringbell.co.uk/software/audio.htm

Anything between 100hz & 800Hz (a guitar goes lower....down to 82Hz & it also goes higher...upto about 1400hz)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 07:38:36 AM
cool, i chose 400hz...i have control from my headphone level..

its working ok... :icon_cool:


edit:  took the signal out of my mixer main out, at 0.3db..on the vu meter.   ;)

(https://dl.dropbox.com/u/7464107/envelope3.jpg)

Title: Re: envelope/edge detection
Post by: deadastronaut on October 18, 2012, 05:38:49 PM
right i gave up on that....cheers though.. ;)

i came up with this...it responds great, i tweaked a few values and it lights up to the slightest touch...nice and sensitive...and best of all uses a crappy old 072 yay!!!!whoohooo........(led on output) (both red leds)

it has quite a smooth fade too.. :icon_cool: :icon_cool: :icon_cool:

also works with superbrights.. 8)

(https://dl.dropbox.com/u/7464107/ENVELOPE4.jpg)

Title: Re: envelope/edge detection
Post by: Gurner on October 19, 2012, 04:43:03 AM
Quote from: deadastronaut on October 18, 2012, 05:38:49 PM
right i gave up on that....cheers though.. ;)

Hey, no worries ! As I said when you started...

Quote from: Gurner on October 15, 2012, 08:35:17 AM
(the original cct I furnished was to either switch an led on or off, but what you probably seek is a nice smooth fade from max brightness to extinguished)...now that I can see what your ultimate goal is, it's probably not the way to approach.

That said, much of your latest circuit is the same (you're just using an inverting opamp vs. the non-inverting approach of the circuit your were using until late yesterday)   ......the main difference is that since you are using the LED itself to do the rectification, in this case the LED is being switched on & off (lit) by the AC signal (vs a smoothed DC interpretation of the AC signal via the approach taken yesterday)....to my eyes, that C3 looks like it could be hampering things rather then helping. (because any resulting DC charge on the top plate of C3 will start turning the LED off as the incoming signal level increases) ....also, IMHO you'll not be able to get a nice long 'tail' release with such a circuit (because you are using AC to light the LED - once your signal stops, the LED will instantly extinguish). Also, with a gain of 70, I would imagine there'll be little  'middle ground' region for the LED because instantly your incoming signal will clip (even small signals will clip), driving the led hard ....to phrase another way, it's virtually a black or white scenario with no shades of grey in between.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 19, 2012, 05:51:46 AM
morning...yeah gotcha,  i'm using it with a bright green at the mo, as cadmium apparently likes that colour best according to what ive read....

yep, the led does just cut on/off though....upon further testing.. ::)

d'ya reckon i should just lose the 4.7uf/220 on the end then, and reduce the 3.3m....it would be nice to get that smooth fade back..

that bit of the circuit was lifted from this..i built one a while back but it weren't up scratch imo....

http://home-wrecker.com/nurse-quacky.html


edit: the first clip is with 1M gain resistor, second clip is 4.7M gain resistor...

https://dl.dropbox.com/u/7464107/ef%20shit.mp3
Title: Re: envelope/edge detection
Post by: Gurner on October 19, 2012, 06:05:51 AM
Quote from: deadastronaut on October 19, 2012, 05:51:46 AM
yep, the led does just cut on/off though....upon further testing.. ::)


With the arrangement you've used, it'll be a struggle to get a slow release thing going on (that's because as I say, the LED is being driven by an amplified AC signal ....vs. a slow changing DC level based on the incoming AC signal). removing the cap C3 won't help you get a slower release.....but it's not helping your end goal at all so IMHO can be removed. Another downside of that circuit you've used is that input impedance is too low for a raw guitar signal (i.e. about 50k).....you want at least 1M of input impedance, which is why it's better to use a non-inverting opamp arrangement.
Title: Re: envelope/edge detection
Post by: deadastronaut on October 19, 2012, 06:08:27 AM
yeah i took it out...

http://home-wrecker.com/nurse-quacky.html

so this scheme ^  won't give me that ''release''either  then?... :-\
Title: Re: envelope/edge detection
Post by: Gurner on October 19, 2012, 06:18:13 AM
Quote from: deadastronaut on October 19, 2012, 06:08:27 AM
http://home-wrecker.com/nurse-quacky.html
so this scheme ^  won't give me that ''release''either  then?... :-\

IMHO no, (I see they've addressed the aforementioned low input impedance problem by prefacing the envelope circuit with a buffer - though their buffer still only has a 470k input impedance which I think is still a tad low)
Title: Re: envelope/edge detection
Post by: deadastronaut on October 19, 2012, 06:24:12 AM
@#$%ing envelopes..arghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.........................


;D
Title: Re: envelope/edge detection
Post by: deadastronaut on October 19, 2012, 07:32:15 AM
aha...ive got the fade better by putting a 100uf in parallel with 2 leds....its less snappy....

led.........
            >>>>>led........
cap........


now to suss out how to adjust the bugger.... :P

https://dl.dropbox.com/u/7464107/test1.mp3


as you can hear though, it responds to lower notes, but not the high notes....needs more ass kicking...
Title: Re: envelope/edge detection
Post by: deadastronaut on October 19, 2012, 09:58:09 AM
this is what i have now...note the switch for fade/staccato. ;D

(https://dl.dropbox.com/u/7464107/ENVELOPE4.jpg)


https://dl.dropbox.com/u/7464107/synthyguitar1.mp3

as you can hear its not sensitive when it comes to hammering/tapping though......hmmmmmmm....