Plugin217

From Let's Control It
Revision as of 22:42, 4 November 2018 by Janjoh (talk | contribs) (Created page with " == Introduction == This plugin aims to provide support for ACS712 sensors for AC measurement. It is not usable for DC, for that you can use the Analog input plugin. The senso...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This plugin aims to provide support for ACS712 sensors for AC measurement. It is not usable for DC, for that you can use the Analog input plugin. The sensor is not extremely accurate when used from a ESPEasy as the only way to get reliable readings is to take many samples over an extended period of time.


Hardware

You need an ACS712 module as available on eBay, AliExpress or many other places. You also need two resistors as the ACS712 is a 5V module. It will not run accurately on 3.3V. This also means that a voltage divider is needed to scale down the output voltage from the sensor.

ACS712 Wemos D1.png

The resistor values are not critical, they can be configured in the plugin, but the values listed in the above image works pretty well, bringing the max voltage down to approximately 3.14V. Whichever resistors you pick, please ensure that the output stay within the tolerance of your MCU.


Configuration

Model selection: Here you must select the type of module you have as it is available in 5A, 20A and 30A versions.

Sampling period in ms: As i mentioned before, the plugin must run many sammples to find the peak values, the longer the better, but for code stability, keep it under 1000ms. For me, around 500ms works well enough.

R1 and R2: Input the values of your R1 and R2 resistors as integers.

Interval : How often you want to obtain a measurement. Keep this over 2 seconds.