Current monitoring with ESPEasy
Moderators: grovkillen, Stuntteam, TD-er
Current monitoring with ESPEasy
I would like to set up a simple current monitor using CT's for US 120 volt circuits. It does not appear to me that there are any tasks for this type of monitor... am I over looking something? Just starting to look at what and how to build it.
Example of CT:
https://www.sparkfun.com/products/11005
I would like to have the sensor non-invasive, otherwise a sonoff POW would work. This will monitor a sump pump and tell me if it is running, running with no load or off. The key is, did it get stuck on and is it running dry!
Example of CT:
https://www.sparkfun.com/products/11005
I would like to have the sensor non-invasive, otherwise a sonoff POW would work. This will monitor a sump pump and tell me if it is running, running with no load or off. The key is, did it get stuck on and is it running dry!
- Methuselah
- Normal user
- Posts: 45
- Joined: 04 Feb 2018, 01:39
- Location: Boston, MA
Re: Current monitoring with ESPEasy
Along the same lines, how about voltage monitoring, e.g. the amount of voltage on a pin?
N00b to the world of ESPEasy, but I've been programming since the days of punch cards and paper tape
Re: Current monitoring with ESPEasy
Yes and no
This sensors - depending on type - give back an analog current or voltage.
Usually it is a current, seems to be the case with this sensor too.
It delivers an AC current so there is no possibility to connect it directly to the ESP,
some additional electronics is needed.
I've tried this circuit. The Resistor R1 is the load for the current provided from the sensor.
It should be adapted accordingly to the datasheet of the sensor, usually values between 10...100 Ohm.
Do NOT use standard diodes like 1N4148, the schottky diodes are used for a reason.
The Opamp amplifies the voltage delivered from the sensor circuit. Depending on the sensor
and the value of R1 it might be necessary - or not. As the ESP can take a voltage from 0....1V max it
might be possible to feed the rectifier output (connection R3-C2) directly to the ESP.
One disadvantage: This circuit tends to be a bit laggy, it won't show current spikes, short raises or drops of current.
For your purpose this should not be relevant.
Voltage monitoring:
The ESP has one analog input so you may measure voltage (DC 0...1V) from one source.
Voltage and current together same time - no.
Metering mains AC is a more complex thing. This is possible basically by rectifying mains voltage
and divide the voltage down to 0..1 V. This has two disadvantages:
First this isn't much precise as the analog --> digital converter has a resolution of 1024 steps from 0..1 V.
Second and important - this will set your whole circuit to mains voltage - this is dangerous.
If you want to calculate power consumption this will need much more effort. With AC it is not
simply Watt=Volt x Ampere. You will have to meter the phase shift between voltage and current
to caluclate the cos phi factor. For this i'd recommend using a simple power meter with
counter output ("S0 out") and just count the counter pulses with an ESP.
Regards
Shardan
This sensors - depending on type - give back an analog current or voltage.
Usually it is a current, seems to be the case with this sensor too.
It delivers an AC current so there is no possibility to connect it directly to the ESP,
some additional electronics is needed.
I've tried this circuit. The Resistor R1 is the load for the current provided from the sensor.
It should be adapted accordingly to the datasheet of the sensor, usually values between 10...100 Ohm.
Do NOT use standard diodes like 1N4148, the schottky diodes are used for a reason.
The Opamp amplifies the voltage delivered from the sensor circuit. Depending on the sensor
and the value of R1 it might be necessary - or not. As the ESP can take a voltage from 0....1V max it
might be possible to feed the rectifier output (connection R3-C2) directly to the ESP.
One disadvantage: This circuit tends to be a bit laggy, it won't show current spikes, short raises or drops of current.
For your purpose this should not be relevant.
Voltage monitoring:
The ESP has one analog input so you may measure voltage (DC 0...1V) from one source.
Voltage and current together same time - no.
Metering mains AC is a more complex thing. This is possible basically by rectifying mains voltage
and divide the voltage down to 0..1 V. This has two disadvantages:
First this isn't much precise as the analog --> digital converter has a resolution of 1024 steps from 0..1 V.
Second and important - this will set your whole circuit to mains voltage - this is dangerous.
If you want to calculate power consumption this will need much more effort. With AC it is not
simply Watt=Volt x Ampere. You will have to meter the phase shift between voltage and current
to caluclate the cos phi factor. For this i'd recommend using a simple power meter with
counter output ("S0 out") and just count the counter pulses with an ESP.
Regards
Shardan
Regards
Shardan
Shardan
Re: Current monitoring with ESPEasy
This is what I am looking at building... but on a Wemos D1.
http://www.homautomation.org/2013/09/17 ... d-arduino/
Shardan, what are you thoughts regarding that circuit? I realize that it will not be super accurate since there is no voltage reference. But, if I can detect an amp or 1.5 amp difference I should be golden!
http://www.homautomation.org/2013/09/17 ... d-arduino/
Shardan, what are you thoughts regarding that circuit? I realize that it will not be super accurate since there is no voltage reference. But, if I can detect an amp or 1.5 amp difference I should be golden!
Re: Current monitoring with ESPEasy
Might be better to use full size arduino and build a voltage divider to sample mains voltage as well as current. So maybe a arduino with ESP built in.
-
- Normal user
- Posts: 307
- Joined: 06 Nov 2016, 13:45
Re: Current monitoring with ESPEasy
And how about this one? A DC version:
https://nl.aliexpress.com/item/YHDC-SCT ... 03007.html
With a 100KOhm in series, connected to the analog port, should do the job?
https://nl.aliexpress.com/item/YHDC-SCT ... 03007.html
With a 100KOhm in series, connected to the analog port, should do the job?
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.
Re: Current monitoring with ESPEasy
... wich is no DC version but a version with rectifier....
Regards
Shardan
Shardan
Re: Current monitoring with ESPEasy
Detecting 1..3 Ampere shouldn't be a problem at all.
Use the sensor you showed above, the circuit shown in my earlier post ... i'd try first with breadboard to get the right RL value and
see if the opamp is necessary at all. As far as i've seen from the datasheet the RL is rather low, 10 Ohms.
It might be necessary to use a bigger one to get a full scale.
If you configure this circuit to a max of 3A it will give an accuracy around 5..10 mA - quite good I think.
Connecting mains to an arduino for metering is same problem as mentioned above - you will get a direct connection from mains
to the arduino - I don't think that's a good idea.
Regards
Shardan
Shardan
Re: Current monitoring with ESPEasy
I just posted a nice solution for connecting a SCT-013-013 current transformator to ESP Easy WITHOUT sampling the whole input.
viewtopic.php?t=9894
viewtopic.php?t=9894
Re: Current monitoring with ESPEasy
The PZEM-004T modules are a nice option for current and voltage monitoring.
Rob
Rob
Who is online
Users browsing this forum: No registered users and 34 guests