WARNING TO ALL BLYNKERS: MESSING WITH MAINS ELECTRICITY CAN KILL
@scropion86 we live in a block of flats / apartments / condominiums and have a 45A supply but some of the properties in the block have a 30A supply. I think the Electric Company charge less for those with the lower maximum supply.
With sensors you get what you pay for from a couple of dollars to a couple of hundred dollars.
The ACS712 is now discontinued and replaced with the ACS723 which is available in 5A, 10A, 20A and 40A. Even at 3.2V it should be good for +/- 32A.
The ACSXXX only provides current though so you would have to approximate PF. Many households have PF > 0.9 and that is why they don’t promote PF correction equipment to residential users.
Many parts of the world have legislated. some years ago, that all appliances over about 50W have PF correction built in.
AC single phase amps to kilowatts calculation
The power P in kilowatts (kW) is equal to the power factor PF times the phase current I in amps (A), times the RMS voltage V in volts (V) divided by 1000:
P(kW) = PF × I(A) × V(V) / 1000
The only thing missing is schematic. As far as I know, you can’t connect ACS712 directly to A0, because it works in 0-1V range, not 3.2 as stated, output on ACS is 0-5V, so voltage divider or at least pot should be used. Maybe I’m missing something. It’s a little bit confusing, complete project without any wiring instructions.
That’s really strange. I’m using NodeMCU V1.0, and I can’t remember that I’ve read anything about built-in voltage divider. Maybe it’s only related to Wemos D1? I will try this tomorrow anyway. And yes, google was not my friend this time. Thanks, Gunner.
@zodiac the reason we don’t provide a schematic is that if a user doesn’t know how to wire the system up then the ACS712 is probably not for them. We are talking peak voltages over 300V so it’s not for beginners.
Thanks, I’ve already visited github page, I saw that NodeMCU is listed. I just didn’t find info about on board voltage divider in official documentation as it clearly states A0 range is 0-1V. That’s why I shared my worries on this matter with you here, it’s easier if somebody already have on-hands experience, as I know that documentation can be wrong. And yes, I’m completely comfortable working with AC mains, yet it means nothing in this particular case. I’m not asking about AC side, I’m worried about inconsistency of docs available for NodeMCU. I will give it a try tomorrow anyway, worst case scenario is one NodeMCU less
@zodiac never used a nodeMCU but Sparkfun and WeMos clearly show the maximum voltage for their ADC. After pointing out to “Mr WeMos” that his 3.3V was incorrect and that the resistors he chose means it is only 3.2V he updated most, but not all of the references, on his site.
When I asked why he didn’t select the correct resistors to be able to at least read 3.3V (ESP voltage) his reply was “we just copied the nodeMCU”.
I will try to dig out the nodeMCU confirmed ADC maximum.
@Gunner is right to mention the additional 180K resistor or alternatively restrict current reading to 60% of the rated value of the ACS712. I will update the GitHub in due course to reflect this.
The GitHub sketch is specifically for measuring AC current and it would be slightly different for DC current. With the 3.2V ADC of the “plug and play” ESP’s you can “safely” monitor up to 60% of the rated current for the particular ACS712 that you buy. So the 30A modules are good for 18A wired directly to the single analogue port.
Allegro who make the chips also do 50A modules and with a minimum of 180K resistor between the data out and analogue port you can monitor the full rated range of the ACS712.
When I say they can be used “safely” I refer to danger to the ESP and not to yourself. We do not want to encourage anyone to work with mains electricity that is not familiar with the potential harm it can do.
Hi @costas, your code does its measurement every 950ms out of every 2 seconds slice of time. Does that mean that to get a truer indication of total WH used, the final calculation would need to be multiplied with a factor of 2.1 (2/0.95)?
Similar to your 2.1 factor for sub $2 sensors like the ACS712 breakout boards. It assumes the energy used was fixed throughout the 2 seconds.
Our mainstream sensors actually do constant sampling and retain the value within the breakout board.
The main app has 4 overflowing tabs with graphs, configuration menu’s including sensor selection, local currency, cost bands etc. Provides API updates to one of the leading Energy Monitoring websites and the project itself can be controlled with Blynk’s API.
Send me a PM if you like the look of their systems and i’ll give you a few pointers on the best route.
We also use slightly cheaper hardware from another source but it doesn’t offer the plug and play route provided by the OpenEnergyMonitor team. Again send me a PM for details if you need them.