Transistor acting oppositely of what I want.

Discussion in 'The Projects Forum' started by Patrick Joseph Acello, Feb 3, 2016.

  1. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    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?
     
  2. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    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
     
  3. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    Well if you have any idea how to execute it properly I would appreciate the help.
     
  4. hp1729

    Well-Known Member

    Nov 23, 2015
    1,937
    218
    Here is what you have with suggested changes. I haven't built it yet so this is all just theory.
     
  5. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    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
     
  6. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
  7. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    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.
     
  8. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    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.
     
    Last edited: Feb 5, 2016
  9. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    I can't view the attachment. Couldn't be found.
     
  10. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
  11. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    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: Feb 5, 2016
  12. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    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.
     
  13. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    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?
     
  14. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    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!
     
    absf likes this.
  15. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    That is correct.
    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.
    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.
     
  16. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    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!
     
  17. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    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.
     
    absf likes this.
  18. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    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.
     
  19. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    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.
     
  20. Patrick Joseph Acello

    Thread Starter New Member

    Jan 17, 2016
    12
    0
    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.
     
Loading...