I wanna Display multiple sensors in COM

Hello I have a MQ4 MQ5 MQ7 Sensor and a Uno and I wanna get reading from all the three sensors simultaneously in my COM display how do I get 3 displays from the sensors in one plotter

You can’t get simultaneous readings, only consecutive.

What have you got so far?

I got a consecutive reading of my MQ-5 Sensor it is working but I am trying to get Simultaneous reading even if it is on different plots Like can I get 5 readings from A0,A1,A2,A3,A4,A5

||used CODE||
int sensor=7;
int gas_value;
void setup()
{

pinMode(sensor,INPUT);
Serial.begin(9600);

}

void loop()
{
delay(1000);
gas_value=digitalRead(sensor);
Serial.println(gas_value);
}

Serial.print(gas_value);
Serial.print(",");
Serial.println(gas_value1);

dual plot.PNG

dual plot.PNG

You can get consecutive readings from A0…A5.

But you seem to be using digitalRead, not analogRead

You can only analog read one pin at a time and when you change pins the immediate next read is garbage (ADC just changed changed pins and needs time to "settle" before getting a good read) so you get 1 good read every 210 microsecs or so, all 6 pins can be read and processed in under 2 milliseconds --

is that simultaneous enough for your needs?

pseudocode:
const byte Apin[] = { A0, A1, A2, A3, A4, A5 };  
int Aread;
byte index;
unsigned long startWait, interval;  // don't use delay(), it dead-ends your project

......

void ( loop )
{
  if ( interval == 0 )   // interval serves as execution control
  {
    analogRead( Apin[ index ] );             // 1 read to clear garbage 
    AR = analogRead( Apin[ index ] );    // read good data

............ perhaps print/store the reading 

    if ( index >= 5 )
    {
      index = 0;
      startWait = millis();
      interval = 1000;
    }
    else
    {
      index++;
    }
  }
  else
  {
    if ( millis() - startWait >= interval )   // interval serves as time limit
    {
      interval = 0;  // interval serves as time limit and execution control
    }
  }

  someOtherThing();

  watch_a_button();

  do_something_if_button_pressed();  // like maybe halt collection and dump results/conclusions

  do_something_if_button_released();  // like maybe re-init and re-start collection
}

Just to clarify, my post wasn't trying to answer the simultaneoisty or consecutiveness question, but showing how to print more that one variable by making one long comma delimited print line, ie only printLN the last one.

charles_7832:
how do I get 3 displays from the sensors in one plotter

Hi,
Can I suggest you do some very informative googling.

google

arduino plot more than one line

This is your question, now put it in google.
Google is your friend.

Tom.... :slight_smile:

TomGeorge:
Hi,
Can I suggest you do some very informative googling.

I already answered exactly how to do it in #3.

blomcrestlight:
I already answered exactly how to do it in #3.

Yes, but we are not here to hand feed solutions, we are here to help and show how to obtain information.
It is surprising how many cries for help, can but weren't helped by the OP googling.
Tom... :slight_smile:

If you can run a terminal emulator (like PuTTY on Windoze or your default console on Linuts) then you can use cursor positioning to print data labels and then print the data and update it or edit it in place. The display doesn't have to scroll and keyboard input is sent immediately which lets you code in keys to navigate in and between data screens.

A terminal emulator can make your PC monitor (not Arduino Serial Monitor) work like a big LCD display. Position, print, position, print, ...

Before PC's, people worked at terminals now emulated on PC's. Arduino may be slow for graphic screens but it can slew text faster than eyes can follow. Literally you need to time change updates at least long enough to see or the image blurs.