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

Any Sonoff device compatible with a clamp on current meter such as STC-013 #3626

Closed
c3reeman opened this issue Aug 28, 2018 · 65 comments
Closed
Labels
awaiting feedback Action - Waiting for response or more information question Type - Asking for Information

Comments

@c3reeman
Copy link

Has anyone used or been able to use a clamp on current meter with any of the sonoff range ?

such as...

https://www.aliexpress.com/item/THGS-YHDC-30A-SCT013-0-100A-Non-invasive-AC-New-Sensor-Split-Core-Current-Transformer-New/32735255457.html?spm=a2g0s.13010208.99999999.272.69863c00L9G8aK

Its intended use is to monitor the current pulled from a cellar sump pump, accuracy isnt important really its just to get an indication of pump on/off. I know the obvious answer to this maybe use a sonoff POW R2, i did this however it failed and the onboard switch went open circuit after only a month of service... so the very thing that was supposed to monitor sump pump failure is the very thing that caused the failure ! A non invasive current monitor would eliminate this happening.

@Frogmore42
Copy link
Contributor

That only puts out 1V at 30A, so it would might need an amplifier depending on the load. Or, you could put it into the analog input. The NodeMCU boards have a built-in resistor divider to make full scale 3V3. You would probably want to full-wave rectify the signal and put a capacitor on it to smooth it out. This should give you an indication of the pump being on or not.

@ascillato2 ascillato2 added question Type - Asking for Information awaiting feedback Action - Waiting for response or more information labels Aug 29, 2018
@pmknowles
Copy link

The PZEM-004T works well with Tasmota. If you buy the cheap ESP8266 relay board from the internet (the one with the sub-board parallel to the long edge). Flash it with Tasmota. Select Generic and choose PZEM Rx for Tx and PZEM Tx for Rx. You can then connect the PZEM to the pin header between the relay and power terminal blocks. Use a USB charger PSU or a 5V buck to connect to the power and it will be fine. You'll need to install into an adaptable box as there is live AC on the PZEM. The relay on the board won't work by the way.
The PZEM is fairly accurate and the CT is rated up to 100A. What current is the sump pump rated at?
There are two versions of CT (split and one piece). It goes aroubd the live wire only.
If you want any further information let me know.

@c3reeman
Copy link
Author

Thanks for all the advice guys, I’ve got quite a few parts coming from aliexpress now including a nodemcu , wemo d1 mini and I’ve just added a PZEM-004T following your advice.

Could you be more specific about the esp board your refering to @pmknowles, Have I already baught it ??

Once again thanks for the help

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

I use a sonoff basic back to back with the PZEM-004T encased in the box available from itead. https://www.itead.cc/smart-home/sonoff-ip66.html

@c3reeman
Copy link
Author

Ah that’s just perfect, sale on over at aliexpress so Ive already got another 20 sonoff basic’s coming.

Now I know I can use a sonoff and simply select the pins I’m much more in my limited knowledge comfort zone

Great work thankyou

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

Picture:

img_20180829_095139

@c3reeman
Copy link
Author

Looks good and I’ve got some of them boxes spare as well, I’m almost good to go I’m just doing a bit more research now and one thing I’m struggling with is the gpios and where to connect to the sonoff basic, please could you give details of which pins you connected it to, And if you have one plugged in and handy could you be so kind as to post a picture of the configuration layout on tasmota web gui ?

I can’t thank you enough for all the help and the great work you have done with tasmota, my entire home automation system is now 90% tasmota I’ve just got a few unreliable z wave door sensors to swap with tasmota and that’s it

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

Tasmota config:

image

I also had to add a 1k resistor to the PZEM-004T to change the serial interface power need from 5V to 3V3.

img_20180829_102810

The four colored wires are then connected to the Sonoff Basic header:

  • 3V3 Red
  • Rx Yellow
  • Tx Green
  • Gnd Grey

image

@c3reeman
Copy link
Author

Absolutely brilliant thankyou,
Looking forward to reviving the parts from China !

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

As I wanted to document this anyway I just made an entry in the wiki https://github.com/arendst/Sonoff-Tasmota/wiki/PZEM004T-Energy-Monitor

Feel free to update with your experience once build.

@pmknowles
Copy link

pmknowles commented Aug 29, 2018 via email

@meingraham
Copy link
Collaborator

@arendst what is the difference between what you've built to monitor energy and say the POW or the S31? Is your device limited to a 10A load due to the use of the Sonoff Basic?

@pmknowles ditto. Also, other than the 5V input, what is the primary difference between the HW-655 and a Sonoff Basic?

Thanks.

P.S. Still looking for someone who's used a PZEM to monitor a clothes dryer's energy use that handles the higher amperage.

@pmknowles
Copy link

pmknowles commented Aug 29, 2018 via email

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

The advantage of the PZEM-004T is also that you can connect a load without using a relay. This can be done with a Pow or S31 but then you have to short the relay.

In my case it's a complete copy of a Pow as I also use the Basic relay. BTW the energy monitoring of the PZEM-004T looks to me better than the old Pow.

@meingraham
Copy link
Collaborator

@pmknowles @arendst

Apologies for high density factor on my part ;-)

I THINK I get it now...

The Sonoff Basic or HW-655 is powered by appropriate means in order to run the "smarts". The relay on the unit is not (necessarily) used to control the load. In the case of my dryer use case, it would not be used.

The PZEM is powered by 5V and hooked up to the load to be monitored, It sends its "readings" via serial interface to the smart switch (Sonoff or HW-655). The the higher power draw is completely handled by the PZEM.

Did I get it?

Mike

@arendst
Copy link
Owner

arendst commented Aug 29, 2018

Yep.

@meingraham
Copy link
Collaborator

@pmknowles

In your previous post, since you replied via e-mail, the image you'd sent did not make it into this track. Can you post that photo?

Thanks.

Mike

@pmknowles
Copy link

pmknowles commented Aug 29, 2018

wp_20180829_12_31_06_pro
There you go With hindsight (and for the next one for the cooker) I will put the PZEM at the bottom, the 5V buck above it and rotate the HW-655 clockwise through 90 degrees.
wp_20180829_15_46_06_pro

@meingraham
Copy link
Collaborator

meingraham commented Aug 29, 2018

@pmknowles

What's the part number on your 5V buck?

Does the HW-655 come with the ESP-01 or is it ordered separately?

@pmknowles
Copy link

pmknowles commented Aug 29, 2018 via email

@pmknowles
Copy link

@meingraham
Copy link
Collaborator

meingraham commented Jan 2, 2019

My HW-655 based PZEM-004T power monitor for my 240V US standard electric clothes dryer.
034481009559
20181223_154016
20181223_170453
image
dryer monitor hw-655 pzem module configuration

@amitubale
Copy link

amitubale commented Jan 10, 2019

My HW-655 based PZEM-004T power monitor for my 240V US standard electric clothes dryer.
034481009559
20181223_154016
20181223_170453

Hi - Thanks for the pictures. I am planning to use it for the 220V dryer too.

  1. To confirm is this your wiring
    ---110v-----------------------------------------------------------------Line Dryer pin
    ---110v------------PZEM Line--------------between CT Coil----------Line Dryer Pin
    ---Neutral---------PZEM Neutral---------------------------------------Neutral Dryer Pin

  2. Since you are using a 5v buck converter and the ESP8266 relay board, you skipped the 1K resistor on the PZEM board on the VCC OUT going to the esp8266 relay board.

  3. The Blue enclosure - is that from Lowes or Home Depot ? OR you got it online ?

  4. Why use a relay board and not a simple D1 Mini. What are you using the relay for ?

  5. If i use a D1 mini can the 5v from the PZEM can be sufficient of i do need to have a 5v buck converter.
    Thanks

@meingraham
Copy link
Collaborator

@amitubale

  1. Correct except I wouldn't state it as "between CT Coil" but "through CT Coil"
  2. I have the 5V and GND out from the buck converter connected to the power input terminals of the HW-655. The HW-655 has four separate pins for the serial interface. I use the 5V and GND pins on the serial pins as input to the PZEM serial interface along with the Rx/Tx pins. This is the same setup @pmknowles has in his device (link). I do not believe that a resistor is required.
  3. I actually purchased mine at Home Depot. The interesting thing is that when I looked for the part that was on the label of the circuit box, I could only find it on the Lowes website. The Home Depot website didn't have it and I looked for it both with the part number as well as looking at all of the circuit boxes in its online catalog. It's not like they are discontinuing it as there were two or three boxes full of them at the my Home Depot store. My sense is that this is a pretty common part. It worked great to fit everything and the opening flap made it easy to get everything placed inside. BTW, everything is just hot glued in place.
  4. You're right, I don't need the relay. In fact, to use the PZEM with the HW-655 means that the relay cannot be used (because the relay is intended to be controlled via serial commands). The HW-655 just made the serial interface simple and didn't require me having to deal with both 5V for the PZEM and 3.3V for the ESP device. The HW-655 took care of the 3.3V regulation for me.
  5. I do not believe the PZEM supplies the 5V. I think the PZEM 5V is an input to which you have to provide power. In this post (link) it has this statement "... the PZEM will return "-1" to everything unless it is connected to power on both sides. That means GND and 5V DC on the data side and 80V-260V AC on the measuring side." I take this to mean you have to provide power to the data side and the AC side is only measuring the AC power metrics. I have not looked at the PZEM circuitry, but this tells me that the AC supply is not used to supply the DC circuitry. I think the reasoning is that doing so would mean that doing that would draw power from the AC thus affecting the actual AC power measurements. In fact, you should take care to where you tap the Dryer's AC Line for the buck converter so that current draw is not registering through the CT Coil. Anyway, long way to say, the PZEM DC it's powered from the HW-655 or directly from the buck converter. But it's just simpler to take it from the HW-655 via the serial interface pins.

As an aside, take a look at this Shelly device coming mid-March. Rated for 120 amps - more than enough. It would be a much easier way to do this. It would consolidate the three separate modules and reduce a lot of the wiring. Had I not already bought the parts and built mine the week before this was announced (!), I would probably go the Shelly EM route.

Mike

@fragolinux
Copy link

fragolinux commented Jan 20, 2019

The advantage of the PZEM-004T is also that you can connect a load without using a relay. This can be done with a Pow or S31 but then you have to short the relay.

In my case it's a complete copy of a Pow as I also use the Basic relay. BTW the energy monitoring of the PZEM-004T looks to me better than the old Pow.

2 questions:

  1. so you don't use the relay part at all? Or in case you're limited to the 10A load max of the relay, or even less in case of inductive load, right?
  2. don't you need to turn off serial debugging to use sonoff's rx and tx, or this is due only in case of using them as general gpios?

thanks

@ascillato
Copy link
Contributor

1- a PZEM is another sensor. See the pictures. You don't need to connect it to any relay if you want.

2- when you select the gpios for the sensor as the tx and rx pins of the esp8266, Tasmota put seriallog to 0 automatically.

@pmknowles
Copy link

pmknowles commented May 10, 2020 via email

@Montreal666
Copy link

Montreal666 commented May 10, 2020

Thanks; Just to be clear, can I use 120v from any source to feed the PZEM or does it absolutely have to come from the same circuit I am monitoring? If it doesnt I will build a self contained Box with a 120V power cord+CT clamp and will simply clip it around one of the 120V hots inside the dryer. Would that work?

PS: The usb charger would imply an additional external component; would rather use power from the Buck converter.

@pmknowles
Copy link

pmknowles commented May 10, 2020 via email

@Montreal666
Copy link

Ok will do some testing when I get the components and report back.
If anyone else has experience with North american current/devices please chime in.
Again I don't want to overengineer this, only need to know if the dryer is pulling high current (working) or not (Idle).
Cheers,

@CarlosGS
Copy link

CarlosGS commented Aug 8, 2020

can you confirm this is accurate (assuming the 1K resistor is added):

2020-05-10_135247f

Thanks, hopefully this will help other people as well.

^^^^^^^ Can confirm that this works perfectly! ^^^^^^

It helps a lot, thank you @homeseer666 🙏

note that the 1k resistor looks like this in new SMD boards: #6050 (comment)

Also leaving this here, just in case others face the same problem:
photo5870733863272166413

@Montreal666
Copy link

Thanks fot the feedback @CarlosGS !

Glad to hear the visual design helped... and worked =)

I actually just received (part of) my Aliexpress order from 3 months ago....
Will also deploy on my end.
The sonoff basic sounds like a good/simple solution but I also ordered the HW-655+buck converter based on the above thread.
I havent received the HW-655 yet but will test both options.

Will also test using a separate 120v feed (from the same receptacle as the washer for instance) and just clamp the sensor to one of the phases on the dryer to see if it affects readings. I would prefer this option since I could make the monitoring device self contained with a smaller footprint (vs a bulky 240V bypass box). Easier to switch to another dryer/device if needed.

Will report back, cheers

@Montreal666
Copy link

Montreal666 commented Jan 11, 2021

For anyone interested, I finally had time to tackle this project;
requirements:

  • ability to easily move the device around if needed or for testing purposes;
  • nothing bulky (which typically doesn't fit behind a dryer) or that would require rewiring.

Therefore I decided to build the device as a stand alone sensing unit;

I tested both designs described above and they work perfectly (HW-655 and Sonoff Basic) thx to @arendst, @pmknowles , @meingraham )
However, I had no other use for a HW655/buck converter laying around so decided to go that route (+ no mod required to the PZEM). Simply used a small project box.

image
image

Seems like feeding the PZEM with a separate 120v circuit (vs using one "live" from the "sensed" 240v appliance circuit) wasn't tested above so I can confirm that it is working fine.
240v appliances use both sides of the split-phase so not sure if the 120v circuit location makes any difference (feel free to chime in) .

image

The unit is just slighly bigger than a deck of cards so you just mount it to the back of the dryer and run the split core around one of the live wires. As I expected, my dryer has a small service panel so installation was a breeze.

image
image

Since north american houses are on split-phase, shown voltage is 120v which reflects one of the 2 live wires used for the split core; however since we are working with split-phase (and not "2" phases https://theengineeringmindset.com/120-240v-split-phase-us-can/) , current should be accurate and you simply need to multiply wattage & energy *2). @meingraham, I guess your results are similar?

I'm not 100% sure if apparent/reactive power metrics are ok, but I'm sure some data post processing should resolve any inaccuracies if the data is relevant to you. Not here as I just needed to know if device is off/idle/working.

image

Hope this helps other North american DIYers.

Cheers,

@Montreal666
Copy link

Montreal666 commented Apr 22, 2021

Just built a Sonoff basic version; works equally well with less components;
About 20$ for the Sonoff basic + PZEM + Split CT + enclosure and wires.

2021-03-23 01 07 24

@dajrekt
Copy link

dajrekt commented Jun 21, 2021

Hi Guys,
I read this thread as I'm going to measure some high voltage devices like cooker, water heater, dryer etc

I'm going to go with pmknowles project so I would like to connect the clamp in the fuse box. I pretty much understand all PZEM wiring and what does what however not sure of a few things

  1. Does the PZEM have to be power up with the same fuse/source of the measure device or can it be any source? I thought PZEM can handle up to 100A when using a clamp for measurement. Is it safe to power it up with the line where the load might be 30-40A? I suppose if it is a paraller connection the load is whatever PZEM takes even from the same fuse (FUSE box) ? If it is serial connection (extension lead) the load is whatever measure device takes?

  2. On the picture of pmknowles what's the cable size of live wire ? is it 1.5? What would be recommendation here?

  3. I also notice some of you use sonoff basic for their project and made like an extension lead to control on/off . I'm I right as by doing it this way you can only use it for load up to 10A as Sonoff basic max load is 10A?

Sorry for probably lame questions but I'm not an electrician. I will call for one of to make wiring in the fuse box for sure . Just wanted to know how this should be connected before I call for anyone.

Please let me know if you need any clarification of my thoughts as I understand it might not be very clear

Anyway its a great project!
Thanks

@pmknowles
Copy link

pmknowles commented Jun 21, 2021 via email

@Montreal666
Copy link

assuming you are in North america and considering all options:

Q1: here not using the same source and so far it works perfectly ; I have 4 units built/deployed (Dryer, Water heater, Hot tub, 240V heater); See design below + above.

image

Q3: Correct, as per design above, the relay is 10A and can be used as you like.
The sonoff just handles data processing via GPIO and hands it off to Tasmota.

@dajrekt
Copy link

dajrekt commented Jun 21, 2021

Q1. I powered the ESP from the lighting circuit (5A fuse in the UK). I then used an inline 1A fuse from the incoming (100A) breaker to the PZEM.

I thought you use the same source for both as per your picture via buck for ESP

Why did you not use lightning circuit for PZEM as well?
Does it need 1A fuse for PZEM?
Would you have any diagram?

Q3. You could use a contactor if you want to switch on/off a higher current remotely – however I’ve replaced 1 PZEM with a Shelly1PM which will switch 16A. I run it in MQTT mode so don’t flash with Tasmota. Hope that helps Regards Phil K

I use Sonoffs Pow 2 which also are 16A , they work great for media switching and measurement . To be honest I don't need to switch off the water heater or the dryer, it was only my curiosity :)

assuming you are in North america and considering all options:

I'm in Ireland, 230V single phase for domestic If I'm not wrong

Q1: here not using the same source and so far it works perfectly ; I have 4 units built/deployed (Dryer, Water heater, Hot tub, 240V heater); See design below + above.

Is the measurement accurate?
I will try it for sure but for some equipment I think will be easier to connect it in the fuse box.

Forgive me if I write some rubbish's or asking for obvious things. I know very little in this area however I was able to install my Sonoff pows myself so I'm learning :)

Thanks for you replies guys

@pmknowles
Copy link

pmknowles commented Jun 22, 2021 via email

@pmknowles
Copy link

pmknowles commented Jun 22, 2021 via email

@dajrekt
Copy link

dajrekt commented Jun 22, 2021

Thanks guys for your input

I have another question. Seems I have everything connected and configured but I'm not getting any readings from PZEM. Mine is V3 , someone above mentioned the same. Is there any issue with V3 or is it something wrong with my setup? I checked multiply times how is PZEM connected with hw655 and all looks good to me. 5V-5V , TX-RX, RX-TX , GND- GND. Any idea? ESP shows 0 everywhere . I also replaced HW and PZEM, same thing.

Regards

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@Montreal666
Copy link

Screenshot_20210622-235302_Office

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@dajrekt
Copy link

dajrekt commented Jun 23, 2021

Have you selected PZEM-016 for Rx? Needs to be that for V3 cos RS485. Regards Phil K

I have . but mine is opposite. GPIO1 is RX and GPIO3 is TX and module type is Generic 18 I think.

@dajrekt
Copy link

dajrekt commented Jun 23, 2021

Might have been setting the module address to 1

Do you mean change it to Sonoff basic?
I haven't try it , thought it doesn't matter

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@dajrekt
Copy link

dajrekt commented Jun 23, 2021

ModBus Address of the PZEM to 1

is it this one
ModuleAddress 1 ?

@dajrekt
Copy link

dajrekt commented Jun 23, 2021

Yes

thanks, I will check it when I'm back home,

Is there a chance that I missed something and the HW-655 must be flashed with something as well?

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@dajrekt
Copy link

dajrekt commented Jun 23, 2021

It has started working!
This is my config

20210623_185927

I also set the address of the modbus to 1 with this command in the console
ModuleAddress 1

This is comparison with Sonoff Pow R2
20210623_180718 (1)

Now I need to build another two meters and call for electrician to mess with my fuse box :)

Thanks for your help!

@pmknowles
Copy link

pmknowles commented Jun 23, 2021 via email

@Montreal666
Copy link

Additonnal note: If access is easier, you can also use the split cores directly at the breaker box;
Be careful to turn off main power or have an electrician do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Action - Waiting for response or more information question Type - Asking for Information
Projects
None yet
Development

No branches or pull requests