MWM in home automation

By khyizang, 7 February, 2017

Once MWM items can be integrated with home decor and controlled using an appropriate micro, etc, they become fair game for incorporation into home automation setups.   This need not be all that big a deal but becomes desirable the longer one tries to peacefully co-exist with the Holy Order of the Ever Blinking Light - aka MWM products.

For example, consider a simple MWM enabled lantern.  In essence, it's a lamp and should be useful as a lamp.  Lamps don't flash all sorts of colors all the time.  Most of the time they are a single, solid color - white.  We've become accustomed to the ability to dim lights, either for atmosphere or to save energy when an area isn't occupied.  Better yet, maybe the lamp only needs to be on when it's dark and there is someone in the area.  Same thing goes for any MWM hacks.  Only need to run at night and probably only when someone is there to admire them. 

Home automation setups attack these problems with light sensors, motion detectors, relays and a good bit of logic provided by a home automation controller.  While a full blown home automation system may not appeal to everyone, borrowing concepts from that domain can be useful for taming the wild and un-house-broken MWM products.  And, the Wand and Paintbrush are IR transmitters, just like other household remotes.  Add a little HA glue and those MWM transmitters could be made to control other household items. 

I'm currently working on enabling the Wand/Paintbrush to turn on/off some table lamps.  Well, actually, the design will work for anything that plugs into a wall socket and draws less than 10A.  Come to think of it, I'd be more excited if it would turn on the coffee pot.  Hmmm.  Anyway, the design doesn't require an external controller and might be delightful for kids in their room to control some lights.  I'd be further along with this if the snow hadn't messed up the roads.  More details once I can get over to Bellevue and can buy a couple single relay modules.

khyizang

8 years 5 months ago

In the inital post, I yaked about using signals from a Wand/Paintbrush to turn on anything that plugs into a wall socket.  Here's a sample of how that works:

 

The components needed to make this happen are pretty simple:

  • AC => DC, 5V transformer IC
  • Relay module that can be controlled by 5V pin
  • Arduino Pro Mini running at 5V, 16MHz
  • IR receiver
  • some code for the Arduino:

void chkCmd() {
  byte len = data[0] - 0x8E;
  byte crc = calc_crc(data,len);
  if (data[0] == 0x96 && data[1] == 0x19 && data[8] == crc) {
    _96cnt++;
    if (_96cnt == 2 && millis() - lastEntry < 200) {
      toggleRelay();
      _96cnt = 0;
      lastEntry = millis();
    } else {
      lastEntry = millis();
    }
    if(_96cnt > 2){
      _96cnt=0;
    }
  }
}

void toggleRelay() {
  Serial.println("Flipping the switch");
  if(state == LOW ){
    digitalWrite(relayPin,HIGH);
    state = HIGH;
  }else{
    digitalWrite(relayPin,LOW);
    state = LOW;
  }
}

Pretty simple and effective.  Hacks like this make it possible to interact with non-MWM devices to elicit almost anything.  Could do something like the interactive artwork at the Hong Kong park, or game stuff.  To switch lower power DC items only need a transistor or mosfet.  I've tested that, too, and it works fine.

To work with more than one device in a room, the IR receiver needs to be limited to a small tunneled view of the IR signals.  The wand cranks out enough signal that I was testing all this by bouncing the signal off the ceiling and back down to the receiver on the table.  So the receiver's viewport needs to be restricted.

 

"A long time ago, in a galaxy far, far away..." ... I remember someone stumbling into GwtS because they were looking for a way to do home automation stuff using IR and was looking for ideas on how to transmit/receive data packets. Is this circling back on that?

khyizang

8 years 5 months ago

Well, maybe categorizing this as home automation does it a disservice.  It's basically a means to enable a wand/paintbrush to become a remote for any kind of switch.  Needn't be a dedicated solution.  I can imagine a yard and/or house full of targets that could be toggled on/off using the wand as the user walks through.  Could be banks of lights and/or animatronics for Halloween, Christmas, art displays, home automation, games, etc.  Anything that might be interesting to control using a remote.

If one wanted to get real crazy with switching AC powered items, some of the tech from the Christmas guys could be borrowed and applied to solid state relays to get dimming capabilities, too.  Each button push would dim the target a certain amount until it goes out. Next push turns it back on.

Of course, there's nothing sacred about the wand/paintbrush in this solution.  Program any transmitter that you'd like to send out the codes and you'd get the same effect, but then, such complex codes may not be the best choice if you have more degrees of freedom to work with.

Broadening the scope a bit, if the micro that receives the wand/paintbrush signal simply reports the request to a centralized controller like in home automation/MQTT/CoAP (Disney's choice) then the wand/paintbrush becomes just one means to do the deed and not solely responsible for handling the job.  It could be a deal breaker if mom or dad need to find where the kid dumped the wand in order to turn off a light cuz it's hooked to a MWM controlled relay. 

It would be safer, too, as trafficking signals to centralized controllers is usually a low voltage, wireless affair.  Even when tripping a GPIO pin on something like a Falcon Player, it's low voltage.  The higher voltage stuff would be downstream and, hopefully, CE/UL approved.