Maker Pro
Maker Pro

Current sensing using transformer - how to limit inrush and false sense

Some back story:
I have setup an instance of "Home Assistant" to use as more of a monitor for the house, but also to automate a few things. One of my projects is to provide a notification of when laundry is done in both the washer and the dryer. My washer and dryer for some reason do not have any way to indicate that they are done, and yes, I checked all over :). Both are electric.

So what I decided on to use as a sensor, is a combination of accelerometer/gyro and current transformer for both the washer and the dryer. For the dryer, its a bit overkill, as the current transformer by itself would be enough to tell if its on, but I want to see if the accelerometer would be able to detect the door opening. As for the washer, both are required due to how the cycles work and the fact that the motor does not always run. These both go to an ESP32 NodeMCU loaded up with "ESPHome" which integrates to "Home Assistant"

The setup:
Using the following article as a guide (including the dc bias spoken about below in the thread): https://openenergymonitor.org/forum-archive/node/156.html
R1 and R2 = 470Ω
Burden = 12Ω
The CT is a 1000:1 unit with 2 wires coming out with 10Ω internal resistance (see amazon link: amzn.com/B01LWN37KS)

The issue(s):
There are 2 issues I'm having, one of which may be solved by the other, but I'm not sure:
1. When the washer motor starts, from what I am gathering, it knocks the ESP32 offline and into a state where it refuses to reconnect. My thought here would be that the inrush current is causing an issue with the adc input and causing the ESP32 to crash.
- My thought here is to use a series resistor... but I'm not sure if that would work, and I might need a hand with the value based on the circuit I have.

2. The current being sensed on the dryer, is also being reported on the washer, and vice versa.
The grounds on the ESP32 are all linked, but I made sure to use different physical connections for each transformer. I also separated the adc connections on the ESP32 as far as I physically could. If I remove the current transformer from either the washer or the dryer, and leave the other on, it reads correctly. If I change the leg I'm measuring on either the washer or the dryer, the result is the same.

- There could be a couple things going on here. The washer and dryer are both on the same circuit in the house (the washer is 110 and the dryer is 220, but 1 leg is common between them), I'm not sure if that would impact anything or not. Another thought is that maybe the current is being read on one leg of the circuit and is showing somehow on the other? I don't know... but maybe a diode could rule this out?

Let me know if you need anything else. I'll gladly provide as much info as possible.
 
Simplest non-invasive method would be to use a programmable timer set to the maximum run time of the device.
Start the timer which allows the device to start, and after the above run time setting, power drops to both the above device and an auxiliary no voltage contact relay.
No_volt relay contacts will interface with whatever you like and if you choose a changeover type relay, whatever logic you require.
 

Harald Kapp

Moderator
Moderator
1. A series resistor between burden and esp input may help. Try e.g. 1 kΩ. You can also add a 4.7 V zener diode between the esp's analog input and ground (cathode of the zener to the analog input).

2.Show us a diagram of at least the mains circuit setup you have, better yet mains + current sense transformers + esp connections (full schematic).

3. What value did you use for the decoupling capacitor on the midpoint rail (C1 in the schematic you linked)? An additional capacitor (e.g. 10 µF) directly connected to the top pin of R1 (5 V) may also help reduce sensitivity to noise.

A note on the side: R1, R2 = 470 Ω is good as it offers a low impedance for the midpoint, but it costs quite some power. Imho values > 1 kΩ should work equally well with less power dissipation.
 
Harald -
1. Thank you very much for the input! I think I might have a couple of zeners kicking around, I'll have to check, but I'll order some if all else fails.

2. I'll post a full schematic with some pictures here in a bit, the mains side might be difficult as I think there are also other devices on the circuit as well... the house was built in 1960, when people just load balanced by zigzagging the circuit across the house. But either way I'll post with the most info I can here shortly

3. The value of the decoupling cap that I used for C1 is 10μF.
Also a side note on this, my voltages are based on a 3.3v rail versus a 5v rail, my apologies for not mentioning this earlier.

And I will be running the ESP32 from a wall wart so I'm not too concerned about power consumption/dissipation, though I may very well change them out if I notice more heat or have an issue.

Thanks again!
 

Harald Kapp

Moderator
Moderator
my voltages are based on a 3.3v rail
Use a 3.3 V zener diode in that case.
And I will be running the ESP32 from a wall wart so I'm not too concerned about power consumption/dissipation,
Then 470 Ω are fine. The lower the resistance, the better the stability of the midpoint voltage.
the mains side might be difficult as I think there are also other devices on the circuit as well
???
If I were to install a current sensor for any device, I'd put it in the wiring that leads to the appliance. Such that only current flowing through this singular appliance is measured.
 
Harald,
Thanks again for your follow up!
I have some pictures at the bottom of the post. I'm working on getting at least something readable for the entire circuit, but here is a list of the pins and where they are connected:
For reference, see the following pinout diagram of my ESP32:
https://esphome.io/devices/nodemcu_esp32.html


Washer connection box pins:
3.3v - 3.3v out pin on esp32
GND - upper right side gnd
I2C SDA - GPIO33
I2C SCL - GPIO32
CT Sense - ADC0 (GPIO36)
CT GND - left side ground

Dryer connection box pins:
3.3V - 3.3v out pin on esp32
GND - upper right side gnd
I2C SDA - GPIO18
I2C SCL - GPIO19
CT Sense - ADC7 (GPIO35)
CT GND - lower right side ground

My apologies on the "mains circuit" comment, I thought you were looking for a diagram of the house circuit. I do have the current transformers on the appliances directly (as in the pictures below).

ESP32 Top view:
KX4JE7YNMm6tAB2S9


ESP32 Top (removed) view:
pTYo3ikGh5uFCccU6


ESP32 Bottom (connection) view:
HDkp8B7x3BTU3Tek7


Sensor Box Top view:
LcfmZwUw1wyShJeW7


Sensor Box bottom (connection) view:
Hpg647CkG7YMKHiY8


Washer and Dryer CT views:
qZqkT4FZ4QZNkaEX7
dffDpkDikYY643t48
 

Harald Kapp

Moderator
Moderator
Sorry, your pictures are not showing:
upload_2020-4-14_9-57-51.png

Please try uploading them again.


And could you draw a schematic for your pinout, please? The textual description of your washer and dryer connections is not easy to follow.
 
Sorry about the pictures... I thought a shareable link from google would work correctly, I guess not.
I have attached the pictures (file names correspond) to this post. The schematic will be on the next.

@Harald Kapp - One lead is connected to the midpoint (as in the schematic), and the other is on the ground side. The CT Sense and ground on the pin-out is on the ESP32 side. It will make more sense once I post the schematic I'm sure.

ESP32 - Top view
ESP32-Top.jpg

ESP32-Top-Removed
ESP32-Top-Removed.jpg

ESP32-Bottom-Connections:
ESP32-Bottom-Connections.jpg

Sensor Box Top:
Sensor-Box-Top.jpg

Sensor-Box-Bottom-Connections:
Sensor-Box-Bottom-Connections.jpg

Washer CT:
Washer-CT-small.jpg

Dryer CT:
Dryer-CT-small.jpg
 
Okay, so its not my best work, but if you use the diagram of ESP linked previously, or the one I attached below, things may be at least a little more clear.NodeMCU32S - Pinout.jpg

In the ZIP file, are the KICAD files. If you need me to export the sch file as something different, please let me know.
 

Attachments

  • LaundryMCU.zip
    6.5 KB · Views: 1

Harald Kapp

Moderator
Moderator
Not everyone can read kicad files. Post the schematic as pdf or inline image, please.
One lead is connected to the midpoint (as in the schematic), and the other is on the ground side.
I still do not understand: The ct needs to be connected between the midpoint and an anlog input of the ESP. There is no direct connection from the ct to gnd:
upload_2020-4-15_8-2-23.png
 
You are correct, the schematic above does not show a direct connection from CT to GND.
The modifications I made were due to a DC BIAS, as I only want to see a positive voltage on the ESP32, the below paragraph on the same page a bit lower:

2) Adding a DC Bias

If you were to connect one of the CT wires to ground and measure the voltage of the second wire, relative to ground, the voltage would vary from positive to negative with respect to ground. However, the Arduino analog inputs require a positive voltage. By connecting the CT lead we connected to ground, to a source at half the supply voltage instead, the CT output voltage will now swing above and below 2.5 V thus remaining positive.


Resistors R1 & R2 in the circuit diagram above are a voltage divider that provides the 2.5 V source (1.65 V for the emonTx). Capacitor C1 has a low reactance - a few hundred ohms - and provides a path for the alternating current to bypass the resistor. A value of 10 μF is suitable.

The person mentioned is using a different MCU, but same general idea.
All of that being said, please let me know if I have made a mistake somewhere along the line.


EDIT: okay, so after looking at your post and reading this a bunch more, I realized my mistake... clearly I was not reading things correctly before. I'll change the wiring and schematic and check the behavior.
 
Last edited:
Okay, so I made the modification so that one lead of the Current Transformer is on the midpoint, and the other is on the input/sense line to the ADC on the ESP.
The behavior is that the ESP does not detect anything, I will be verifying all of my soldering and ensuring that the output from the CT is indeed there. I have also changed the multiplier on the ADC (it was 10, I made it both 100 and 1) with no change to the results.

I'll get back hopefully sometime tomorrow, but if all else fails, later this week.

Thanks again!
 

Harald Kapp

Moderator
Moderator
I will be verifying all of my soldering and ensuring that the output from the CT is indeed there.
A voltmeter should show the voltage across the burden (ct output) as AC or from the ADC input to gnd as DC with added AC component regardless of the ESP's programming.
 
Top