-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
handfreezer
wants to merge
23
commits into
letscontrolit:mega
Choose a base branch
from
handfreezer:P130_01
base: mega
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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…
889b135
Successfull creation of plugin to get current from an alternative pow…
61835ce
Merge branch 'letscontrolit:mega' into mega
handfreezer e4e5f38
Merge branch 'letscontrolit:mega' into mega
handfreezer 74232c3
Validation préparation du pull request en plugin 130 dans une branche
c7b6530
Merge branch 'mega' of https://github.com/handfreezer/ESPEasy into mega
5f89618
removing local P126 as failed POC
3119a25
Migrating plugin from local POC P127 to official P130
1135c89
Applying right way to get a personnal build without polluting git rep…
26af21f
Few rename and cleaning code/default values
6ffd1c1
Changing default conversion rate to get a more stable value
89be65e
rolling back to origin
69e9877
Adding possibility to select Sample Per Second between 1600/2400/3300
e77eace
Update README.md
handfreezer d192d93
Adding documentation for P130 plugin Current Sensor through ADS1015
eddff51
Merge pull request #1 from handfreezer/mega
handfreezer 5647d1f
Merge branch 'mega' into P130_01
handfreezer 1a76556
Remove local testing profil
handfreezer afcf524
Merge branch 'mega' into P130_01
TD-er 6e2ecdb
Merge branch 'letscontrolit:mega' into P130_01
handfreezer f25c9da
Merge branch 'mega' into P130_01
TD-er 95e83cd
Merge branch 'mega' into P130_01
TD-er 02a67dc
Merge branch 'mega' into P130_01
TD-er File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)