Hello everyone. I built a bpard using an Arduino Pro Mini, and I'm supplying the board with 12V 2A. I have an NTC 10K sensor attached to the board, and I want the arduino to read it. I have several other stuff on the board as well but I don't think they are the problem. There is a voltage regulator on the board, which is 5V 0.5A which supplies power to the said NTC sensor. I just connected the 12V to Arduino from RAW pin, which is as far as I know in its powering limits. Here is the problem, when I connect only the 12V and power everything from the barrel jack on the board, I read wrong temperatures. But if I connect the barrel jack to the board, and also the USB connector to the Arduino, I start reading the correct temperature. I am not an electrician and can't figure out what's wrong with it, so can you help me?
Here's the list of everything the board:
ESP8266 --> 3.3V regulator on board
Ethernet Card --> 5V regulator on board
3 NTC sensors --> 5V regulator on board
Arduino Pro Mini --> 12V from barrel jack
SIM800L --> 4V from LM2596
2x16 LCD and I2C module --> 5V regulator on board
I don't think it's a low current problem, I tried to disconnect everything leaving only arduino and an NTC sensor, problem still appears. I believe it's like a reference point problem, as I'm supplying NTC sensors with 5V and Arduino with 12V, but believe me, knowing myself this opinion might be complete bull-crap. Well, thanks for the read, and possible answers!
Oh and here's the part I use to calculate the temperature in the code:
double temp(int i){ //NTC10K calculator
int Vo = analogRead(i);
logRt = log(10000.0*((1024.0/Vo-1)));
TempK = (1.0 / (A + B*logRt + C*logRt*logRt*logRt)); // We get the temperature value in Kelvin from this Stein-Hart equation
TempC = TempK - 273.15; // Convert Kelvin to Celcius
TempF = (TempC * 1.8) + 32.0; // Convert Kelvin to Fahrenheit
return TempC;
}
Temp variables are just defined previously.