Washing Machine · Dryer
Notify you when your dryer has finished a load of laundry by sending a PagerDuty alert.
- Behavior
- Prerequisites
- Circuit diagrams
- Installation
- Configuration
- Running
- Alerts
- Presentation
- References
- When you start a load of laundry in the dryer, an induction clamp sensor installed inside the dryer detects the increased current flowing from the start button to the motor.
- A .NET daemon running on a Raspberry Pi reads the voltage from the induction sensor using an analog-to-digital converter, and sends a Change event to PagerDuty when the motor starts.
- When the motor stops, the Raspberry Pi triggers an Alert in PagerDuty. This will notify you on your configured communications channels, like a push notification in the mobile app.
- When you open the dryer door to remove the laundry, another induction clamp sensor detects the door light turning on, and the Raspberry Pi automatically resolves the Alert so you don't keep getting notifications.
- Raspberry Pi 2 Model B rev 1.1 or later
- Raspberry Pi OS (Raspbian) Lite
- 32-bit or 64-bit
- USB Wi-Fi adapter, unless you have a Raspberry Pi 3 or later with built-in Wi-Fi
- USB AC adapter with a sufficiently long cable to reach the top of the dryer
- Raspberry Pi OS (Raspbian) Lite
- .NET Runtime 8 for Linux or later
- ARM32 or ARM64
- Neither Raspberry Pi nor Microsoft package repositories offer APT packages of .NET for ARM
- You can install .NET using my unofficial APT repository of .NET for Raspberry Pi, packaged from official Microsoft builds
wget -qO- https://raspbian.aldaviva.com/addrepo.sh | sh sudo apt install -y dotnet-runtime-latest
- Alternatively, you can install .NET using Microsoft's installation script, but it won't update with APT or choose the latest version
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh sudo bash dotnet-install.sh --channel LTS --runtime dotnet --install-dir /usr/share/dotnet/ sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet rm dotnet-install.sh
- PagerDuty account (the free plan is sufficient)
- Clothes dryer
- Kenmore 500 series 11065102310 240V 26A electric dryer
- The door light must be working for this program to detect when the door is opened, so you must replace the bulb if it has burned out.
- Make sure you use the OEM-style E12 incandescent light bulbs instead of LED replacements, because the LEDs don't draw enough current to be easily detectable.
- Current sensor circuit
- View all parts on Digi-Key
- YHDC 60 A voltage output current sensing clamp transformer to non-invasively measure the motor's AC amperage and output a proportional AC voltage in the range [0,1] V
- YHDC 5 A voltage output current sending clamp transformer for the door light AC amperage, which is much less than the motor current
- MCP3008 I/P 10-bit Analog-to-Digital Converter to convert the analog [0,1] V signals from the current transformers into digital [0,1023] values and send them over an SPI connection to the Raspberry Pi, which does not have its own built-in ADC
- 2 × 3.5 mm TRS jacks to connect the current transformers to the rest of the circuit
- 4 × 100 kΩ 0.5 W resistors for the voltage dividers, which add voltage to the transformer signals so the unsigned ADC won't clip negative values to 0
- 2 × 10 μF 50V aluminum electrolytic capacitors for the voltage dividers
- Breadboard (easy, but loose connections are likely) or perforated permanent-prototype board (requires soldering, but connections will be solid)
- Wires or jumper cables to connect the components
Visual diagram | Schematic diagram | Photo |
---|---|---|
⬇️ Download Fritzing file |
The 60 A motor clamp sensor attaches to the light blue wire that connects the Push To Start Relay to the Drive Motor.
The 5 A light clamp sensor attaches to the orange wire that connects the NC terminal of the Door Switch to the Drum Lamp.
-
Open the drum cabinet of the dryer by unscrewing the two Phillips screws on the lint trap, then prying up on the front edge of the top panel. There are two spring clips that hold it down in the front left and right corners. I used a plastic panel puller to lift the lid.
-
Clamp the 5 A current transformer around the orange wire that leads to the door switch on the right side of the cabinet.
-
Run the end of the wire with the 3.5 mm TRS plug up into the hole in the back center of the lid that leads to the control panel.
-
Close the cabinet lid and replace the two lint trap screws.
-
Open the control panel by pushing straight in (not pulling up) under the front left and right corners with a panel puller to release the two spring clips. Pitch the control panel back and rest it on something.
-
Clamp the 60 A current transformer around one of the two light blue wires leading to the Start button.
-
Place the Raspberry Pi, connected to the assembled current sensing circuit, underneath the control panel. You may need to stand the Raspberry Pi up on its edge so it will fit.
-
Connect the 3.5 mm TRS plug from the 60 A motor sensor (in the control panel) to the ADC Channel 0 (left) 3.5 mm jack in your circuit.
-
Connect the 3.5 mm TRS plug from the 5 A door light sensor (in the drum cabinet) to the ADC Channel 1 (right) 3.5 mm jack in your circuit.
-
Plug the Raspberry Pi into a USB AC power adapter and run the cable underneath the side of the control panel.
-
Check one final time that you can SSH into the Raspberry Pi.
-
Close the control panel.
- Enable the SPI kernel module on your Raspberry Pi using
sudo raspi-config
›3 Interface Options
›I4 SPI
, then reboot. - Download the
DryerDuty.zip
file from the latest release to your Raspberry Pi.wget https://github.com/Aldaviva/DryerDuty/releases/latest/download/DryerDuty.zip
- Extract the ZIP file to a directory like
/opt/dryerduty/
.sudo mkdir /opt/dryerduty sudo unzip DryerDuty.zip -d /opt/dryerduty rm DryerDuty.zip
- Allow the program to be executed.
sudo chmod +x /opt/dryerduty/DryerDuty
- Install the SystemD service.
# if you chose an installation directory that isn't /opt/dryerduty, edit ExecStart and WorkingDirectory in dryerduty.service sudo mv /opt/dryerduty/dryerduty.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable dryerduty.service
Create an Integration in PagerDuty and get its Integration Key.
- Sign into your PagerDuty account.
- Go to Services › Service Directory.
- Select an existing Service for which you want to publish events, or create a new Service.
- In the Integrations tab of the Service, add a new Integration.
- Under Most popular integrations, select Events API V2, then click Add.
- Expand the newly created Integration and copy its Integration Key, which will be used to authorize this program to send Events to the correct Service.
DryerDuty is configured using appsettings.json
in the installation directory.
pagerDutyIntegrationKey
is the Integration Key that PagerDuty gives you when you create a new Events API v2 Integration for one of your Services.motorMinimumActiveAmps
is the minimum current, in amps, which would indicate that the dryer's motor is running.- My dryer's motor runs at 4.33 A, so I set this to
2.0
.
- My dryer's motor runs at 4.33 A, so I set this to
lightMinimumActiveAmps
is the minimum current, in amps, which would indicate that the light bulb in the drum turned on because the door was opened.- My 15 W bulb runs at 0.08 A, so I set this to
0.04
.
- My 15 W bulb runs at 0.08 A, so I set this to
motorGain
is a coefficient which the motor current is multiplied by to get a more accurate value.- The default value is
1.0
, but I had to set mine to1.64
to match the current readings from my clamp multimeter.
- The default value is
lightGain
is a coefficient which the light bulb current is multiplied by to get a more accurate value.- The default value is
1.0
, but I had to set mine to0.75
to match the nominal current of my bulb.
- The default value is
Logging.LogLevel
controls the log verbosity, where the key is the namespace and the value is the log level name.- To see current readings from this library, set
Logging.LogLevel.DryerDuty
toTrace
and run/opt/dryerduty/DryerDuty
from the command line.
- To see current readings from this library, set
sudo systemctl restart dryerduty.service
sudo systemctl status dryerduty.service
🟢 dryerduty.service - DryerDuty
Loaded: loaded (/etc/systemd/system/dryerduty.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2023-09-23 01:21:11 PDT; 2h 44min ago
Main PID: 340 (DryerDuty)
Tasks: 19 (limit: 1714)
CPU: 3min 25.970s
CGroup: /system.slice/dryerduty.service
└─340 /opt/dryerduty/DryerDuty
Sep 23 01:21:03 dryer systemd[1]: Starting DryerDuty...
Sep 23 01:21:10 dryer DryerDuty[340]: DryerDuty.DryerMonitor[0] Timers started
Sep 23 01:21:11 dryer DryerDuty[340]: Microsoft.Hosting.Lifetime[0] Application started. Hosting environment: Production; Content root path: /opt/dryerduty
Sep 23 01:21:11 dryer systemd[1]: Started DryerDuty.
sudo journalctl -f -u dryerduty.service
-- Journal begins at Tue 2023-05-02 17:25:51 PDT, ends at Sat 2023-09-23 04:06:51 PDT. --
Sep 23 01:21:03 dryer systemd[1]: Starting DryerDuty...
Sep 23 01:21:10 dryer DryerDuty[340]: DryerDuty.DryerMonitor[0] Timers started
Sep 23 01:21:11 dryer DryerDuty[340]: Microsoft.Hosting.Lifetime[0] Application started. Hosting environment: Production; Content root path:>
Sep 23 01:21:11 dryer systemd[1]: Started DryerDuty.
-
When the dryer starts running, this program will send a Change event to PagerDuty with the summary
The dryer is starting a load of laundry.
-
When the dryer completes the load, this program will trigger a new Alert at the Info severity, with the summary
The dryer has finished a load of laundry.
-
When the dryer door is opened after it finishes a load, this program will automatically resolve the previously created Alert. You can also manually resolve the Alert from the PagerDuty web or mobile apps.
I gave a talk about this project for PagerDuty's 2024-02-09 How-To Happy Hour on their Twitch channel.
- command-tab/brewbot (Collin Allen)
- SCT-013 Split Core Current Transformer (InnovatorsGuru)
- MCP3xxx family of Analog to Digital Converters (Microsoft)
- Adafruit
- SparkFun
- OpenEnergyMonitor