Hi
I am new to such projects. I am trying to use 5 gas sensors with Arduino Mega 2560, but unfortunately there is no voltage change in the sensors. I send you my code to check it. I want to send data from Arduino to excel.
Thanks in advance
int sensorgas1 = A0;
int sensorgas2 = A1;
int sensorgas3 = A2;
int sensorgas4 = A3;
int sensorgas5 = A4;
void setup() {
pinMode (sensorgas1, INPUT);
pinMode (sensorgas2, INPUT);
pinMode (sensorgas3, INPUT);
pinMode (sensorgas4, INPUT);
pinMode (sensorgas5, INPUT);
Serial.begin (9600);
Serial.println ("CELEARDATA");
Serial.println ("LABEL, TIME");
Serial.println ("RESETTIMER");
}
void loop() {
int gaspin1 = analogRead(sensorgas1);
int gaspin2 = analogRead(sensorgas2);
int gaspin3 = analogRead(sensorgas3);
int gaspin4 = analogRead(sensorgas4);
int gaspin5 = analogRead(sensorgas5);
Serial.print(gaspin1);
Serial.print(",");
Serial.print(gaspin2);
Serial.print(",");
Serial.print(gaspin3);
Serial.print(",");
Serial.print(gaspin4);
Serial.print(",");
Serial.print(gaspin5);
Serial.print(",");
Serial.println(",");
delay(1000);
}
Your post was MOVED to its current location as it is more suitable.
Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
Please edit your post to add code tags.
For informed help, post links to the gas sensors and a wiring diagram.
You will also need to read up on how to use the PLX DAQ macro properly, because what you have posted won't work at all.
In addition to what Perry posted, There is no way for anyone to help you without know:
- What are your sensors?
- How are they connected?
- What libraries are you using?
- Have you tried the example from one of the libraries?
- What did you do that would make you think the sensors would change but didn't?
A general comment, You should disconnect all but one sensor and concentrate on that. Until you understand and have it working do not add the others. This includes sending data to excel. You must get each part working individually before combining them into one application.
Using A6? if not ground A6.
clears any residual charge on the sample and hold circuit of the A:D, takes a reading, discard reading, take the real reading, repeat.
Oh yes. waiting for the answers of post #4.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.