Hi all,
I am trying to read voltages from 4 analog sensors and display them on the serial monitor in 4 columns. I would ideally like to be able to then import this data in Excel so I can compare data.
I am using the Sparkfun Arduino Pro Mini 528 in the 5V configuration.
My understanding is that I will have to use delays, since the Arduino only has one ADC onboard. Have to timeshare it, essentially. Is this correct? I found this old thread: reading multiple analog inputs - Sensors - Arduino Forum
I tried writing my own code for a 2 sensor readout, but the serial monitor displays it all in one column I think. Can someone advise on how to handle the code to get the data in this format?
Code and screenshot below
// SETUP:
void setup() {
Serial.begin(9600); // initialize serial communication at 9600 bits per second:
}
// LOOP:
void loop() {
int ledPin = 3; // LED connected to digital pin 3
digitalWrite(ledPin, HIGH); // sets the LED on
int sensorValue3 = analogRead(A3); // read the input on analog pin 3:
delay(10);
float voltage3 = sensorValue3 * (5.0 / 1023.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
delay(10);
Serial.println(voltage3); // print out the value you read:
delay(10);
int sensorValue2 = analogRead(A2); // read the input on analog pin 3:
delay(10);
float voltage2 = sensorValue2 * (5.0 / 1023.0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
delay(10);
Serial.println(voltage2); // print out the value you read:
delay(10);
}
<img = src= "Workbench">
Note: The ultimate application goal is to determine how much noise a sampling of 4 identical commercial sensors have.
See my other thread here for more on the sensors: Can I Power 4x LEDs and 4x Phototransitors off Sparkfun's Arduino Pro Mini 528? - Project Guidance - Arduino Forum
