mosfet gets "stuck on" when using project volatage but not external voltage for dc-ac inverter

Thread Starter

.frank.

Joined Feb 21, 2016
46
So I got the new pic in for the one I blew up. Added all the recent suggestions and it still didn't work.
So I started thinking, based on a previous suggestion and the fact that I needed a very small amount of ripple on the dc supply, I went out and purchased a Tekpower tp3005T ac to dc power supply which gives < or = 2mVrms and it still didn't work.

WOW - this is soooo frustrating. Here is the most updated schematic


circuit.PNG
 

ebeowulf17

Joined Aug 12, 2014
3,307
If I read the information right, the sound detector has an indicator light on it which should be lit whenever it thinks it's detecting sound above its threshold.

Does the light behave as expected when cycling through the LED outputs?

If so, what does it do when the power inverter output gets stuck on? Is the sound detector indicator LED lit continuously, flickering, or only on while you're making sound?

I'm just trying to establish whether the sound detector itself is getting false triggers due to electrical noise, or if the breakdown is somewhere else.

Finally, I assume you're using the gate output from the sound detector, not the envelope output. Is that correct?

I'm really intrigued by this problem, but I'm at a loss. I wish I understood this stuff better. Tomorrow morning I'll be trying to improve a circuit so that it's microcontroller no longer shows intermittent resets when high voltage motors start nearby. Seemed like it would be easy, but I feel like I'm flailing. May start a thread on that if things don't go well tomorrow.
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
If I read the information right, the sound detector has an indicator light on it which should be lit whenever it thinks it's detecting sound above its threshold.
CORRECT

Does the light behave as expected when cycling through the LED outputs?
YES

If so, what does it do when the power inverter output gets stuck on? Is the sound detector indicator LED lit continuously, flickering, or only on while you're making sound?
Stuck in a continuously lit "on" state

I'm just trying to establish whether the sound detector itself is getting false triggers due to electrical noise, or if the breakdown is somewhere else.
My theory is the sound detector is being triggered somehow from the inverter on the voltage rail (if that's even possible)

Finally, I assume you're using the gate output from the sound detector, not the envelope output. Is that correct?
Correct - Gate

I'm really intrigued by this problem, but I'm at a loss. I wish I understood this stuff better. Tomorrow morning I'll be trying to improve a circuit so that it's microcontroller no longer shows intermittent resets when high voltage motors start nearby. Seemed like it would be easy, but I feel like I'm flailing. May start a thread on that if things don't go well tomorrow.
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Its the psu that's the problem, not enough current and too much ripple.
Cant be, as I stated earlier, I went out and purchased a Tekpower tp3005T ac to dc power supply which gives < or = 2mVrms and it still didn't work. The power supply clearly indicates about 19mw when a led triggers and 300mw when the inverter triggers and this unit puts out 5.3AMPS if necessary at 30v
 

ebeowulf17

Joined Aug 12, 2014
3,307
Is it possible that the noise from the power inverter is moving as electromagnetic waves through the air, not just through the wires? Maybe the sound detector circuit is picking up EMI/RF from the inverter.

How far apart are those two components?
Is either one shielded?
As an experiment could you extend wires to move one of them significantly farther away?
Do you just happen to have a Faraday cage lying around? You could put the sound detector in it to insure that it's not picking up EMI/RF interference.

Just brainstorming and thinking out loud now. Best of luck!
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Is it possible that the noise from the power inverter is moving as electromagnetic waves through the air, not just through the wires? Maybe the sound detector circuit is picking up EMI/RF from the inverter.

How far apart are those two components?
Is either one shielded?
As an experiment could you extend wires to move one of them significantly farther away?
Do you just happen to have a Faraday cage lying around? You could put the sound detector in it to insure that it's not picking up EMI/RF interference.

Just brainstorming and thinking out loud now. Best of luck!
And I thought I was crazy for doing that a week ago. Yeah I ran 6 foot lead wires out of the room, between a door and put the inverter in the bath tub to try to get it as far away as possible. It didn't change anything. I did it not for your reasons but because I thought that the actually frequency being generated by the inverter (which I could hear) was loud enough to cause an "audio loop" basically thinking that the sound detector was picking up the noise produced by the device. I even covered the inverter with 14 pillows to bury the son of a b!tch. It still stayed in the "stuck on" scenario - roflol

If this doesn't drive me into alcoholism, I don't know what will.
 

ebeowulf17

Joined Aug 12, 2014
3,307
And I thought I was crazy for doing that a week ago. Yeah I ran 6 foot lead wires out of the room, between a door and put the inverter in the bath tub to try to get it as far away as possible. It didn't change anything. I did it not for your reasons but because I thought that the actually frequency being generated by the inverter (which I could hear) was loud enough to cause an "audio loop" basically thinking that the sound detector was picking up the noise produced by the device. I even covered the inverter with 14 pillows to bury the son of a b!tch. It still stayed in the "stuck on" scenario - roflol

If this doesn't drive me into alcoholism, I don't know what will.
These noise problems can be tricky. It took me forever to find settings on my oscilloscope to visualize the noise issue I'm currently struggling with. So far my best solution has been throwing capacitors at the problem, and I'm up to 30uF of capacitors in addition to all the standard decoupling you'd expect. That 30uF cut my noise spikes in half, but they're still quite prominent. Can't imagine how big of caps I'd need to totally knock it out. There must be a better way...

Actually, thinking of my oscilloscope probing, what all have you checked with your oscilloscope? It might be interesting to scope the power going into the sound detector and see if you can see the ripple there. Then you can try various circuit modifications and compare the results. You could add extra capacitance across the power inputs and see how much the ripple was being reduced, even if any given test didn't fix the whole problem all at once. Being able to see incremental changes, as opposed to a simple pass/fail test, might make it easier to see what changes help and how much farther you need to go. In my case I added an extra 10uF right at the microcontroller, thinking that was a lot, and it only reduced my noise maybe 15% or so, barely enough for me to be sure I was seeing a real change. Knowing I was headed in the right direction, I tripled that and cut my noise roughly in half. Now I'm ordering bigger caps to experiment with.

So, two potential lessons from my recent experience:
1) The scope can help you see little improvements even when they're too small to really fix anything.
2) Depending on your noise level and how sensitive your circuit is, you might need more/bigger caps than you'd expect!
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Holy S*** it's fixed!!

Before I reveal the fix....first a very very special thank you to DodgyDave for covering all the bases, Ronv for getting me close, and especially Ebeowulf17 for thinking outside the "EE textbook standard approach"
It was not the PSU
It was not adding pull up / pull down resistors
It was not protecting the pic
It was not a bjt vs fet issue
It was not the code

What was it? The noise on the inverter (as most of us suspected) But I needed my scope to find the answer and Ebeowulf17, you gave me the idea by saying:
"1) The scope can help you see little improvements even when they're too small to really fix anything."

By adding a bigger cap in parallel to the inverter from 4.7uf to 30uf, 50uf, even 100uf didn't help at all - (or so I thought) but once I used the reference feature of my scope I was able to see that it WAS helping, I just wasn't going big enough. I finally starting adding more capacitance and settled at 141uf (3x 47uf caps) and it "released" the stuck on inverter.

I removed everything from the circuit, all the extras that were recommended, and simply added that cap to fix the problem. Here is the final working circuit - again a HUGE thank you to the community for helping out. Lessons learned all around

circuit.PNG
 

ronv

Joined Nov 12, 2008
3,770
Holy S*** it's fixed!!

Before I reveal the fix....first a very very special thank you to DodgyDave for covering all the bases, Ronv for getting me close, and especially Ebeowulf17 for thinking outside the "EE textbook standard approach"
It was not the PSU
It was not adding pull up / pull down resistors
It was not protecting the pic
It was not a bjt vs fet issue
It was not the code

What was it? The noise on the inverter (as most of us suspected) But I needed my scope to find the answer and Ebeowulf17, you gave me the idea by saying:
"1) The scope can help you see little improvements even when they're too small to really fix anything."

By adding a bigger cap in parallel to the inverter from 4.7uf to 30uf, 50uf, even 100uf didn't help at all - (or so I thought) but once I used the reference feature of my scope I was able to see that it WAS helping, I just wasn't going big enough. I finally starting adding more capacitance and settled at 141uf (3x 47uf caps) and it "released" the stuck on inverter.

I removed everything from the circuit, all the extras that were recommended, and simply added that cap to fix the problem. Here is the final working circuit - again a HUGE thank you to the community for helping out. Lessons learned all around

View attachment 102715
Cool! One thing bothers be though. When the transistor turns on there will be a lot of current thru it until the cap charges. This may be hazardous to it's health.:D
Can you get the same results with the cap from 5 volts to ground instead of 5 volts to the transistor?
 

ebeowulf17

Joined Aug 12, 2014
3,307
Cool! One thing bothers be though. When the transistor turns on there will be a lot of current thru it until the cap charges. This may be hazardous to it's health.:D
Can you get the same results with the cap from 5 volts to ground instead of 5 volts to the transistor?
Interesting point. Hadn't thought about that. Good eye!
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Cool! One thing bthings be though. When the transistor turns on there will be a lot of current thru it until the cap charges. This may be hazardous to it's health.:D
Can you get the same results with the cap from 5 volts to ground instead of 5 volts to the transistor?
Not sure what you mean. How do you want me to rewire this thing?
 

Dodgydave

Joined Jun 22, 2012
11,285
He wants you to remove the cap neg and connect it to the emitter instead, effectively across the battery, i was going to suggest replace the capacitor for a low value resistor like 10 ohms to drown the pulses out, but just leave it as it is.
 
Top