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

Thread Starter

.frank.

Joined Feb 21, 2016
46
Now you have the concept figured out!
A millisecond doesn't mean squat to a circuit like this.:)
Exactly. I just changed it to 1MHZ and the delay is now 90ms!! sheesh.
8 MHz = 10ms delay (from when the gate first sees the signal to when the led is turned on)
1 MHz = 90ms delay (from when the gate first sees the signal to when the led is turned on)
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Ok, the results are in....I finally get some bjt's in.
First tried some common npn 2n3904's - nothing happened due to lack of power
Moved on to MPSA42's 300v npn transistor - nada
Released I needed a whole lot more gain so I moved on to a darlington KSP13BU which gives roughly a 10,000 gain. This finally had enough power to trigger the inverter ***BUT*** same issue as the FET, it simply "latched on" and wouldn't let go.

So, enter oscilloscope results:
The blue-ish line is the 2nd probe connected straight to the 5v dc rail - looks like a nice dc line...
The yellow line is the 1st probe connected to the positive and negative terminals of the inverter where the +3 v should be only to find what looks like an AC sine wave...what the..........
 

Attachments

Dodgydave

Joined Jun 22, 2012
11,302
That's a 10khz signal, it will be the frequency of the inverter, whats the signal on the base of the transistor when it latches?
 

ronv

Joined Nov 12, 2008
3,770
*There is a resister not shown in the schematic to lower the voltage from 5v to 3v when trying to use the inline power
I suspect this is the problem. The inverter take quite a bit of power so the voltage to everything probably drops. How large is this resistor?
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
I suspect this is the problem. The inverter take quite a bit of power so the voltage to everything probably drops. How large is this resistor?
It is in the most recent circuit diagram (post #24) - 6.8 ohms. If I remove the resister, the inverter simply gets more current and the bulb gets brighter...same results though....
 
Last edited:

Dodgydave

Joined Jun 22, 2012
11,302
What happenes if you use a separate supply to feed the inverter, common both the ground ls together, so a 5v supply for the pic, and a separate supply for the inverter.??
 

ebeowulf17

Joined Aug 12, 2014
3,307
Since there still seems to be some uncertainty as to whether it's the pic misbehaving due to noise or the fet being erroneously triggered directly by the noise, you could try taking the pic out of the equation entirely, just as an experiment. Put a momentary switch and a pull down resistor in place of the pic to switch the fet gate on and off and see if gets stuck on. If so, you can ignore the pic. If not, focus on the pic.

Also, very early on there was advice about decoupling power to the pic, which usually requires two capacitors, but your schematics only show one.
Add a 10 uf aluminum electrolytic or tantalum capacitor and a ceramic capacitor of 100 nf directly to the power and ground traces right at the PIC to protect it from glitches on the power line or the ground line.
You were also advised to try adding a cap to the fet to prevent back emf from triggering it. Did you try that?
From the scope trace on the Drain its pulsing at 12khz, thats the inverter back emf oscillations, try putting a 1uf capacitor across the D/S terminals.
If I were you, I would try one or both of the additional capacitors suggested above. If those don't fix it, I'd try the experiment to isolate the problem to either the fet or the pic.
 

ronv

Joined Nov 12, 2008
3,770
Two pictures from the scope with circuit still as is on post#24

  • Both probes have the common clipped to the earth rail
  • Yellow CH1 is hooked to Pin 5/Gate of the IC/Mosfet
  • Blue CH2 is hooked to the drain of the mosfet

The first picture shows the circuit at rest but switched on and waiting to detect sound
View attachment 101441



The second picture shows the inverter/fet latched to the on state

View attachment 101442
I think I figured out your scope picture. :D
It looks like it is being told to turn on. The gate is at 5 volts although it's has some noise. The drain is at ground (0.2 volts) also with some noise.
Since it works with the battery maybe we can assume it is the noise that is messing it up. I can only guess it is a timer or something that tells it to turn off, so maybe the micro is hung or got reset from the turn on of the inverter. Since the 5 volts runs the micro start there by adding a big cap - say 100 Ufd from 5 volts to ground close to the inverter 5 volts. See if that makes the 5 volts solid.
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Since there still seems to be some uncertainty as to whether it's the pic misbehaving due to noise or the fet being erroneously triggered directly by the noise, you could try taking the pic out of the equation entirely, just as an experiment. Put a momentary switch and a pull down resistor in place of the pic to switch the fet gate on and off and see if gets stuck on. If so, you can ignore the pic. If not, focus on the pic.

Also, very early on there was advice about decoupling power to the pic, which usually requires two capacitors, but your schematics only show one.


You were also advised to try adding a cap to the fet to prevent back emf from triggering it. Did you try that?


If I were you, I would try one or both of the additional capacitors suggested above. If those don't fix it, I'd try the experiment to isolate the problem to either the fet or the pic.
The irony, I just performed your first suggestion to try to isolate what is going on here a few days ago.
1) If using the FET or JBT with the inverter all by themselves and I manually switch the transistors on/off with a wire to +5 / gnd, it works just fine
This is the standard power supply, not the external batteries, also no caps, resisters, nothing....
2) If I leave the pic in place, and take out the sound detector and simply use the gate wire that used to go to the sound detector manually with my hand to +5/gnd---again it works fine
3) I am pretty sure I have narrowed it down to some kind of noise being fed FROM the inverter INTO the sound detector that it causing it to stay on, which in turn simply triggers the pic, which triggers the rest of everything to stay on.

"Also, very early on there was advice about decoupling power to the pic, which usually requires two capacitors, but your schematics only show one."
^^^ you are correct, I forgot the second cap - I will add it

"You were also advised to try adding a cap to the fet to prevent back emf from triggering it. Did you try that?"
^^^ Not sure how to wire that....
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
I think I figured out your scope picture. :D
It looks like it is being told to turn on. The gate is at 5 volts although it's has some noise. The drain is at ground (0.2 volts) also with some noise.
Since it works with the battery maybe we can assume it is the noise that is messing it up. I can only guess it is a timer or something that tells it to turn off, so maybe the micro is hung or got reset from the turn on of the inverter. Since the 5 volts runs the micro start there by adding a big cap - say 100 Ufd from 5 volts to ground close to the inverter 5 volts. See if that makes the 5 volts solid.
It's a simple concept - as long as sound (pretty decently loud sound) is detected, an led will stay on. When the noise goes away, it waits for something new, then triggers the next led in the same way - rinse and repeat.

You are correct in that it is some kind of noise causing the issue. The noise is coming from the inverter and somehow feeding it to the sound detector (not audibly through the microphone however <---this I already isolated was not an issue)

"adding a big cap - say 100 Ufd from 5 volts to ground close to the inverter 5 volts"
^^^I will try that as well...thank you - do you also mean to wire it in series with the inverter power or in parallel?
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
I would go with a stronger amp psu, with big capacitors, and series supply diodes to prevent back pulsing to the pic.
blah - I only have a 1amp 5v power supply handy. It should be drawing near this power - the inverter is the biggest hog at 250-300mA. As others suggested I will add capacitors

Thank you!!
 

ebeowulf17

Joined Aug 12, 2014
3,307
Good job on your experiments! Sounds like it's either the sound detector or perhaps the communication between it and the pic.

I apologize if you already covered it, but what is your sound detector? Is it a self contained unit with a simple on/off signal output? Perhaps we just need power supply decoupling on the sound detector (two more caps just like the ones on the micro, but the new pair would be as close as possible to the power and ground connections on the sound detector.)
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
FACE PALM:eek: In my haste I accidently bypassed the power regulator and put 17 volts right to the pic - to quote one of my old favorite movies "boom - big bada boom"

Should have a new one by the end of the week.
 

Thread Starter

.frank.

Joined Feb 21, 2016
46
Good job on your experiments! Sounds like it's either the sound detector or perhaps the communication between it and the pic.

I apologize if you already covered it, but what is your sound detector? Is it a self contained unit with a simple on/off signal output? Perhaps we just need power supply decoupling on the sound detector (two more caps just like the ones on the micro, but the new pair would be as close as possible to the power and ground connections on the sound detector.)

The sound detector is a pretty sweet little package from spark fun
https://www.sparkfun.com/products/12642

Digging deep into its document I found an interesting statement....
"In testing with various supplies, a significant degree of variability was discovered - some supplies are less noisy than others. One exhibited as much as 30 mV ripple on the supply output, an as a result, the the Sound Detector was rather sensitive and unstable........Based on the supplies used in testing, ripple of more than about 10 mV is problematic."

I'll bet that dang inverter is the problem and I need to find a way to squelch it.
 

ebeowulf17

Joined Aug 12, 2014
3,307
FACE PALM:eek: In my haste I accidently bypassed the power regulator and put 17 volts right to the pic - to quote one of my old favorite movies "boom - big bada boom"

Should have a new one by the end of the week.
Doh! Sorry to hear that. So easy to make simple mistakes that spell immediate doom. I fried my first thermocouple amp IC within about 30 minutes of getting it by plugging it into the breadboard one position off from where I needed it. Instant death.
 

ebeowulf17

Joined Aug 12, 2014
3,307
The sound detector is a pretty sweet little package from spark fun
https://www.sparkfun.com/products/12642

Digging deep into its document I found an interesting statement....
"In testing with various supplies, a significant degree of variability was discovered - some supplies are less noisy than others. One exhibited as much as 30 mV ripple on the supply output, an as a result, the the Sound Detector was rather sensitive and unstable........Based on the supplies used in testing, ripple of more than about 10 mV is problematic."

I'll bet that dang inverter is the problem and I need to find a way to squelch it.
Sounds to me like you're on the right track. I'm out of my depth when it comes to specific values for any of this stuff, but my gut feeling says big cap across power supply and ground at the inverter, and smaller decoupling caps right at the power inputs to your sound board. It looks like the sparkfun schematic shows one 1uF decoupling cap is already on the board. I imagine the addition of the common 10uF + 0.1uF pair would improve power supply ripple rejection, although I'm just guessing. Good luck!

Also, when the system was getting stuck on before, did the sound LED on the sound detector board stay lit the whole time? If so, that would clearly confirm that it was the sound detector that was getting tripped up by the power supply noise. If not, it seems a suspicious.
 
Top