MOSFET + PWM wont give me full voltage

My setup wont give me low voltage either. The orignal problem uses 12.2v and a downstream N-channel MOSFET. That setup will only go from 12.2 down to 11.8.

Im using this setup (not the same MOSFET, but a type that worked before).

http://bildr.org/blog/wp-content/uploads/2012/03/rfp30n06le-arduino-solenoid.png

My code is real simple

#define voltageP     3

int voltage(int voltage)
{

    analogWrite(voltageP, voltage);
 
}

void setup()
{
}


void loop()
{
  
  
 voltage(255);
 
}

So to solve the problem i did the same setup on a lab board. This setup runs the arduino 5 volts and power an LED. This setup, with the same code will only go between 2 and 4 volts...

Any good thoughts?

We need to know the actual components

Which MOSFET?

Which solenoid?

The one in the fritz diagram is logic level and low Rds(on), which matters.

You should have a small (~150?) resistor between pin 3 and the gate. This reduces the inrush current due to the gate capacitance to a safe level.

But yes, we need to know exactly what MOSFET you are using.

I looked at your wiring diagram. The +60 and -60 volt wires seem poorly defined. Are you using 12v and 0v on those two nodes? I expect that the MOSFET you are using has a Vt threshold voltage of 4v. That is too high. Chose a MOSFET with Vt near 2v, like in the wiring diagram: rfp30n06

I haven't had a 'good' thought in years... All of mine are Magnificent. Much too good to share with the great unwashed.

MarkT:
We need to know the actual components

Which MOSFET?

Which solenoid?

The one in the fritz diagram is logic level and low Rds(on), which matters.

Sorry, for the lack of information. Im not using the solenoid just the rest of the setup.

http://www.uni-kl.de/elektronik-lager/413916 Thats is the MOSFET it's a logic-level MOSFET.

Im not using -60 +60. Im using 12v and 0v.

Docedison:
I haven't had a 'good' thought in years... All of mine are Magnificent. Much too good to share with the great unwashed.

Good for you i guess.. Not sure how that's relevant to the thread though?

puttelino:

MarkT:
We need to know the actual components

Which MOSFET?

Which solenoid?

The one in the fritz diagram is logic level and low Rds(on), which matters.

Sorry, for the lack of information. Im not using the solenoid just the rest of the setup.

http://www.uni-kl.de/elektronik-lager/413916 Thats is the MOSFET it's a logic-level MOSFET.

Im not using -60 +60. Im using 12v and 0v.

How can you not be using the solenoid (or something else that is switched on and off)? The "rest of the setup" is designed to switch something. What is it you are switching? It can't be "nothing", or there will be a big hole in your circuit and it's no wonder it's not working.

Please show the actual circuit you are working with, not the circuit that you based your circuit on.

majenko:

puttelino:

MarkT:
We need to know the actual components

Which MOSFET?

Which solenoid?

The one in the fritz diagram is logic level and low Rds(on), which matters.

Sorry, for the lack of information. Im not using the solenoid just the rest of the setup.

http://www.uni-kl.de/elektronik-lager/413916 Thats is the MOSFET it's a logic-level MOSFET.

Im not using -60 +60. Im using 12v and 0v.

How can you not be using the solenoid (or something else that is switched on and off)? The "rest of the setup" is designed to switch something. What is it you are switching? It can't be "nothing", or there will be a big hole in your circuit and it's no wonder it's not working.

Please show the actual circuit you are working with, not the circuit that you based your circuit on.

Im building a variable Power supply. Are you telling me i can't messure 0-12v without load on the circuit??

That circuit is not switching 0-12V, it is turning a ground connection on and off.

majenko:
That circuit is not switching 0-12V, it is turning a ground connection on and off.

Yes using PWM to aquire a specific voltage between 0v and 12v. Only im geting just between 12.2 and 11.8 for some reason..

No, it does NOT do that.

You have a constant voltage of 12V. What does that 12V go in to? And please don't say "The MOSFET"...

majenko:
No, it does NOT do that.

You have a constant voltage of 12V. What does that 12V go in to? And please don't say "The MOSFET"...

I put a fan in and now i get between 3.5 and 12v. Why cant i get lover?

puttelino:
Why cant i get lover?

I often ask myself the same question... =(

I think you are going about your project the wrong way. You want to vary a voltage, but instead you are rapidly switching on and off a ground connection. The two are not the same thing.

I think what you really want to do is to create a 12V square wave PWM signal and then low-pass filter that to create a voltage.

Without an actual schematic, no one can really help you.

Yes, a schematic would help lots.
But, if you are just wanting a variable voltage, without a load (current), you can get 0 - 5 volts off a pwm pin. If you want it filtered, add a resistor and capacitor.
What is your goal?

He says he wants 0-12V for a power supply, but has it wired up as a low-side switch.

To the OP, I think you are going about this all wrong.