Need column format

Just getting started it's been fun so far - I'm putting together a sketch for plant moisture monitoring and would like the see my data in columns instead of left aligned in the serial monitor I know I'm missing something basic I'm just stuck on this part here's where I'm at so far any guidance would be appreciated:

int led1 = 4;
int led2 = 5;
int led3 = 6;
int led4 = 7;

void setup() {
  // initialize serial communication at 9600 bits per second:
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  Serial.begin(9600);
}


void loop() {

  // read the input on analog pins 1,2,3,4:

  Serial.println("        ");
  Serial.println("Sensor 1");


  int sensorValue1 = analogRead(A1);

  if (sensorValue1 >= 0 && sensorValue1 <= 600) {
    Serial.print(sensorValue1);
    digitalWrite(led1, HIGH);
  }
  else {
    Serial.print(sensorValue1);
    digitalWrite(led1, LOW);
    Serial.println("        ");
    Serial.println("        ");
  }
  //Seperator+++++++++++++++++++++++++++++++++++++++++++++++++++++++


  Serial.println("        ");
  Serial.println("Sensor 2");


  int sensorValue2 = analogRead(A2);

  if (sensorValue2 >= 300 && sensorValue2 <= 600) {
    Serial.print(sensorValue2);
    digitalWrite(led2, HIGH);
  }
  else {
    Serial.print(sensorValue2);
    digitalWrite(led2, LOW);
    Serial.println("        ");
    Serial.println("        ");
  }
  //Seperator+++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Serial.println("        ");
  Serial.println("Sensor 3");


  int sensorValue3 = analogRead(A3);

  if (sensorValue3 >= 300 && sensorValue3 <= 600) {
    Serial.print(sensorValue3);
    digitalWrite(led3, HIGH);
  }
  else {
    Serial.print(sensorValue3);
    digitalWrite(led3, LOW);
    Serial.println("        ");
    Serial.println("        ");
  }
  //Seperator+++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Serial.println("        ");
  Serial.println("Sensor 4");


  int sensorValue4 = analogRead(A4);

  if (sensorValue4 >= 300 && sensorValue4 <= 600) {
    Serial.print(sensorValue4);
    digitalWrite(led4, HIGH);
  }
  else {
    Serial.print(sensorValue4);
    digitalWrite(led4, LOW);
    Serial.println("        ");
    Serial.println("        ");
  }
  delay(5000);
}

Any use ?

http://www.hobbytronics.co.uk/arduino-float-vars

The easiest way to create aligned columns is to print a tab character (or two) between items. Use plain print() for each item except for the last one where you'd use println().

Serial.println("Table");
Serial.print("Reading A:");
Serial.print("\t");  // print a tab character
Serial.println(myReadingA);

You may need to experiment a little to get the right layout.

mrbilky:
Just getting started it's been fun so far -

  }

delay(5000);
}

I think you need to be a bit more realistic about what you want to do. There is a strong implication here that you are sitting in front of your serial monitor watching the grass grow - albeit with neatly formatted data at depressingly regular intervals.

If, instead of the serial monitor, you send the data to a proper terminal programme, like RealTerm, you can use commas instead of the tabs described above and record the data to a .csv file. This enables you to view the data in a spreadsheet when you have run out of more important things to do, and do all those spreadsheety type things.. RealTerm is a freebie and enables you to timestamp your data, using the PC clock.

I'm sure that, ultimately, you will even better that, by recording the data to SD instead, thereby enabling you to do more useful things with your computer, like turning it off. The data recorded is in the same format, and can be read in a spreadsheet at leisure.

Martin-X:
The easiest way to create aligned columns is to print a tab character (or two) between items. Use plain print() for each item except for the last one where you'd use println().

Serial.println("Table");

Serial.print("Reading A:");
Serial.print("\t");  // print a tab character
Serial.println(myReadingA);




You may need to experiment a little to get the right layout.

Thanks for the input will give it a go tomorrow as you can see by my code I was getting data blind thats why I put that separator between the blocks of code figure its something simple I was at it for a while just needed to take a break and put it out there to get fresh eyes on it.

Nick_Pyner:
I think you need to be a bit more realistic about what you want to do. There is a strong implication here that you are sitting in front of your serial monitor watching the grass grow - albeit with neatly formatted data at depressingly regular intervals.

If, instead of the serial monitor, you send the data to a proper terminal programme, like RealTerm, you can use commas instead of the tabs described above and record the data to a .csv file. This enables you to view the data in a spreadsheet when you have run out of more important things to do, and do all those spreadsheety type things.. RealTerm is a freebie and enables you to timestamp your data, using the PC clock.

I'm sure that, ultimately, you will even better that, by recording the data to SD instead, thereby enabling you to do more useful things with your computer, like turning it off. The data recorded is in the same format, and can be read in a spreadsheet at leisure.

Thanks for the info I'm really new at this I am trying to get the basic concept of my project and when it meets my expectations I will then attempt to add wifi, a data logger, lcd and so on for instance I had a single relay when I started and once I got the single code where I was happy I bought a 4 relay shield and screw shield I really hate these jumper wires. I plan on having 4 relays and 4 valve solenoids active to work together to feed and water plants via moisture sensors it's coming along happy with my progress so far.

mrbilky:
I bought a 4 relay shield and screw shield I really hate these jumper wires.

I don't know much about relays, but I imagine you could mount them all on a proto shield that plugs into the Arduino, thereby getting rid of all the jumpers.

The "and so on" probably includes an SD and an RTC.