Transistor acting oppositely of what I want.

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
I followed the circuit diagram from this Instructable and it worked fine, but I want to replace the audio input with a piezo element as a trigger. When I do that, the LED strip stays ON with no input and momentarily turns OFF when the piezo is triggered. What is the issue here and how do I solve it?
 

blocco a spirale

Joined Jun 18, 2008
1,546
Whatever could the issue be?

I cannot begin to imagine the turmoil that was occurring in the mind of whoever drew that "schematic" or why anyone would attempt to build anything from it.o_O
 

hp1729

Joined Nov 23, 2015
2,304
I followed the circuit diagram from this Instructable and it worked fine, but I want to replace the audio input with a piezo element as a trigger. When I do that, the LED strip stays ON with no input and momentarily turns OFF when the piezo is triggered. What is the issue here and how do I solve it?
Here is what you have with suggested changes. I haven't built it yet so this is all just theory.
 

Attachments

AnalogKid

Joined Aug 1, 2013
10,987
In post #4, Q1 is not a darlington transistor. Is not a problem unless you want to sink more than about 1/2 amp. Also, LED D3 doesn not show any current limiting, but that might be built into the LED strip. ake sure your LED has such built-in current limiting, or add a resistor in series with D3. Also, sionce you need only 1 or 2 opamps, you can change to an LM358, the dual version of the quad LM324.

ak
 

dl324

Joined Mar 30, 2015
16,846
but the simulation doesn't seem to be working.
Post your schematic. What simulator are you using? How is it not working?

I haven't bothered to draw a proper schematic from the Instructable; I generally refuse to read schematics drawn that way.

Your latest link took more than a few seconds to show me anything useful, so I closed the page.
 

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
I guess I should clarify that I'm fairly new to electronics. I've never made a schematic before, but I'm trying to learn on Autodesk's online breadboard simulator. My link should have taken you to my simulation, where you could view the schematic. Here it is, cleaned up as best I could.
 

Attachments

Last edited:

dl324

Joined Mar 30, 2015
16,846
Usually I won't deal with schematics drawn in that style, but I made an exception. Is this what the schematic is supposed to be?
upload_2016-2-5_17-55-57.png

What opamps are you using? Where is the piezo? I'd put a pull down resistor after the switch so that input doesn't float when the switch is open.

When the switch is closed, the LED should be on. Not sure what the opamp will do with a floating input...

EDIT: I take that back. With the switch closed, the LED would be off. Did you intend for both opamps to be inverting?
 
Last edited:

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
Usually I won't deal with schematics drawn in that style, but I made an exception. Is this what the schematic is supposed to be?
View attachment 100143

What opamps are you using? Where is the piezo? I'd put a pull down resistor after the switch so that input doesn't float when the switch is open.

When the switch is closed, the LED should be on. Not sure what the opamp will do with a floating input...

EDIT: I take that back. With the switch closed, the LED would be off. Did you intend for both opamps to be inverting?
I was trying to follow the schematic in post #4. The simulator I'm using is fairly basic and doesn't include a piezo that can be operated as a switch, so I replaced it with a coin cell battery and a switch just for simulation purposes. The opamps in my schematic are general purpose 741s, but I would probably use an LM358 in reality. All I'm trying to do is get my LED strip to flash momentarily when the piezo is triggered.
 

dl324

Joined Mar 30, 2015
16,846
I was trying to follow the schematic in post #4.
And that schematic was redrawing the Instructable "schematic" in a more useful form?

How is the piezo being driven? Low side or high side? From your "simulation", I'd guess it's being driven high side; meaning you get 3V when it's being driven and 0V when it isn't.

Describe how the piezo is being triggered. Will it be on longer than you want the LED to be on? Do you want the LED to turn on and off for a set time, independent of how long the buzzer is on?
 

ebeowulf17

Joined Aug 12, 2014
3,307
I'm out of my depth here, but found this question intriguing, so I tried to sim the original circuit, substituting a switched 3V supply for the original audio input. It works as expected, and it also works with the omission of the second op amp stage, circled in red, as described by hp1729 above.
piezo-opamp-LED-trigger_2.png
But then hp1729 went on to add a different op amp stage between the piezo and the main op amp input. When I add that stage to my sim, current through the LED is nearly constant, with just the tiniest twitch on input signals (around 11mA, wiggles by .00003mA when input voltage is pulsed.)
piezo-opamp-LED-trigger_mod.png
It looks to me like the original circuit, minus the unused op amp stage circled in red, should work properly, keeping the LED off except when there's a positive pulse input. So the only question then is how to turn a piezo switch output into a positive pulse when pressed and keep it grounded otherwise. I've never done this myself, but there seem to be plenty of examples on line. The following one looks logical to me, and seems like the easiest to drop into this scenario.
piezo-input-protection copy.png
That brings us to this sim, which works well, although the LED is only lit for the length of the piezo pulse, which is probably quite short!
piezo-opamp-LED-trigger_EBS.png
Finally, I added a diode to rectify the pulses from the piezo and an RC circuit to extend the length of the positive pulse. By adjusting C1 and R6, you can control the length of the LED illumination. As drawn, it keeps the LED lit for anywhere from 5-35 mS after the piezo pulse stops, depending on what voltage and pulse length you assume for the piezo.
piezo-opamp-LED-trigger_EBS3.png
This is all just mental exercise and simulation, so I don't know how this plays out in the real world, but it was fun experimenting. Hope it helps!
 

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
And that schematic was redrawing the Instructable "schematic" in a more useful form?
That is correct.
How is the piezo being driven? Low side or high side? From your "simulation", I'd guess it's being driven high side; meaning you get 3V when it's being driven and 0V when it isn't.
To be honest, I was unfamiliar with the terms low side and high side so I had to look that up, and it seems you're right that it would be high side. I want voltage when being driven and no voltage when it isn't, as you described.
Describe how the piezo is being triggered. Will it be on longer than you want the LED to be on? Do you want the LED to turn on and off for a set time, independent of how long the buzzer is on?
The piezo will actually be adhered to the head of a bass drum for live performances, so I'm not exactly sure how long it will be on. I want my LED strip to flash whenever the drum is hit, so it would have to be on and off pretty quickly if I really wanted it to strobe when using double bass pedals.

Is a piezo a better or worse solution than using the line level output from the sound mixing board? I chose the piezo because I didn't really want to run a splitter and extra cable from the mixer, but I will if it's a better solution.
 

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
Finally, I added a diode to rectify the pulses from the piezo and an RC circuit to extend the length of the positive pulse. By adjusting C1 and R6, you can control the length of the LED illumination. As drawn, it keeps the LED lit for anywhere from 5-35 mS after the piezo pulse stops, depending on what voltage and pulse length you assume for the piezo.
View attachment 100192
I've also simulated your schematic and so far it's the closest I've gotten to what I'm looking for. Thank you so much for taking the time to put that together!
 

ebeowulf17

Joined Aug 12, 2014
3,307
I've also simulated your schematic and so far it's the closest I've gotten to what I'm looking for. Thank you so much for taking the time to put that together!
No problem. It was a fun learning experience sorting through the various approaches and finding what works. In the process of trying to sort this out, I think I also figured out one portion of an envelope filter circuit that I've been meaning to figure out, so it helped me too!

You say this is the 'closest' to what you're looking for. Are there still things you wish worked differently? No promises, but I might be able to help if you describe what's missing/wrong.
 

ebeowulf17

Joined Aug 12, 2014
3,307
I want my LED strip to flash whenever the drum is hit, so it would have to be on and off pretty quickly if I really wanted it to strobe when using double bass pedals.

Is a piezo a better or worse solution than using the line level output from the sound mixing board
I would probably stick with the piezo plan. If you can take a spare insert, direct out, or aux send from just a kick mic signal in the board, it might be easier than having an extra set of wires on your drum, but even then it's unlikely to have better isolation than the piezo element would - the mic also picks up bleed from snare, toms, etc. more than a piezo element on the drum will. And if your board split involves having the signal mixed with other mic signals, or if it involves splicing into mic lines before they enter the board, then it definitely seems like a bad idea. Then you're dealing with phantom power, ground loops, etc.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Now that I know the intended application, it occurs to me that this circuit may need adjustment to prevent false triggers. In a loud, live band performance situation, it's possible that the sound/vibrations from the rest of the band and the rest of your drum set might keep the leds lit continuously through the entire show. I'd suggest using variable resistors for R7 and R6. Somewhere between 10k and 100k max resistance on each. Between the two of them you should be able to set a minimum threshold so that quiet sounds don't trigger the circuit and also adjust the length of time that each led pulse is sustained. As it stands, each adjustment impacts the other. It's probably possible to design a circuit where each parameter can be adjusted independently, but I don't see a way to do it with this circuit. If you want to try this one, there will probably be a little trial and error on adjusting the settings for optimal response.
 

Thread Starter

Patrick Joseph Acello

Joined Jan 17, 2016
12
You say this is the 'closest' to what you're looking for. Are there still things you wish worked differently? No promises, but I might be able to help if you describe what's missing/wrong.
I'd suggest using variable resistors for R7 and R6. Somewhere between 10k and 100k max resistance on each. Between the two of them you should be able to set a minimum threshold so that quiet sounds don't trigger the circuit and also adjust the length of time that each led pulse is sustained. As it stands, each adjustment impacts the other. It's probably possible to design a circuit where each parameter can be adjusted independently, but I don't see a way to do it with this circuit. If you want to try this one, there will probably be a little trial and error on adjusting the settings for optimal response.
Fine tuning the isolation is really the only other thing I could think of. I just wanted to see if I could make a simple version first. I was thinking either variable resistors or a low frequency filter such as the ones used in color organs.
 
Top