Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P130] Add simple circuit to get a current sensor , result is Irms #4009

Open
wants to merge 23 commits into
base: mega
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c50f175
First try of a plugin for reading current through ADS1015 + SCT013 ov…
Feb 6, 2022
889b135
Successfull creation of plugin to get current from an alternative pow…
Feb 6, 2022
61835ce
Merge branch 'letscontrolit:mega' into mega
handfreezer Feb 6, 2022
e4e5f38
Merge branch 'letscontrolit:mega' into mega
handfreezer Mar 5, 2022
74232c3
Validation préparation du pull request en plugin 130 dans une branche
Mar 6, 2022
c7b6530
Merge branch 'mega' of https://github.com/handfreezer/ESPEasy into mega
Mar 6, 2022
5f89618
removing local P126 as failed POC
Mar 6, 2022
3119a25
Migrating plugin from local POC P127 to official P130
Mar 6, 2022
1135c89
Applying right way to get a personnal build without polluting git rep…
Mar 6, 2022
26af21f
Few rename and cleaning code/default values
Mar 6, 2022
6ffd1c1
Changing default conversion rate to get a more stable value
Mar 6, 2022
89be65e
rolling back to origin
Mar 6, 2022
69e9877
Adding possibility to select Sample Per Second between 1600/2400/3300
Mar 6, 2022
e77eace
Update README.md
handfreezer Mar 13, 2022
d192d93
Adding documentation for P130 plugin Current Sensor through ADS1015
Apr 3, 2022
eddff51
Merge pull request #1 from handfreezer/mega
handfreezer Apr 3, 2022
5647d1f
Merge branch 'mega' into P130_01
handfreezer Apr 18, 2022
1a76556
Remove local testing profil
handfreezer Apr 18, 2022
afcf524
Merge branch 'mega' into P130_01
TD-er Nov 21, 2022
6e2ecdb
Merge branch 'letscontrolit:mega' into P130_01
handfreezer Nov 25, 2022
f25c9da
Merge branch 'mega' into P130_01
TD-er Dec 23, 2022
95e83cd
Merge branch 'mega' into P130_01
TD-er Sep 1, 2023
02a67dc
Merge branch 'mega' into P130_01
TD-er Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ⚠️ This is a fork of [letscontrolit/ESPEasy](https://github.com/letscontrolit/ESPEasy) and you should prefer to start from original project! This fork is for personnal maintenance and making PR to original project. ⚠️
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should go into the official ESPEasy repository... please remove this from this PR (you can of course keep it in your fork)



|Latest Nightly | Build Status | Downloads | Docs | Patreon | Ko-Fi | PayPal |
|-------|-------|-------|-------|-------|-------|-------|
| [![GitHub version](https://img.shields.io/github/release/letscontrolit/ESPEasy/all.svg)](https://github.com/letscontrolit/ESPEasy/releases/latest) | ![Build status](https://github.com/letscontrolit/ESPEasy/actions/workflows/build.yml/badge.svg) | [![Downloads](https://img.shields.io/github/downloads/letscontrolit/ESPEasy/total.svg)](https://github.com/letscontrolit/ESPEasy/releases) | [![Documentation Status](https://readthedocs.org/projects/espeasy/badge/?version=latest)](https://espeasy.readthedocs.io/en/latest/?badge=latest) | [![donate](https://img.shields.io/badge/donate-Patreon-blue.svg)](https://www.patreon.com/GrovkillenTDer) | [![donate](https://img.shields.io/badge/donate-KoFi-blue.svg)](https://ko-fi.com/grovkillentder) | [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.me/espeasy) |
Expand Down
128 changes: 128 additions & 0 deletions docs/source/Plugin/P130.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
.. include:: ../Plugin/_plugin_substitutions_p13x.repl
.. _P130_page:

|P130_typename|
==================================================

|P130_shortinfo|

Plugin details
--------------

Type: |P130_type|

Name: |P130_name|

Status: |P130_status|

GitHub: |P130_github|_

Maintainer: |P130_maintainer|

Used libraries: |P130_usedlibraries|



Introduction
------------

.. image:: P130_vue_globale.jpg

This plugin can be used to measure Current usage through `Irms <https://en.wikipedia.org/wiki/Root_mean_square method>` using an ADS1015 through I2C.
It is the most simple schematic I succeed to create.
To get it to work, you have to buy an ADS1015 board, an ESP32 (not that ESP8266 might be too slow), and current sensors (I encouraged you to buy the black version, more robust, and smaller).
The only requirement is to buy a current sensor doing the conversion over 1Vac. You have to choose the right calibration in other cases you may definitely break your ADS1015. Say you bought a 30A/1V current sensor, if you try to measure a current of 60A, output voltage will be 2V and your ADS1015 will be burned out!
Note that each ADS1015 can manage TWO sensors! as I'm using the ADS1015 in a differential mode (this avoid managing an offset voltage and a complicated way to get a full range measure)
As ADS1015 can have four I2C addresses, you can manage up to EIGHT current sensors within one ESPEasy unit.

Specifications:
* Output: Irms Current
* Input: 1Vac through current sensor

Wiring
------

.. code-block:: none

ESP ADS1015
GPIO (SCL) <--> SCL
GPIO (SDA) <--> SDA
ADDR (choose on our side, see note below)

Power
3.3V <--> VCC
GND <--> GND

Current Sensor 1 (Canal 1)
P1 <--> ADC0
P2 <--> ADC1

Current Sensor 2 (Canal 2)
P1 <--> ADC2
P2 <--> ADC3

The ADDR pin have to be used to set the wanted address of your choice (have a look on datasheet to configure one)

Setup
-----

.. image:: P130_device_configuration_page.png

Task settings
~~~~~~~~~~~~~

* **Device**: Name of plugin
* **Name**: Name of the task (example name **Irms**)
* **Enable**: Should the task be enabled or not

I2C options
^^^^^^^^^^^

* **I2C Address**: Default 0x48 is used.
* **Force Slow I2C speed**: not needed for ADS1015, and should not be used as it can reduce sampling rate

Calibration - General
^^^^^^^^^^^^^^^^^^^^^

* **SPS** : Sample Per Second : based on my tests, 2400 SPS give the same real SPS as 3600 because of internal code of ESPEasy. Setting to 2400 will slo down the internal converter of the ADS1015 and so, sampling will have a more stable result.
* **Current Frequency** : Needed to calculate the period of sampling for a sinus
* **Nb Sinus to read** : more sinus implies more accuracy, BUT also more blocking time in plugin, SO: I suggest 2 sinus for 50Hz (even for 60Hz too)
* **ADC Conversion Mode Continuous** : this option was coded for test purposes but do not give better result, I suggest to leave it UNchecked (the default)
* **Small Debug to INFO log** : this allow you to get statistic of each conversion on serial console without switching global log level to debug (becuase it is slowing down conversion rate, and so bad results)
* **Voltage estimated** : this is to get from plugin a power conversion. as it is not a real value, the power value is an estimated one based on this voltage.

Calibration
^^^^^^^^^^^

This is where you specify the calibration of the current sensor you connected, say you have connected a current sensor given for 50A/1V, you will indicate 50.

* **Canal 1 - Max current** : Current value for 1V
* **Canal 2 - Max current** : Current value for 1V
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canal is most likely French, in English this should be Channel, ditto in _P130_IRMS_ADS1015.ino (and you probably need to update the screenshots too)


Where to buy
------------

.. csv-table::
:header: "Store", "Link"
:widths: 5, 40

"AliExpress ESP32",""
"AliExpress ADS1015 board",""
"AliExpress SCT013",""
"AliExpress OPCT10AL",""

* **Note : to simply help this famous project ESPEasy, just bought through referral link above!**

Change log
----------

.. versionadded:: 1.0
...

|added|
Initial release version.





Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Plugin/P130_vue_globale.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/Plugin/_Plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ There are different released versions of ESP Easy:
":ref:`P127_page`","|P127_status|","P127"
":ref:`P128_page`","|P128_status|","P128"
":ref:`P129_page`","|P129_status|","P129"
":ref:`P130_page`","|P130_status|","P130"
":ref:`P131_page`","|P131_status|","P131"
":ref:`P132_page`","|P132_status|","P132"
":ref:`P133_page`","|P133_status|","P133"
Expand Down
13 changes: 13 additions & 0 deletions docs/source/Plugin/_plugin_substitutions_p13x.repl
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
.. |P130_name| replace:: :cyan:`Current Irms via ADS1015 I2C`
.. |P130_type| replace:: :cyan:`Current`
.. |P130_typename| replace:: :cyan:`Current - ADS1015 (I2C)`
.. |P130_porttype| replace:: `.`
.. |P130_status| replace:: :yellow:`TESTING E`
.. |P130_github| replace:: P130_IRMS_ADS1015.ino
.. _P130_github: https://github.com/handfreezer/ESPEasy/blob/P130_01/src/_P130_IRMS_ADS1015.ino
.. |P130_usedby| replace:: `.`
.. |P130_shortinfo| replace:: `Current Irms sensor`
.. |P130_maintainer| replace:: `handfreezer`
.. |P130_compileinfo| replace:: `.`
.. |P130_usedlibraries| replace:: `(none)`

.. |P131_name| replace:: :cyan:`NeoPixel Matrix`
.. |P131_type| replace:: :cyan:`Display`
.. |P131_typename| replace:: :cyan:`Display - NeoPixel Matrix`
Expand Down
Loading
Loading