Plugin217

From Let's Control It
Jump to navigation Jump to search

Introduction

This plugin aims to provide support for ACS712 sensors for AC measurement. Plugin217 is not usable for DC, for that you can use the Analog input plugin. The sensor is not very 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. As the ACS712 is a 5V module, you will also need two resistors for a voltage divider 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.