Hello, I want to get current and voltage values to input into my Arduino UNO at A0 and A1.
At first i was happily coding until when I was about to test it out using a DC power supply. It stumbled upon to me that how is my code/arduino going to detect the current and voltage values. Question is how can I separate the current and voltage so that it can be read by the circuit. Below is a part of the code, it is fairly simple. My problem is that I need help with the hardware, getting the voltage and current values into the ADC I hope someone can help me with this problem.
float pv_I; //input current
float pv_Vnew; //input voltage
void reading(void)
{
pv_I = analogRead(A0);
pv_Vnew = analogRead(A1);
reading_value[0] = pv_I;
reading_value[1] = pv_Vnew;
Serial.print("Current, Voltage: "); //Start of string
for(int i = 0 ; i < 2 ; i++)
{
Serial.print(reading_value[i]);
Serial.print(", "); // Seperate each value with ',' to identify them seperately
}
Serial.println(" END"); // End of string
delay(500);
}