DC DC boost converter

i’m trying to use Arduino uno as a PID controller to convert a 7-18V dc input to a 24v dc output
i’ve written this program which seems to work fine in simulation but when i use it in real life using a 9v battery as input i get around 6v in the output instead of 24v (weird considering its a BOOST converter :smiley: ) and the output voltage decreases over time to around 3.5v

<PID_v1.h>

int pwmPin = 6;
int ledPin = 13;
int analogPin = 0;
int val = 0;

unsigned long previousMillis = 0;        // will store last time
const long interval = 500;           // interval at which to delay

double Setpoint, Input, Output;
double Kp=0, Ki=40, Kd=0;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);

void setup() {
  pinMode(pwmPin,OUTPUT);
  pinMode(ledPin, OUTPUT); // onboard LED
  
  TCCR0B = (TCCR0B & 0b11111000) | 0x01; // 62KHz
  analogWrite(pwmPin, 120);
  Serial.begin(9600);

  //initialize the variables we're linked to
  Input = analogRead(analogPin);
  Setpoint = 46; // 46= 24v 92=45V   200=99V 

  //turn the PID on
  myPID.SetMode(AUTOMATIC);
  myPID.SetOutputLimits(0,220);
}
void loop() {
    Input = analogRead(analogPin);    // read the input pin
    myPID.Compute();
    analogWrite(pwmPin, Output);


  // Blink the status LED
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
    digitalWrite(ledPin, !digitalRead(ledPin));
    Serial.println(Input);
    Serial.println(Output);
    Serial.println("");
    
  }
}

these are the components that i’m using:

IRLZ44N power MOSFET
100uH 3A inductor
1N5819 schottky diode
47uF 50v capacitor

and i’ve uploaded the schematics

i can’t figure out what the problem is. can somebody help me plz ?

With a 150Ohm resistor on the output, your nominal power is 3.84W. On the 9V battery side, that's nearly 0.5A.

9V smoke alarm batteries can't output this kind of current. Check the battery voltage while running. Also try checking the output voltage with no load.

MorganS:
With a 150Ohm resistor on the output, your nominal power is 3.84W. On the 9V battery side, that's nearly 0.5A.

9V smoke alarm batteries can't output this kind of current. Check the battery voltage while running. Also try checking the output voltage with no load.

Well when i remove the load output is 24v

So what should i do for the load then to make ot work properly ? Should i choose a bigger load ?

A smaller load: higher resistance.

Or use a power supply appropriate for the output power you want.

So what should i do for the load then to make ot work properly ? Should i choose a bigger load ?

You shouldn't need an "artificial" load resistor at all... What's the 24V for? What's the real load? (What's the 24V for?)

MorganS:
A smaller load: higher resistance.

Or use a power supply appropriate for the output power you want.

Oh right :))

Thank u so much for the advice <3

DVDdoug:
You shouldn't need an "artificial" load resistor at all... What's the 24V for? What's the real load? (What's the 24V for?)

Well right now it's for testing purposes
But in the future its gonna be used to charge a 24v battery (the input is a 18v solar panel)