If you did not know, the purpose of using this microcontroller is to create something like this: It’s an alarm clock which turns on the light gradually, simulating the light levels similar to a sunrise. Everyone knows it’s easy to wake up in the morning in summer. I hope make me wake up easily in winter too.
Philips does not sell that one in Japan (and not in US either), and amazon.de does not send electronic stuff outside the German speaking countries, so I’m on my own here. National sells something similar for even more money, but where’s the fun if you buy ready-built stuff…
While planning this project, I set my eye on the larger picture: complete home automation. Controll all light and power sockets from a central place. Have sensors like humidity/temperature/touch to tell a computer what to do. Like: at 6am gradually turn on the light in the bed room. If it’s cold, then turn on the heater in bed and living room. When I leave the bed room, turn off light and heater shortly later. When I leave the house, turn off all lights and all heaters. Would work fine in a single household. In my case, it would not work at all though. But the point is, I could make that.
The question now is: how to connect all those sensors and output devices. 4 choices I see:
- use extra cables
- use existing cables
- use wireless (radio)
- use wireless (IR)
Using new cables is not very attractive as this is rather ugly. There’s no raised floor in our appartment, so using
EIA-485 or cabled Ethernet is out for now.
Using existing (power) cables would be good if there would exist something easy to use. Something like X10. It communicates via power lines, but has problems with reliability in modern households and when more than one power phase is in use. I could not find anything for Japan. Maybe not possible to use or not allowed to use.
One could use Ethernet-over-power-lines. Maybe using one Ethernet connected controller per room would be ok, but some rooms in this apartment we live in are rather large, so the problem of connecting a light on/off switch still exists as I would need to run a cable from the switch to the microcontroller. But the amount of cables would be far smaller than if everything would have a cable go to a central patch room.
IR has the problem of not being able to cross rooms, so a lot of repeaters would be needed (1 per room).
Wireless does sound expensive. Wi-Fi would be neat as it interfaces well to any computer, but it’s expensive if you have a simple on/off switch and want to automize it: You’d need Ethernet (most small microcontrollers don’t have it), and a wireless bridge. Those are usually quite large and need their own power. I count about 20 lamps and about 24 switches. That’s a lot of Wi-Fi going on. Bluetooth would be better, but the Bluetooth stack is quite complicated and ready-to-use modules which take out the complexity are quite expensive.
An alternative I heard about years ago is
ZigBee: a mesh capable wireless network in the (crowded) 2.4GHz range, with slow transmission rate, but cheap to implement. “Cheap” is what they mentioned for Bluetooth too, but this at US$65 is not what I call cheap. 44 of those (20 lamps and 24 switches) plus the microcontroller to talk to it.
ZigBee is now called IEEE 802.15.4. That means it’s hopefully not going to die too soon. The best part is: at about US$25 (see here as an example) it’s much cheaper than e.g. Bluetooth.
And now the best part: those XBee modules, which implement ZigBee and offer:
- a serial interface with either a pass-through-mode or a more capable API mode
- 10 digital I/O pins
- 6 ADC channels
- PWM output even
- runs on 3.3V as the LPC2148 does
- it’s small
- it’s comparably cheap
Most switches or sockets don’t need anything but a single I/O pin, so in my example of 20 lamps and 24 switches, it’ll be 44 of those modules. If sockets/switches are physically near, then they can be combined, reducing the number likely by one third. That would be at US$25 per piece, US$750 for 30 of them. Quite doable.
I’ll get some of those modules and see what they can do.