Go Down

Topic: MOSFET help (Read 4998 times) previous topic - next topic

jimmy__riddle

Ok, I'm a beginner at this, but trying very hard to learn. I'm trying to use my arduino uno to control a peltier, and I am planning on using an H-bridge from two N and 2 P ch MOSFETs. Just to try to learn a bit about them I have been trying them out on their own, before trying an H bridge. I can get the N-CH to work fine, following this http://brunningsoftware.co.uk/FET.htm but when I try something similar with my P-CH it doesnt turn off, the peltier is on, but not as powerful as when I release the switch, letting the 5v go to gate. I have a 12v power supply for the peltier going through S+D, with the arduino going to G with a 10k resistor to GND.

Thanks in advance, and sorry for any electrical faux-pas!

MarkT

Can you clarify the circuit you have there for the p-channel MOSFET?  And which MOSFETs? (are they logic level for instance).
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

jimmy__riddle

ok, I have 12v>source-drain>peltier>ground, and I have arduino pin 8 > gate as well as 10k resistor>ground

Sorry, I haven't started using something to draw diagrams yet.

The MOSFET is a IRF4905, http://docs-europe.electrocomponents.com/webdocs/08a2/0900766b808a2259.pdf

thanks

jimmy__riddle

After some sleep and some more reading, I think it's because with the 5v from the arduino and 12v supply I can only get the Vgs to be -7V and I want it to be 0 to turn off the supply.

So if that's the case, could I use a NPN transistor (I have some BC547B), with the 5v from the arduino (through a 10k resistor) to switch a 12v supply to the gate, giving me a Vgs of 0V.

I hope this is right, I think I'm starting to get the hang of it.

kllsamui

ARDUINO PWM should drive a opto coupler, and that is controlling the MOSFET, ( and i think i see 2 resistors in the circuit )

jimmy__riddle

ok, I've tried the optoisolator route, with the schematic from here http://www.bristolwatch.com/ele/h_bridge.htm (figure 8). Plugged in the 12v supply and before I got round to using the optoisolators to close one pair of FETs all 4 FETs started to heat up, and the LED on my power supply was blinking.  :(

At least I didnt see smoke!

Not sure what I've done wrong.

MarkT


ARDUINO PWM should drive a opto coupler, and that is controlling the MOSFET, ( and i think i see 2 resistors in the circuit )


That circuit (figure 8 in your linked page) is going to see shoot-through (both high-side and low-side switches on simultaneously) - this is very bad news, don't do that.  The problem is that when the opto-isolator switches off the two gates start to charge up through the 10k resistor (taking about 20 to 200us to do so perhaps, depending on the exact MOSFETs used)  For most of that time both high and low side devices will be conducting, shorting the power supply to ground and causing havoc.

Its important the switching for high and low side devices happens at different times that prevent any overlap of the on-time like this.

Your suggestion of using a NPN to level convert for the p-channel MOSFETs is good, just make sure you allow enough dead-time between switching one device off and the other on (you have to allow for switching time, which means estimating the gate charging/discharging time.

Using a 10k resistor to drive a MOSFET gate is just hopeless for PWM, gates are highly capacitive and need high current drive to switch fast.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

jwatte

#7
Mar 29, 2012, 09:05 am Last Edit: Mar 29, 2012, 09:12 am by jwatte Reason: 1

After some sleep and some more reading, I think it's because with the 5v from the arduino and 12v supply I can only get the Vgs to be -7V and I want it to be 0 to turn off the supply.



What I do is pull the gate up to the drain voltage with a pull-up (between 500 and 10k Ohms, depending on how fast you need it to be.)
Then sink it to ground with a signal-level transistor (I use a BS170 N-channel mosfet.) Thus, a "high" out on the gate of the signal transistor means it pulls the P-channel gate low, and turns it on. A "low" out means that the N-channel turns off, and thus the pull-up turns the P-channel off.
For circuits that need very fast turn-on/off, the gate charge time of the BS170 has to be added to the gate charge time of the P-channel. You probably want to make sure to turn off the P-channel, then wait a microsecond or two, and then turn on the N-channel, and vice versa, for your H-bridge.

MarkT

Pull-ups for MOSFET gate need to be low value (100 ohm or less, not 10k) to achieve reasonable switching speeds for PWM.  If you are only switching on or off occasionally it doesn't matter, but at PWM rates you can rapidly overheat MOSFETs by switching them slowly.  For 5kHz PWM I'd recommend switching times be less than 1us, for instance.  (5kHz is the sort of PWM rate often used for motors)

Such low values for pull-ups aren't usually a good idea (power consumption in the pull-up is high, extra cooling on the PCB may be needed) - _active_ gate drive is the norm with MOSFET driver chips - they only consume power during switching.

Driving a MOSFET directly from an Arduino output pin means you are limited to 25mA or so to avoid overloading the pin, which means about 180 ohm is the minimum gate resistor you can use - for a high current MOSFET with 100nC gate charge that means switching will be in the 4us range or so at best, which means dead-times need to be of that magnitude and PWM should be 1kHz or lower (the default for Arduino analogWrite PWM is 500Hz or so fortunately).

Many MOSFET drivers can deliver an amp or so to the gate, meaning switching is more like 30--100ns (nano seconds...)
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

jimmy__riddle

ok, the attached diagram is what seems to be working.

The diagram is rubbish, I installed circuit diagram and I cant really use it yet! The switch is the optoisolator connected to the Arduino.

Would this be ok running PWM, as it has the 400 instead of the 10k, so should respond quicker?

jwatte


Would this be ok running PWM, as it has the 400 instead of the 10k, so should respond quicker?


Sorry, I wasn't catching on that you were using PWM :-) 400 Ohm may be sufficiently low for the default PWM frequency of the Arduino, at about 490 Hz. Less would be better, but keep a finger on the transistors, and you can tell if they get too hot pretty easily (and turn off the experiment.) However, if you power at 12 V, with 400 Ohm, that'll dissipate more than 1/4W, which is the most common resistor capacity. Make sure you get resistors that can "take the heat" so to speak.

However, if you have optocouplers, how about using two, with an inverter into one of them instead of the resistor? Assuming the resistance of the optocoupler is low, that will be a significantly better design. Similar to CMOS in a way :-)

jimmy__riddle

#11
Mar 30, 2012, 10:52 am Last Edit: Mar 30, 2012, 10:54 am by jimmy__riddle Reason: 1


Would this be ok running PWM, as it has the 400 instead of the 10k, so should respond quicker?


Sorry, I wasn't catching on that you were using PWM :-) 400 Ohm may be sufficiently low for the default PWM frequency of the Arduino, at about 490 Hz. Less would be better, but keep a finger on the transistors, and you can tell if they get too hot pretty easily (and turn off the experiment.) However, if you power at 12 V, with 400 Ohm, that'll dissipate more than 1/4W, which is the most common resistor capacity. Make sure you get resistors that can "take the heat" so to speak.

However, if you have optocouplers, how about using two, with an inverter into one of them instead of the resistor? Assuming the resistance of the optocoupler is low, that will be a significantly better design. Similar to CMOS in a way :-)



ok, thanks, I think I get what you mean. What sort of inverter? I've never used one.

Initially I wasn't planning on using PWM, but it would be nice for it to have the ability to do it, so I can increase the complexity of my sketch once its up and running

jwatte

The best thing to do is probably to isolate the gates for the two transistors, and use two digital out pins. This will let you turn one off before you turn the other on, thus preventing shoot-through. It would also let you turn the entire thing to the "off" state rather than driving one way or the other.
If you really want to use only one control pin, then any kind of inverter will work. An opamp (MCP602) with the signal into the negative pin and the positive tied to a midpoint resistor ladder, for example. Or a 7400 NAND gate with the two inputs wired together. Or a single N-channel MOSFET, such as the BS170.

zoomkat

Quote
Ok, I'm a beginner at this, but trying very hard to learn. I'm trying to use my arduino uno to control a peltier, and I am planning on using an H-bridge from two N and 2 P ch MOSFETs.


There have been numerous discussions by others trying to DIY their own H-bridges based somewhat on internet schematics. I don't remeber any of them being successful.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

jimmy__riddle


The best thing to do is probably to isolate the gates for the two transistors, and use two digital out pins. This will let you turn one off before you turn the other on, thus preventing shoot-through. It would also let you turn the entire thing to the "off" state rather than driving one way or the other.
If you really want to use only one control pin, then any kind of inverter will work. An opamp (MCP602) with the signal into the negative pin and the positive tied to a midpoint resistor ladder, for example. Or a 7400 NAND gate with the two inputs wired together. Or a single N-channel MOSFET, such as the BS170.


Yeah I think I will isolate the gates like you say, for peace of mind that there's not shoot through, as it's going to be doing a lot of switching over its lifetime.  Thanks loads for the help.

Go Up