Problem with my project (Energy meter)

I try to build this project for meter the voltage and current of buttery
I use Lipo buttery 3,7V 12000mAh and ACS 712 Current Sensor
This is my schematic:
I use and this code:

 float sample2;
float sample1;
float val;
float actualval;
float amps;
float voltageValue ;

void setup()
void loop() {
for(int i=0;i<150;i++)
sample2+=analogRead(A3); //read the current from sensor
sample1+=analogRead(A0); //read the voltage from sensor
//current calculation
val =(5.0*sample2)/1024.0;
actualval =val-2.5; // offset voltage is 2.5v
amps =actualval*10;
Serial.println("Ampere: ");
//voltage calculation
voltageValue = (5.0*sample1)/1024.0;
Serial.println("Voltage: ");

My probem is when i connect the current sensor the voltage is zero but when i disconnect it the voiltage is normal. Why?
This is my results
Thank you :slight_smile:

Suspect you have a wiring error. Its not clear from your circuit what you are trying to measure but current sensors need to go in series with the load. Your circuit shows it connected in parallel.

Thank you rw950431 for your answer! What to use for load?

The load is whatever is using the power in a circuit. For basic experiments you could use an LED or the globe from a torch. The original instructables link you started from doesnt really explain the power wiring at all (and the author admits he blew up his first system in the comments).

See my circuit of a torch showing how to measure current and voltage in a circuit at

Thank you rw950431 for your help :) I connect it like this: Is it correct? The results that i have are: Voltage:3.93V Ampere:0.25A The voltage is correct but i dont know if the ampere is correct.