I hate asking help but this time i need some coding help.
It operates on 5 V and gives a value difference from the reference voltage 2.5 Volts measured on Pin 1.
(yes ik know the imp only measures to 3.3, but ill put a R divider between it, that cuts it in half)
All works fine with this code from the Bearded professor.
local voltage = hardware.voltage();
local reading = hardware.pin1.read();
return (reading / 65535.0 ) * voltage;
server.log(" voltage Pin1 " + getPin1Voltage());
I get the 2.5 Volt measurement logging and streaming to a host, but i'am stuck on the formula to measure on PIN1 and covert it to
a readable mA / Amp .
The formula i tried was : return (reading / 65535.0 ) * voltage - 2.5 /0.185;
output pin 1 - 2.5 = 0, it should give the difference (or used amps) /0.185 (amp scaled).
Can u plz advise or set me on the right track with an example how to do it properly?
Used sensor: http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs/ACS712.aspx