Large current draw using analog pins

I am using a Nano to measure 0 to 5 volts on analog pins 0 to 7.

with only 1 input (A0) connected the program worked as intended, and the input was correctly measured.

After upscaling to use all 8 inputs (the diagram shows only A0 connected, but A1 to A7 are wired in the same way), the nano used so much power that the external voltage regulator shut down.

The code is below, please note that the code is for all 8 analog inputs, not just A0

#include <Wire.h>
#include <LiquidCrystal.h>

int sensorPin1 = A0; //AnalogIn 1
int sensorpin2 = A1; //AnalogIn 2
int sensorpin3 = A2; //AnalogIn 3
int sensorpin4 = A3; //AnalogIn 4
int sensorPin5 = A4; //AnalogIn 5
int sensorpin6 = A5; //AnalogIn 6
int sensorpin7 = A6; //AnalogIn 7
int sensorpin8 = A7; //AnalogIn 8

int sensorvalue1 = 0; // variable to store the value coming from AnalogIn 1
int sensorvalue2 = 0; // variable to store the value coming from AnalogIn 2
int sensorvalue3 = 0; // variable to store the value coming from AnalogIn 3
int sensorvalue4 = 0; // Variable to store the value coming from AnalogIn 4
int sensorvalue5 = 0; // variable to store the value coming from AnalogIn 5
int sensorvalue6 = 0; // variable to store the value coming from AnalogIn 6
int sensorvalue7 = 0; // variable to store the value coming from AnalogIn 7
int sensorvalue8 = 0; // Variable to store the value coming from AnalogIn 8

int outputvalue1 = 0; // variable to store the value coming from mapping1
int outputvalue2 = 0; // variable to store the value coming from mapping2
int outputvalue3 = 0; // variable to store the value coming from mapping3
int outputvalue4 = 0; // variable to store the value coming from mapping4
int outputvalue5 = 0; // variable to store the value coming from mapping5
int outputvalue6 = 0; // variable to store the value coming from mapping6
int outputvalue7 = 0; // variable to store the value coming from mapping7
int outputvalue8 = 0; // variable to store the value coming from mapping8

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; // to set digital out to drive LCD
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup()
{

lcd.begin(20,4);     // initialize the lcd

 lcd.setCursor(0, 0);  //specifying the "permanent" characters and placement
 lcd.print("P1:");
 lcd.setCursor(8, 0);
 lcd.print("%");
 lcd.setCursor(10, 0);
 lcd.print("P2:");
 lcd.setCursor(18, 0);
 lcd.print("%");
 lcd.setCursor(0, 1);
 lcd.print("P3:");
 lcd.setCursor(8, 1);
 lcd.print("%");
 lcd.setCursor(10, 1);
 lcd.print("P4:");
 lcd.setCursor(18, 1);
 lcd.print("%");
 lcd.setCursor(0, 2);
 lcd.print("P5:");
 lcd.setCursor(8, 2);
 lcd.print("%");
 lcd.setCursor(10, 2);
 lcd.print("P6:");
 lcd.setCursor(18, 2);
 lcd.print("%");
 lcd.setCursor(0, 3);
 lcd.print("P7:");
 lcd.setCursor(8, 3);
 lcd.print("%");
 lcd.setCursor(10, 3);
 lcd.print("P8:");
 lcd.setCursor(18, 3);
 lcd.print("%");
  
}

void loop()
{
  sensorvalue1 = analogRead(sensorPin1); // read the value from sensor1
   outputvalue1 = map(sensorvalue1, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue2 = analogRead(sensorpin2); // read the value from sensor2
   outputvalue2 = map(sensorvalue2, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue3 = analogRead(sensorpin3); // read the value from sensor3
   outputvalue3 = map(sensorvalue3, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue4 = analogRead(sensorpin4); // read the value from sensor4
   outputvalue4 = map(sensorvalue4, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue5 = analogRead(sensorPin5); // read the value from sensor5
   outputvalue5 = map(sensorvalue5, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue6 = analogRead(sensorpin6); // read the value from sensor6
   outputvalue6 = map(sensorvalue6, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue7 = analogRead(sensorpin7); // read the value from sensor7
   outputvalue7 = map(sensorvalue7, 0, 1023, -25, 100);  // map it to the range of the analog out:
 sensorvalue8 = analogRead(sensorpin8); // read the value from sensor8
   outputvalue8 = map(sensorvalue8, 0, 1023, -25, 100);  // map it to the range of the analog out:

lcd.setCursor(4, 0);  // write the mapped value in specific positions
lcd.print(outputvalue1);
lcd.setCursor(14, 0);
lcd.print(outputvalue2);
lcd.setCursor(4, 1);
lcd.print(outputvalue3);
lcd.setCursor(14, 1);
lcd.print(outputvalue4);
lcd.setCursor(4, 2);
lcd.print(outputvalue5);
lcd.setCursor(14, 2);
lcd.print(outputvalue6);
lcd.setCursor(4, 3);
lcd.print(outputvalue7);
lcd.setCursor(14, 3);
lcd.print(outputvalue8);
 delay(100);
}

I've checked for short circuits, and have found none, and the voltage drop across R2 is about 1 volt.

Please note that my field is as far removed from electronics and programming as can be, so everything here is copy/paste from other peoples projects

Thanks in advance
Rasmus

gaskammertester_simple.pdf (73.7 KB)

The 250 and 8K resistor in parallel, are those supposed to set up as voltage divider?
Not sure what is meant by the |/ on R2.
If so then you want 24V connected to the 8K, and the 250 ohm from there to Gnd.
The Ao junction would then sit at 24 x 250/(8000 + 250) = 0.72V.

If not, are there 8 separate 24V supplies? Is the 24V connected directly to Ax?
Or just 1, with 8 250 ohm loads, drawing a lot of current: 24V/250ohm = 99mA,
8 would draw 800mA, maybe the supply is just getting bogged down.

The 250R (R1) is used to change 0-20 mA to 0-5 Volts.

The 8K is to protect the analog port (It was recommended to protect against high currents with a large resistor. I think 8K should be sufficient without affecting the voltage measurement?)

The arrow on the diagram is meant to show that the wire from R2 goes to A0.

There is not yet any input on the port ( C1-1, C1-2 and C1-3 are connectors, and they are left open at present).

So (as far as I know, I'm not trained in electrickery), since i haven't connected a transmitter yet, the current seems to be going out of A0, through R2 AND R1 to ground. But since the resistance is roughly 8K5, virtually no current should run that way, so I'm baffled.

Is there anything else I forgot to mention?

There won't be output current unless the pinMode is set to OUTPUT and driven HIGH or LOW.
Then 20-40mA of current could flow if the load resistance supported that.
8500 ohm to Gnd would certainly be well below 20mA.

Yes indeed, odd that 8 inputs being driven would create a high current load.