i'm trying to build a energy meter with this tutorial: http://www.openhomeautomation.net/arduino-wifi-switch/
I use a simple relay, acs712 5v sensor and arduino yun. I have already connect all components (see tutorial).
But i'm not able to see how many watt are used. When i'm measuring watt without a load i see value = 3 (analogRead from acs712 5V sensor). It should be 0??
So when i plug a load in my socket, i see different and instable values, sometimes above 3 sometimes under 3.
The formula are:
// Convert to current
amplitude_current = (float)(sensor_value-zero_sensor)/1024*5/185*1000000;
effective_value = amplitude_current/1.414;
effective_power = abs(effective_value*effective_voltage/1000);
power = (int)effective_power;
where am I wrong?