I want to plot the values from a ORP Circuit that displays measurements from -1V to 1V against the values of a String Potentiometer that tell me position of my ORP (Oxidation Reduction Potential) measurements.
I have the ORP circuit connected to my Arduino through pins D2 (from ORP TX) and D3 (from ORP RX), GND and 5V.
My String Potentiometer is, as any pot that I know, connected to my Arduino through A1, GND and 5v.
But there's no way I can make sense of my readings with my code! I use a Software Serial Example for reading my ORP circuit:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(300);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
}
And that works OK. But as soon as I also introduce my POT ( in this case I just Serial.print a letter for being able to locate it) it's imposible for me to discern between the values, for they are printed intertwined:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(300);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
Serial.println('a'); //that would be my POT
}
So that if the value of my ORP reading is -240.6, I will get -a2a4a0a.a6a on the serial monitor. And I can understand that from the loop. Nontheless I can't come with any way of getting, following with the previous example: -240.6 a.
Someone that can come with a solution to that?