Ohm meter problem

Hi, I have a problem reading a variable resistance.
https://banggood.app.link/onJn3u0C8X

I use R1 3.8k + R2 variable 5k

the value on the LCD monitor is incorrect... stamp 3.81 (!?!?!)
Intest a volt meter usual problem

int analogPin= 0; // Pin Analogico A0
int raw= 0;  
int Vin= 5;  // Volt in uscita dal Pin 5V di Arduino
float Vout= 0;
float R1= 1000; // impostare il valore della resistenza nota in Ohm
float R2= 0;
float buffer= 0;
 
#include <Wire.h>     // Libreria wire già presente in Arduino ide      
#include <LiquidCrystal_I2C.h> // Libreria display I2C
 
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
 
void setup()
{
  lcd.begin(16, 2); //Inizializzazione display
Serial.begin(9600); //Apro la comunicazione seriale
}
 
void loop()
{
raw= analogRead(analogPin);
if(raw)
{
buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
Serial.print("Vout: ");
Serial.println(Vout);
Serial.print("R2: ");
Serial.println(R2);
lcd.print("OHM METER");
lcd.setCursor(0, 1);
lcd.print("R2:  ");
lcd.print(R2);
delay(1000);
lcd.clear();
}
}

I believe that if you are only measuring resistance, you do not need voltage in the equation.

If R2 is the unknown resistance at the top of the potential divider and you have a 1K resistor at the bottom of the potential divider, then:

R2 = ( 1024.0 / analogReading ) - 1.0 where R2 is in units of 1k ohms

Edit
If you also want volts at the mid point of the potential divider:
Volts = ( analogReading * 5.0 ) / 1024.0 for a 5 volt arduino

ok, voltmeter is not in the circuit. the problem is that the ohmmeter does not detect a correct resistance

In the diagram, it appears that you have a 1K resistor labeled R1 and this is at the bottom part (or low side) of a potential divider.
You have a conflicting statement that R1 is 3.8K in your text.
Anyway, as I said, the formula for calculating the value of the unknown resistor at the top (or high side) of the potential divider is simple and does not involve volts at all.