Laundry monitoring using a CT sensor and XBee3 Zigbee RF module

Goal

Read the current state of my washer and dryer in order to know when the laundry is done. Yep, I’m too lazy to take the stairs to check on it.

Non-goals

Avoid any modifications to the electrical circuits of these high ampere/voltage appliances and avoid using a wireless (Z-Wave etc) controlled switch with power sensors. I was especially worried about using a wireless plug with a 240VAC (US) dryer circuit.

Solution

I use an XBee3 with12 bit ADC pins to read current transformer (CT) sensor values. This allows me to detect each appliance power state (i.e. whether CT voltage is detected via ADC pins) without any sensor plugs or wiring modifications to the washer and dryer circuits.

XBee3 Micropython code is here, with explanation how I implement the moving average.

This requires turning off your home’s main power, removing the circuit breaker panel cover, and clipping the CT sensors to each laundry circuit. I’m in the US and use the black or red hot wire on each circuit. The small CT sensor wires fit between the panel and the wall (placed between the mounting screws) so you don’t need to modify anything there either.

Removing your circuit breaker panel is obviously dangerous and if you’re not careful your family could find you as a smoking heap on the ground. So be careful.

The circuit to detect the power state each uses a SCT-013-030 30A Non-invasive AC Current Sensor Split-Core Current Transformer, a bearing resistor, and an electrolytic capacitor. The 12 bit XBee3 ADC reads the voltage across the resistor.

The XBee3 sends the ADC readings to the ZigBee coordinator about every 10 seconds. I wrote custom coordinator using .NET and C# xbeesharp. The coordinator code publishes each ADC reading to an MQTT broker. The state of the washer and dryer are also published as a separate topic. The state is based on a moving window of ADC values crossing a threshold. In my case the moving window is the sum of the last 10 ADC readings and the threshold “on” state is a value of 1000.

You can of course replace the XBee3 mesh network with any other wireless ADC sensor (e.g. ESPHome).

I use HA to integrate each state as an MQTT binary_sensor. HA gives me a convenient UX to read and control the binary sensors. If I don’t care if my wife has a long queue of laundry on the weekend (I usually only have one load of laundry a week), I can easily turn off the notifications if things get noisy. I use HA automation for notifications on the state of the laundry and use Twilio for messages.

EDIT: It occurred to me after writing this post that this makes for an excellent use of a boolean_input and an NFC tag backed by automation. A tag on the side of the washer toggles laundry status notifications. When I start the washer I scan to toggle notifications on, and when the dryer is done scan to turn them off. That way I don’t have to get other family members’ laundry state.
HA is such an excellent tool for glueing DIY projects together!

MQTT binary sensors for Home Assistant

- platform: mqtt
  name: "Washer"
  device_class: "power"
  unique_id: "xbee3-laundry-CT-sensor-washer"
  state_topic: "Laundry/washer"
  payload_on: "on"
  payload_off: "off"
  qos: 0
- platform: mqtt
  name: "Dryer"
  device_class: "power"
  unique_id: "xbee3-laundry-CT-sensor-dryer"
  state_topic: "Laundry/dryer"
  payload_on: "on"
  payload_off: "off"
  qos: 0

Example CT sensor

Schematic

  • R1 and R2: 33 ohms
  • C1 and C2: 10 microfarads
  • J1 and J2 connect to each CT.

Example automation that triggers a Twilio message via MQTT.

- id: '...'
  alias: Washer is done
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.washer
    from: 'on'
    to: 'off'
  condition: []
  action:
  - service: mqtt.publish
    data:
      topic: Home/sms/laundry
      payload: Washer is off.
  mode: single
4 Likes

Hello,

I’m newbie in Home Automation, and I Use Home Assistant with ZHA. I’me looking for a sensor to detect that an appliance (tool in my workshop) is running. I need something really reactive (like 1-2 sec of refresh time max).
Do you think that your sensor can do that, and if yes could help me to build one like this ?

Thanks

TomcatPi

I don’t use Zigbee, but I’m sure you can find a smart outlet with power monitoring. At least on my Z-Wave smart outlets, I can configure it so if there is a large enough change in current (Amperes), it will immediately send the current value. I don’t know for sure though if it does within 1-2 seconds.