Bode Plot on an Oscillscope

Maybe you’re learning about filters and want to see the how your filter responds in the 10Hz to 1MHz range. This guide will show you how to make a low frequency ‘spectrum analyzer with tracking generator’ using a few cheap modules and an oscilloscope — Based off of a video done by Dave Jones over at EEVBlog. Dave does a great job going into the theory, so check out the video if you want to see how it works! He will also show you how to set up the scope. Check out my video below for the reader’s digest version.

Some important notes

For the audio crowd — the vertical scale is still in volts, not decibels. There is also no information on phase shift.

Arduino math

Brief Theory

The circuit from this guide generates a sine wave and the frequency of this sine wave ramps up exponentially. This creates a logarithmic axis on the horizontal axis of your scope. The filter under test will then react differently as the frequency is ramped up. Finally everything will be displayed on the oscilloscope which is synced via the external trigger. The oscilloscope and the arduino will also need  the same time settings.

15Hz-10Khz sweep with simulation

15Hz-1Mhz sweep with simulation. marker at 50Khz (approx peak)

One major problem is that the oscilloscope’s horizontal axis markings aren’t going to be placed correctly all the time. To solve this the microcontroller will calculate where the axis bars should be and generate a 1ms pulse at 10Hz, 100Hz, 1000Hz, etc… The two screenshots show different generated axis and there are some simulations to compare results.

Hardware

For this project I used an arduino (breadboard friendly) to do the timing/math/markings, but the star of the show here is the AD9850 DDS sine wave generator. It’s easiest if you are using a breakout for the AD9850. Luckly they can be found on ebay for about 5\$ with free shipping! This seems to be the breakout specs from the original creator — EIM377_AD9850 (pdf)

Schematic, add some decoupling caps as in the next photo

The AD9850 also needs a buffer amplifier. I decided to use the TS922IN from adafruit as a unity gain amplifier. Many op amps will do the job just fine, but get one that doesn’t require a dual power supply and has a high current output. If you want to do any impedance matching or if your filter is low impedance, be sure to add an appropriate terminating resistor.

Wire everything up and get you scope hooked up!

Completed circuit (with filter on the right)

Code

What a mess! I coded this pretty quick and fudged a few things =P You’ll want to jump down to sweepTime_mS and get ready to input the correct values — I’ll cover these in the video.

https://github.com/thefatmoop/bode

Why did I have a bunch of these DDS modules floating around? They had something to do with an LCR meter I built ;p — more on that hopefully soon!

Easy High Voltage

Arcing slightly over 1.5 inches! Videos at the end.

Maybe you want to make a Jacob’s ladder, or give your robot a flamethrower. This is a simple guide on how to make high voltage from 12v capable of arcing over an inch! Not only that, but my guide will also show how do this in a way which won’t break down, and it’s completely solid state! I’m not going to dive into frequency response or the concepts behind a flyback and why it uses a ferrite core. There needs to be a high frequency (~20khz) square wave signal controlling the driver, and I’ll be using an Arduino. If you don’t want to use an Arduino, then use a 555 timer or any other micro controller.

Note: if you already have a flyback transformer removed and know how to be safe with high voltage, then skip to “The Build Plan:” This post is a tad long =/

The project will be designed around a transformer. A high voltage transformer needs to be selected, but where to start? There are a few household appliances which may be laying around the house that use a high voltage. Let’s look at a few:

A quick view of driver circuit.

Selecting transformer:

Microwave Transformer:

• Pros: High current, easy 60hz, designed for high voltage, 2nd winding usually isolated
• cons: Weighs A LOT!, it’s huge, and it only takes 120V to about 2-6kV

Standard Transformer with high secondary to primary turn ratio:

• Pros: Usually small, easy 60hz, easy to find, cheap.
• Cons: It’s not designed for high voltage, expect rapid insulation deterioration.

CRT Television/computer monitor flyback transformer:

• Pros: Fairly small, light, designed for 15-50kV, easy to add a new primary, usually outputs DC!
• Cons: complicated pin out and overall hard to reverse engineer, High frequency 10+kHz.

Neon transformer/oil burner transformer:

• Pros: fairly ‘safe’, designed for 15-50Kv, designed to run/last a long time, usually easy 60Hz.
• Cons: requires 120V, hard to modify (often inside a metal can), high current dangerous output.

Xray transformer/’Pole Pig’:

• Pros: MONSTROUS voltage/power, designed to run/last a long time, usually easy 60Hz.
• Cons: Unless you’re a mad scientist, you probably don’t have one lying around the house. Good luck finding one cheap, huge size/weight, and you’ll kill yourself.

Listed above are some of the options that immediately come to mind. Sometimes the transformers in a laptop’s back light is an option, but they don’t tend to last long when operating in the 10+kV range. Looking at the pros and cons of various transformers, I decided to go along with a computer monitor flyback transformer. I don’t know the pinout and I’m guessing the flyback’s primaries are designed for higher voltages, not the 12V we want to use. Let’s add a new primary to simplify things.

Removing the flyback:

If you’re a reader who wants to actually do this on your own here’s the rules for safety. If you don’t want to read, here’s a good video guide on how discharge: http://www.youtube.com/watch?v=bDAiLtTDuf4

1. Unplug the monitor and make sure it is not touching anything metal or conductive — Glass face down.
2. Most importantly only use one hand, preferably your right, when touching ANYTHING! NEVER use both hands, so if you were to get shocked the electricity wouldn’t travel from one hand to the other. If electricity went from your right hand to your feet, your heart *should* not have too much current running through it.
3. Stand on something plastic at least two inches thick and don’t touch anything metal or conductive.
4. Common insulators will fail at these voltages. Treat all wiring as if there is no insulation on it.
5. Wear safety glasses, ear protection, and a thick long sleeve shirt. This is a large glass tube with a vacuum inside. If it popped there may be shrapnel. The front is very thick and extremely safe, but the tube is not designed to be safe at the back end.
6. Don’t do this if you’re using any sort of electronic life sustaining gear: pacemaker, insulin injector. Find someone else dumb enough to do it for you
7. Understand that you’re doing this at your own risk, and I don’t guarantee safety. I will not be liable for any computer/equipment damage or injury/death. I’ve been shocked by high voltage capacitors in the past and probably would not be here right now if I didn’t follow the rules above. Do not shock yourself even in nonlethal ways! you can still do nerve damage just shocking your hand!

The CRT monitor has two main high voltage capacitors: the flyback’s internal capacitor, and the glass tube itself acts like a capacitor. When you open the monitor there will be bare — no insulation — grounding wire running around the perimeter of the glass tube (near the screen viewing side), and the frame for the electronic boards should be metal too. Get some wires with alligator clamps at the ends and connect the tube frame’s bare ground wire and the electronic board’s frame. Now get a third alligator wire and clamp it to the grounded frame, and the other end to a flat head screwdriver. This screwdriver should have a thick plastic grip without any cracks! Hold the plastic screwdriver by the plastic end — keep away from anything metal — and wobble it under the suction cup electrode on the glass tube. You will eventually hit metal, if the monitor was recently on, possibly hear an electrical pop. Put down the screwdriver and pinch the back of the suction cup and pull it off. Remember to do this with a hand tied behind your back. Once it’s off, touch the metal again with the screw driver and then connect the frame grounding alligator wire to the metal electrode. Now prod around the circuit board with another wire connected to the frame’s ground to make sure nothing else is charged. After you feel as though you’ve poked the poor motherboard enough, congrats! it’s *hopefully* discharged! Now cut all the wires connecting the motherboard to the monitor, and I suggest you tie a frame ground to the pliers. Wriggle the motherboard out of the monitor and close up the monitor with just the glass tube inside and carry it to the trash.

So here we can see part of the motherboard for the monitor. The big black box front and center is the flyback transformer, as you probably guessed.

where to cut the PCB with a pliers

I find it easier to get some heavy duty pliers and cut around the transformer. Once the transformer is out on it’s own little PCB section, try to cut sections in between the pins. The PCB will tend to crack, but we can use this to our advantage.

Once there are little PCB islands with only 1 or 2 transformer pins, de solder the sections.

The build plan:

1. Wire the new primary coil
2. design a circuit to drive our new primary coil
3. write the software for the micro controller managing everything
4. test it! (safely)

Wiring a new primary coil:

This is usually very easy and you can start off with some thin wire just to test the transformer and driving circuit. The ferrite core is often exposed quite a bit and easy to wrap a new coil around. I wrapped a thin layer of masking tape, then a layer of electrical tape. I then used four layers of copper tape normally used for stained glass, and I was sure to solder the ends together.

Image from Wikipedia

Why did I use copper tape? Mainly due to the skin effect. Electricity tends to prefer the surface of a conductor at higher frequencies. This is why a Tesla coil operating around 1Mhz will mainly burn and not electrocute. This is also why some high frequency lines are pipes lacking any sort of core!

even a quick wiring works, but gets hot!

older non rectified flyback

Image from Wikipedia

I looked over the equations and constants used and they agree with my physics book: Essential University Physics by Wolfson Volume 2. It’s also wise to check an ensure that graphs match up with the equations when looking at questionable online sources, which in this case, the graph and equation did and were from Wikipedia.

That pin is a capacitor connected to the red high voltage output

What a nice primary! A little hot glue to hold it in place.

Designing the circuit:

There are many different ways to build a flyback driver. Mine uses a micro controller, in this case an Arduino, and a high power N channel MOSFET. This makes the circuit extremely simple to build and only has a few components. We’re going to be running this circuit at around 20kHz with a lot of current. To make things simple I’ll be using a Mosfet Driver, and this will allow us to easily achieve 12v gate-source voltage differential to minimize drain-source resistance, and the driver will quickly charge and discharge the gate-source capacitance, since it’s a high current half bridge.

Mosfets I’ve had great luck with:

• IRFP260N – N Mosfet, buy at jameco.com (best for this project)
• RFP30N06LE – N Mosfet, sparkfun.com — Will function decently without a Mosfet driver

Mosfet Driver:

For a larger list, please visit my Guide to the MOSFET!

• MIC4422 -Driver, jameco.com discontinued, type “MOSFET driver” into jameco’s search. Farnell carries it!
• TC4420 – Has the same pinout as the MIC4422 and features great ESD protection. A direct replacement for the MIC4422.

driver schematic (click to enlarge)

Note: the ground of the Arduino and the driver circuit are also connected.

minimum layout on breadboard. Large capacitor on 12v line

Now for anyone experienced with Mosfets, you’ll see I’m adding capacitors where they really shouldn’t be located. This will decrease performance ever so slightly, but from experience, will help protect the Mosfet and the driver. You may also want to wrap the connected ground and signal coming from Arduino around a small choke too.

completed circuit board with a small heatsink

entire circuit

Test Code:

This will slowly increase frequency. Voltage may be measured by the arcing distance. Use an old computer for this or increase delay time in setup(); which will give you time to unplug your computer from the Arduino. If you need to see the frequency, use an LCD screen for the Arduino. I haven’t had issues with this, but I wouldn’t recommend using an expensive computer for this project! Notice how I’m using a cheap netbook running from the battery.

Frequency sweep (pdf)

Final Code:

Once you’ve found a good frequency, just use the tone generating function.

flyback driver program (pdf)

Remember that your flyback transformer contains internal capacitors and needs to be discharged after use!

Word of Advice: Pulsing this circuit tends to have an EMP effect. If the Arduino crashes, it’s usually right when it was setting the registers/timers to output the signal. The computer on the Arduino will crash, but the registers may continue to output the signal which drives the flyback. Be careful of this! Components may over heat! The low voltage side may gain a net charge too which may shock you a bit when touching it. From experience this shock is usually mild, but you may want to earth ground everything if you’re worried… If the output voltage isn’t very high, try reversing the polarity of the primary coil since the transformer has an internal high voltage diode.

Want to measure the voltage? This is a tad bit difficult since the flyback’s output is extremely noisy. I would suggest building a voltage divider with 5 or so 10Mohm resistors in series and a 10k connected to ground. Have the voltage divider output connected to a capacitor. Run the flyback and then when it’s off measure the voltage on the capacitor to calculate the flyback voltage.

Xbee hive

xbee galore!

Well summer is over! I ended up doing my internship at Caterpillar and had a delightful time! I especially loved the cafe there! The D11, D7E, and 735 articulated truck were cool too.

I really hope to post some more how-to guides probably related to RF modules… I’ve been working with some ultra low cost RF modules from sparkfun and just starting to do some work with XBees after an awesome donation! I have around 60 pro/standard series 1/prototype (mostly standard) xbee modules!

wireless wii nunchuck mouse

I just haven’t had the time to write about many of my other projects. Here’s a wireless wii nunchuck mouse, and it uses a 5v limited joule theif for the power supply. This is great since it runs down to 1v. The receiver acts as a HID device with basic error detection and those low end modules are only a one way link, so it would just throw out the reading if any error was calculated.

As far as my next guide topics i’m certainly open to suggestions. Possibly a part 2 mosfet guide that goes into more detail about calculating current, power dissipation, resistive feedback, and triode regions. Maybe a BJT intro guide or something else…

Self balancing robot

Ugly! Accelerometer in wii nunchuck, Gyro in Wii motion plus (right side)

Control system:

My current control system. Edit: I calculate angle from the accelerometer right after the offset and scaling.

I’m using a complementary filter, which is used to combine a gyro (accurate but drifts over time) and an accelerometer (not so accurate but doesn’t drift). Anyway look at the control picture to see exactly how I’m doing the calculations. Everything underlined in blue I want to get rid of/move. Possibly I will want to keep the MA so that I can do a standard deviation. The standard deviation could help the platform tune the complementary filter. A high standard deviation for the accelerometer would tune the complimentary filter constants to .999(gyro)/.001(accel) where as a low standard deviation may set it to .95(gyro)/.05(accel) and make it a continuous tuning function.  I’ve also been brainstorming on methods that would allow robot calculate the balancing angle for the platform. As far as phase shift: I’m not too worried about the accelerometer’s phase shift due to the filters, but the gyro needs the phase shift to be an absolute minimum!

Talking to two I2C devices with the same address. Had to include my new tool - saleae logic analyzer

How I would improve results:

The wii motion plus is a ~20\$ three axis 2000deg/sec gyro with a plastic case, sockets, PCB, and a I2C pass through chip. This really isn’t the right type of gyro for this type of robot, and I seriously question the quality of the gyros on board. I can say the same for the accelerometer on the wii nunchuck too. I’ve also thought of a few ways to calibrate the system and get the gyro/accel units to match up with each other. Regardless the results are pretty good and I may just need to tune everything. Those servos are also slow as beans! My plans are to replace the gyros with less than 500deg/sec gyros, clean up the algorithm and work on perfecting it! I also need to put the IMU on the pivoting point of the platform.

Code:

segway05 – I probably won’t get around to taking another wack at this till summer, so here’s the most recent code. Not many comments other than the blatant mistakes pointed out.

Great resources:

Complementary filter by MIT

Tilt with accelerometer

Calculating angles with accelerometer

Using wii nunchuck and Accelerometer together – Just an FYI if you disable the Wii motion plus to talk to the nunchuck via passthrough port, the wii motion plus takes about 100ms to turn back on which is SLOW. I don’t  have a wiimote/wii, so I can’t listen in on them talking with my logic analyzer. This method is good since both devices have the same I2C address…

Videos:

``` ```

Linear resistive divider for the ADC

Simulation of changing -24v to 24v into ~ 0 to 5v.

This is a topic that’s very simple, but I’ve seen individuals do it in ways that are really over complicated. My example will show how to measure from -24v to 24v using a 10bit Analog Digital Converter (ADC) with an analog reference of 5v. The micro controller for this example will be an Arduino since it’s easy to get up and running. If you are having issues with selecting resistor values for your situation, leave a comment and I’ll help you out!

Design and deriving the equation:

Circuit and deriving the equations.

This is a circuit that’s basically an addition to the simple voltage divider which gives one the ability to measure high voltage ranges using an ADC with limited voltage ranges. I’m going to be using a voltage divider that starts out at half the Vdc, which is 2.5v for the Arduino’s 5V power. From there I’m going to use a higher valued resistor to pull the 2.5v up to nearly 5v at it’s peak positive voltage, and down to 0v for its minimum negative voltage. If you wanted to measure just negative voltages then get rid of Rc (use infinity in the equation).

Equations required with explanation.

For deriving the equation, I just used nodal analysis. As you can see there is no calculus or anything very math intensive, but there are some variables. This isn’t a guide on circuit analysis, but if you need some tutorials on signal analysis look around youtube or try the book – Schaum’s Outline of Basic Circuit Analysis. Just as a warning there are a similar methods of doing nodal/mesh analysis that will get different equations but yield the same final equation.

Note: Vout is the output of the resistive divider, which will be what’s connected to the Arduino’s analog input (ADC). Vout should only go from 0-5v. Vac is the input to the overall circuit which may vary from positive to negative voltages. Vout may be found by using 5*(double)analogRead(pin)/1024.

Usage notes:

This isn’t a volt meter! If you build it and you’re not measuring a voltage, you’ll notice that it reports a few volts although nothing is connected. Connect Vac to Ground and you should get close to zero volts. As you can see the example above is fairly low impedance, but you can use higher resistors.

The two resistors standing up are both 10k. Two 10k resistors in parallel are equivalent to 5k. Red wire running off of picture is Vac and black is ground.

As for problems: the only thing I can think of is if the ADC wasn’t giving off good readings. If you’re measuring something that’s time critical or behaves sinusoidally, don’t put any capacitors on Vout since this will do a phase shift on Vout. If you’re worried about voltage spikes then you could use two  zener diodes facing oppositely. Also remember that in this example the voltage spread is over 24*2 = 48 volts, so with a 10bit ADC that’s 48/1024 ~ .5 volt increments.

Example code and material:

Voltage equations from above (pdf)

Arduino example program (pdf)

I was going to use this for a 3 phase triac driver with simple pwm. I needed a zero volt detector on one phase which would allow me to calculate the other phases and trigger the triacs at the right time. Originally I was going to sample the voltage with the ADC and look for about 2.5v coming to the ADC. I ended up using a simple voltage divider and a comparator which is definitely a better route! Now you can measure negative voltages with your ADC or Arduino!

Standard Deviation and Moving Average

Recently my neighbor paid me to build a key less entry system for his dorm room. I decided to go the economical route and use a button/potentiometer that sits outside the door and an Arduino on the inside that controls a servo connected to the lock. For my room, I thought it would be interesting to use a Ping))) ultrasonic distance sensor instead of the potentiometer and lose the button.

The Ping))) sensor kept taking readings while my hand was moving. In order to fix this I decided use a Moving Average filter, then calculate the Standard Deviation of the values currently included in the M.A. filter. When my hand is still, the Standard Deviation will become very small.

Example code:

M.A._and_S.D.(pdf)- “storeValue(variable);” is how to enter data into the array, then call M.A. and S.D.

Not much of a circuit required! Arduino's regulator also powers Ping))). Servo has it's own 5v regulator... needs capacitors

pingDoorLocker(pdf) – As you can see, this program blew up a little…

I tried to make the M.A. and S.D. code very easy to follow. Some things could have been combined in the S.D. and Variance method, but to the beginner what I wrote above is probably easier to understand since it follows the equations. As for the pingDoorLocker – I threw that code together very quickly.

Follow up notes: That was probably the worst way to do this project… I thought of a few ways how to write the program that would chop the code WAY down, but this is an example about using M.A. and S.D.! Pretty bad use of a M.A. filter if you ask me!

His door unlocker.

Since I did put a few hours into building my neighbor’s door opener, here’s an image of it! He didn’t want numbers on the potentiometer dial, so I made the LED flash the number that is currently being entered.

Code for his door opener (pdf) – leave a comment if you want schematics/code on rapid share since pdf loses tabs.

A Beginner’s Guide to the MOSFET

IRFP260N image from warf.com. Pins are Gate, Drain, Source from left to right.

If you need to switch high current and or high voltage loads with a micro controller you’ll need to use some type of transistor. I’m going to be covering how to use a MOSFET since it’s a better option for high power loads. This guide will be just a brief introduction that will discuss how to drive a MOSFET in a simple manner with the ultimate goal of making it act like an ideal switch. I’m not going to get into any of the topics such as Triode region, Saturation, Threshold Voltage, etc…

Refer to the N or P channel basic wiring schematics and remember the three pins: Gate, Drain, and Source. When I mention something like Gate-Source potential difference, I’m talking about the difference in voltage between the two pins.

Thank you Farnell.com for supplying many of the parts that will be part of this review/guide. I wanted to also mention that all parts performed great!

N channel MOSFET

How to think of a MOSFET:

A MOSFET may be thought of as a variable resistor whose Drain-Source resistance (typically Rds) is a function of the voltage difference on the Gate-Source pins. If there is no potential difference between the Gate-Source, then the Drain-Source resistance is very high and may be thought of as an open switch — so no current may flow through the Drain-Source pins. When there is a large Gate-Source potential difference, the Drain-Source resistance is very low and may be thought of as a closed switch — current may flow through the Drain-Source pins.

P channel MOSFET

N channel – For an N channel MOSFET, the source is connected to ground. If we want to let current flow, we can easily raise the voltage on the gate allowing current to flow. If no current is to flow, the gate pin should be grounded.

P channel – Looking at the P channel MOSFET, the source is connected to the power rail V2. In order to allow current to flow the Gate needs to be pulled to ground. To stop the current flow, the gate needs to be pulled to V2. A potential problem is if V2 is a very high voltage it can be difficult raising the gate to the V2 voltage. Not only that, but the MOSFET has limitations on the Gate-Source potential difference. Also note that logic is inverted for a P type MOSFET!

Drain-Source resistance – Ideally we want Drain-Source resistance to be very high when no current is flowing, and very low when current is flowing. The main issue using MOSFETs with micro controllers is that the MOSFET may need 10-15 Gate-Source potential difference to get near its lowest Drain-Source resistance, but the microcontroller may run on 5v or 3.3v. Some sort of MOSFET driver is required.

IRFP260N gate capacitance

IRFP260N current curves.

Gate-Source Capacitance – There is also a capacitance on the Gate-Source pins which prevents the MOSFET from switching states quickly. In order to quickly change voltage on internal capacitance, the MOSFET driver needs to be high current. It needs to actively charge (source) and discharge (sink) the capacitor too (for N channel)!

MOSFET Drivers:

A  half bridge is capable of doing what was mentioned above! There are many ICs available which can do this. Here’s a list of just a few that I’ve tested. Schematics are also provided!

Fet driver is a Half Bridge

• MIC4422YN – Max of 18v, 9Amps peak, 2 Amps continuous.
• MCP1407 – Max of 18v, 6Amps peak, 1.3 Amps continuous.
• UCC27424  – Can drive two MOSFETs, Max of 15v, 4Amps typical.

All of these drivers performed nearly identically (~20ns rise, ~30ns fall). Note that although these can be used for more than just MOSFET drivers, these chips do not have much heat dissipation capabilities!

MOSFETs I’ve tested:

It was originally part of the plan to get some data about these guys, but I have been very busy with school. The MOSFETs have plenty of graphs inside the datasheets!

P MOSFET body diode causing unintentional current to flow.

UCC27424

MIC4422YN and MCP1407

• IRFP260N – 200v, 50A, N channel.
• IRF3703PBF – 30v, 210A, N channel. Misleading ratings! Read my Datasheet Notes at end.
• RFP30N06LE – 60v, 30A, N channel.
• FQP27P06– 60V, 27A, P channel.

An Important Reminder – Don’t forget that typically the heat sink on the back of a mosfet is connected to the Drain! If you mount multiple MOSFETs on a heat sink, the MOSFET must be electrically isolated from the heat sink! It’s good practice to isolate regardless in case the heat sink is bolted to a grounding frame.

Body Diode – Mosfets also have an internal diode which may allow current to flow unintentionally (see example).  The body diode will also limit switching speed. This won’t be a concern if you’re operating below 1mhz.

Great cheat sheet, includes MOSFETS. – akafugu.jp

Side note about Gate – Source voltage: MOSFET Gates can go above or under the source voltage. So for an N channel mosfet with a source at 0v, a -10v on the gate would allow current to flow. Verify this with your MOSFET’s datasheet!

Schematic Diode – If the load is somewhat inductive, you’ll need to put a diode to discharge the inductor. If you want more detail, look at the International Rectifier pdf at the end. My “Intro to the Boost Converter” also talks about the nature of inductors when quickly switched on/off.

Gate-Source ringing – There are a few methods that I’ve heard of / seen to limit ringing on the gate. Ringing decreases efficiency, and if excessive, can damage the MOSFET. You can use a zener and resistor in series with the zener’s cathode connected to gate, anode connected to source for N channel. P channel will have the zener flipped. Add a resistor to limit current going through the zener, and watch those breakdown voltages! There is also another diode you could look into called the TVS diode.

Datasheet notes – If a part has too good to be true ratings, check the application notes carefully. For example, the IRF3703PBF claims 210 Amps continuous drain current at 25ºC. We don’t have to do any thermal calculations to know 220 Amps is a TON of current for a TO-220 package! A closer look on page 8, note 6 reveals that it can pass a maximum of 75 Amps continuously due to the package thermal limitations. For future advice: IRF is pretty good at giving accurate ratings, but you have to look for things like this. Now in the real world lots of testing reveals if your design is bad, or if you’re working with a dishonest or incompetent supplier with inaccurate/misleading data sheets.

UCC27424, MIC4422YN, MCP1407

Arduino Mosfet Example

Without the driver, the Gate takes longer to charge, and it peaks at 5v. Excessive ringing due to no gate ringing suppression.