I tend to get cold feet in the winter at the computer. So I bought a heated carpet last year. Unfortunately I keep forgetting to switch it off - most recently during a 2 week vacation! This needed to be fixed.
I had a few requirements: I want to manually decide when I need the carpet - I don't need it in the summer and in the winter I only need it when I'm cold. I only want to spend the 100W on heat when I'm at the desk, so the carpet should automatically switch off when I'm away. But it should automatically come back on when I return. In the evening it should power off completely so I have to manually switch it on again the next day.
Meet Tino MagicCarpet, the automatic heated carpet:
Basis is a Tino, powered by 2x aaa lithium, which sits on my desk.
A PIR (HC-SR501) with regulator and diode removed is powered via GPIO and feeds into INT1. The carpet is hooked up to a 433Mhz RF outlet, which can be controlled by the RFM69HW as described in
https://lowpowerlab.com/forum/index.php/topic,1115.msg7221.html#msg7221.
The Tino normally sits in ListenMode, with the PIR switched off, expending around 3uA which is fine for a long and warm summer
. When I'm cold I send a command to it to switch the carpet on. That causes the mote to switch the carpet on and enable the PIR. Also the Mote switches the WDT on to monitor the PIR. The PIR has been configured to the shortest possible On period and not to retrigger during the On state.
If the PIR sends no signal for 1 minute the mote switches the carpet off, but leaves the PIR on. When new PIR activity comes in, the carpet switches back on. After 1 hour of inactivity the PIR gets powered down and needs to be reactivated next morning by sending the heat command to the mote in ListenMode.
Pretty simple, but it actually took 1/2 day to get to work properly: The PIR would just always trigger when the rfm69hw went into TX to control the carpet or update status. I don't think this is caused by VCC drop: an oscilloscope trace didn't show any impact at the PIR. Also RX did not cause false triggers. But it's also not clear it's RF: i put another Moteino right next to the PIR and had it blast into it - no false triggering.
Anyway, I had to disable all status updates while the PIR is on and ignore PIR interrupts during carpet control and it now works fine.
From a battery budget perspective I expect this setup to last at least 2 years. We'll see.
Definitely more fun than doing my taxes - which was what I had planned to do yesterday
Joe