How to read the current on Arduino

I'm a 17th years old student that is starting to do the project of monitoring the current of my school instalation and I don't know how to read the current of one LDR in the Monitor Serial in my Arduino IDE, it's the first step to do this great project.

Can anyone help me?

Thank you a lot!!

Robert Wall's picture

Re: How to read the current on Arduino

What you read in the serial monitor depends on which sketch you are running in your Arduino. Until you say what that sketch is, we cannot help you.

AtomicBlast's picture

Re: How to read the current on Arduino

This is my sketch:

int LDRpin = A0;
int LDRadc = 0;
float LDRvoltaje = 0;

void setup() {
pinMode(LDRpin, INPUT);
Serial.begin(9600);
}

void loop() {
LDRadc = analogRead(LDRpin);
LDRvoltaje = LDRadc*(5.0/1023);
Serial.print("Voltaje LDR: ");
Serial.println(LDRvoltaje);
delay(500);
}

When I open the Monitor Serial, it appear some numbers that change with the amount of light, but I don't know if that numbers are the current of the LDR or the voltage.

Thanks

Simon's picture

Re: How to read the current on Arduino

Now we need to see how you connected the LDR to the A0 pin.

Robert Wall's picture

Re: How to read the current on Arduino

AtomicBlast:

The Arduino ADC input measures only voltage. It cannot measure current directly. You can easily calculate the current if the current flows in a resistor whose value is constant and you know what that value is. It is called Ohm's Law, and I think you need to read and learn about it. You can do that calculation in your sketch.

AtomicBlast's picture

Re: How to read the current on Arduino

Oh thanks, I understand, I can't mesure current, okey. Thanks you a lot!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.