Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Specific Hardware Topics > Electronics & Electrics

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 19th June 2012, 1:04 PM   #1
RussellK Thread Starter
Member
 
Join Date: Jun 2003
Posts: 339
Default Typical MOSFET Misery...

So I want to have my microcontroller toot a car horn. Supply is 12v batt, micro gets 5v via a regulator, one pin drives an IRFZ44N via a 100R gate resistor with a 10k gate to source. Horn resistance is about 1 ohm, draws about 5A when operating, 1N4004 freewheel diode across it.

Micro is meant to send a series of short 10ms pulses to blip the horn, but after the first one the micro resets. My first guess was that there was too much current being drawn from the pin, so I tried increasing the gate resistor to 1k, which still appears to switch the MOSFET OK despite the lower gate voltage, but the problem remains, the micro resets, due, it seems, to the 5v supply dropping out.

Looking at the scope, it appears the MOSFET switches on and off for the correct 10ms, but only once, as the micro dies after that.

Any suggestions?
RussellK is offline   Reply With Quote

Join OCAU to remove this ad!
Old 19th June 2012, 1:11 PM   #2
Scando
Member
 
Scando's Avatar
 
Join Date: Mar 2009
Location: Brisbane
Posts: 224
Default

Not something I've played with overly, but I would try (just for test purposes) a totally independent power supply for your micro (some AA batterys?). Just to eliminate the (admittedly slim) possibility of it being an EMI issue rather than an actual power sag. Other than that, a cap on the mirco's supply line?
__________________
Measure thrice, cock up twice.
Scando is offline   Reply With Quote
Old 19th June 2012, 2:12 PM   #3
dakiller
(Oscillating & Impeding)
 
dakiller's Avatar
 
Join Date: Jun 2001
Location: SE Melb
Posts: 6,210
Default

Your mosfet isn't a logic level one, you need to drive the gate with 10V or more (12 is fine) to turn it on. Even though the datasheet shows it should work with only 5V Vgs, I would try more.

Capacitors either side of the regulator?
__________________
In memory of
Cheers

Z
dakiller is offline   Reply With Quote
Old 19th June 2012, 8:42 PM   #4
RussellK Thread Starter
Member
 
Join Date: Jun 2003
Posts: 339
Default

Quote:
Originally Posted by Scando View Post
Not something I've played with overly, but I would try (just for test purposes) a totally independent power supply for your micro (some AA batterys?). Just to eliminate the (admittedly slim) possibility of it being an EMI issue rather than an actual power sag. Other than that, a cap on the mirco's supply line?
Actually, I did try this earlier, powering the micro with it's own battery pack, and it did behave correctly, but for some reason I ignored that evidence and focussed on the MOSFET

From what I can see, the MOSFET actually is switching correctly, and when I think about the trace on the scope, everything goes to hell at the *end* of the 10ms pulse, ie. when the horn turns off, so perhaps it's the power supply that's the problem despite my diodes on the horn (I changed the original 1N4004 to a higher-amp fast diode, and added a second across the terminals of the horn).

The 12v supply (gel cell) goes via a 1N4004 diode to the regulator (to stop the supply sucking back power out of the input caps if was dropping because of the horn load), which has a 470uF and 10uF cap on the input and a 10uF and 100nF on the output, and I added an ex-motherboard 2500uF cap to the 5v side as well.

I'm thinking now that maybe a voltage spike from the horn when it turns off is wreaking havoc. I wonder if a zener before the regulator might help clamp any over-voltage that's getting through the regulator (which is only a little 100mA LDO unit)?

Any other suggestions on how to protect the micro supply from spikes on the 12v side would be appreciated
RussellK is offline   Reply With Quote
Old 20th June 2012, 9:09 AM   #5
paulvk
Member
 
Join Date: Mar 2010
Posts: 698
Default

Put inductors on the supply +/- to the micro/regulator board , 100nano farad cap after them. What type of regulator are you using if its linear put a reversed biased diode around it and 100nano farad at its output. Put a mains rated 100nano farad cap accross the horn this big buzzer generates very high voltage spikes and is alos a source of RF from the spark gap at its contacts I would use a relay to drive the horn because of its very noisy electrical output put your cro on it and watch all the RF it generates.
paulvk is offline   Reply With Quote
Old 22nd June 2012, 9:45 PM   #6
inflex
Member
 
Join Date: Jul 2006
Location: Townsville
Posts: 3
Default

Can you draw up a schem of what you're doing? Which way do you have your free-wheeling diode?

As Paulvk says, put an inductor inline to your microcontroller - also how is your regulator setup?

For a microcontroller (PIC, AVR?) you don't need a lot of current obviously, but i'd still ensure the regulator is decoupled appropriately and I'd probably go even further and put a diode-cap sag isolation prior to the uC.

Something like ...
(ignore the V+ and 5VOUT points, they're just off the actual project that I cut-paste this from)
__________________
http://ctpc.biz
inflex is offline   Reply With Quote
Old 23rd June 2012, 12:03 AM   #7
RussellK Thread Starter
Member
 
Join Date: Jun 2003
Posts: 339
Default

Quote:
Originally Posted by inflex View Post
Can you draw up a schem of what you're doing? Which way do you have your free-wheeling diode?
The freewheel diode is connected anode to positive across the horn terminals - I replaced the fast diode I had there with a Shottky diode and the the peak voltages improved a little, but I'm still seeing spikes with 40v p-p on the scope on the 12v side. I've been trying combinations of series diodes in different places, inductors, bypass caps of various sizes and a more robust 7805 instead of the 100mA LDO reg I had in originally, but I still see p-p voltages in the 30-40v range on the 5v side.

When I get a moment I'll fire up Eagle or something and show the various circuits along with the scope shots. My current thinking is that the voltage peaks are too much for the components I'm using. One option I'm looking at is a TVS diode, but I probably need to get a better handle on the problem before randomly ordering parts.

Clearly I must be missing something, as this is a car horn, and they work in cars without zapping electronic devices when they're used.
RussellK is offline   Reply With Quote
Old 23rd June 2012, 12:22 AM   #8
Privatteer
Member
 
Join Date: Mar 2006
Posts: 470
Default

As a test how about try driving a small 12v relay 1st instead of the horn. Have a lot lower current draw.
Privatteer is offline   Reply With Quote
Old 23rd June 2012, 12:46 PM   #9
inflex
Member
 
Join Date: Jul 2006
Location: Townsville
Posts: 3
Default

Quote:
Originally Posted by RussellK View Post
The freewheel diode is connected anode to positive across the horn terminals - I replaced the fast diode I had there with a Shottky diode and the the peak voltages improved a little, but I'm still seeing spikes with 40v p-p on the scope on the 12v side.
Looking forward to seeing what you put together in Eagle. I've actually just finished up my old business where I designed and manufactured devices for R/C aircraft, including large speed controllers, so it's a similar situation to what you're dealing with here (business is closed because there's just no way to realistically compete with China on that front any more).

Paul.
__________________
http://ctpc.biz
inflex is offline   Reply With Quote
Old 23rd June 2012, 3:40 PM   #10
paulvk
Member
 
Join Date: Mar 2010
Posts: 698
Default

Quote:
Originally Posted by RussellK View Post
Clearly I must be missing something, as this is a car horn, and they work in cars without zapping electronic devices when they're used.
Cars have a big low ESR capacitor in them, its the battery! They also have a lot of de-coupling. Did you put a capacitor accross the horn. The 78XX type regulators have problems with noise and latch up this is why I said put the reversed biased diode around the regulator from its output to its input also put a reversed biased diode at the input of your regulator to ground before the capacitors but after the de-coupling inductor. Use tantalum capacitor of 10uF before the regulator these have good noise suppression. If you use a relay instead of a mosfet you isolate the circuit from the noise of the horn and the path then has to be via the power feed.
paulvk is offline   Reply With Quote
Old 23rd June 2012, 8:52 PM   #11
RussellK Thread Starter
Member
 
Join Date: Jun 2003
Posts: 339
Default

The application is a remote gate monitor - there's an IR beam hooked up to a TX that sends a code when a car drives through (we have regular traffic this time of year) or sends an error code if the beam remains blocked too long.

After battling with getting reliable serial comms using a PIC, I ended up using a PICAXE at each end which has a nice rfin/rfout function that does manchester coding and works very reliably with the UHF ASK modules (~25mW TX) I'm using with a range of about 150m through trees. A couple of lines of BASIC for each and and it simply works. Except for blipping the horn

While I sort out getting the horn thing working, I've made up a small portable RX unit with a buzzer and LEDs.

It's occurred to me that just scoping the voltage and triggering on excursions past a certain level while I blip the horn manually isn't telling me much, just that the volts are all over the shop at some point.

Instead, I'll prog the micro (powered independently)to do a single 10ms pulse which I'll also use to trigger the scope and monitor the voltage through my power supply circuit, which should allow me to see the behaviour while the horn is sounding as well as the spikes when it stops. I'll also use a standard auto relay off the MOSFET to switch the horn and see how I go.

I'll try and get something going in the next few days - thanks for all the suggestions - I'll try and work through them systematically to see what benefit each component adds.
RussellK is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 10:33 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!