- Tue May 05, 2020 11:17 am
#86928
I thought I’d provide an update on this as I now have a working solution although it’s just taped to the side of the tumble dryer for the time being.
I tried the GY-521 accelerometer/gyroscope and it did work but programming it was a bit fiddly and it’s extremely sensitive. Someone walking outside the house caused it to detect movement. That meant faffing around with a sensitivity threshold in the sketch.
Then I came across specific vibration sensors and there is a board called SW-420 that is just a vibration sensor and only has three pins (Vcc, Gnd and the digital output). I often trawl AliExpress buying random ESP8266 bits and pieces on the basis that one day they will be useful and they are extremely cheap. Looking through my box of bits, I found two of them (thank you, past me) for which I had paid about £1.20 each.
The SW-420 was really easy to use as all I had to do was to detect whether the output had gone low at any point in the previous 5 seconds. If it had, I assume that the dryer is still going, if not, it’s finished. My draft sketch publishes an MQTT message every ten seconds with the payload ON or OFF and I use MQTT Dash on my Android phone to display a panel that is either blue if the dryer is off and orange if it’s on. That panel is updated each time the subscribed message is published. The SW-420 has a pot to adjust sensitivity. On the most sensitive setting it easily detects the vibration from the dryer but doesn’t seem to result in false positives.
All I need to do now is to tidy up the code a bit and fix it into the tumble dryer. Job done. I’ll make another one to use with the washing machine. I really play around with microcontrollers because it’s interesting, not because it’s useful but it’s good to make something useful and interesting. I’m sure Andreas Spiess (for those of you not familiar with him he has a YouTube channel that is centred around microcontrollers and sensors) would approve of that.
Thank you for the help with this.